|
VTK
9.7.20260712
|
Interfaces vtkDataArray to an OpenGL texture buffer. More...
#include <vtkOpenGLArrayTextureBufferAdapter.h>
Public Member Functions | |
| vtkOpenGLArrayTextureBufferAdapter () | |
| vtkOpenGLArrayTextureBufferAdapter (vtkDataArray *array, bool asScalars, bool *integerTexture=nullptr) | |
| vtkOpenGLArrayTextureBufferAdapter (const vtkOpenGLArrayTextureBufferAdapter &)=default | |
| vtkOpenGLArrayTextureBufferAdapter & | operator= (const vtkOpenGLArrayTextureBufferAdapter &)=default |
| void | Upload (vtkOpenGLRenderWindow *renderWindow, bool force=false) |
| void | ReleaseGraphicsResources (vtkWindow *window) |
| void | SetUploaded (bool uploaded) |
| Get/set the "already uploaded" guard. | |
| bool | GetUploaded () const |
| Get/set the "already uploaded" guard. | |
| void | SetOwnsTexture (bool ownsTexture) |
| Get/set who owns this adapter's Texture/Buffer. | |
| bool | GetOwnsTexture () const |
| Get/set who owns this adapter's Texture/Buffer. | |
| void | SetPendingReset (bool pendingReset) |
| Get/set the pending-reset flag used to recycle an adapter across rebuild cycles. | |
| bool | GetPendingReset () const |
| Get/set the pending-reset flag used to recycle an adapter across rebuild cycles. | |
Public Attributes | |
| std::vector< vtkSmartPointer< vtkDataArray > > | Arrays |
| vtkSmartPointer< vtkTextureObject > | Texture |
| vtkSmartPointer< vtkOpenGLBufferObject > | Buffer |
| vtkOpenGLBufferObject::ObjectType | BufferType |
| vtkOpenGLBufferObject::ObjectUsage | BufferUsage |
| bool | IntegerTexture |
| bool | ScalarComponents |
Interfaces vtkDataArray to an OpenGL texture buffer.
The desktop OpenGL and GLES/WebGL2 upload paths are deliberately asymmetric because the two APIs store buffer-backed sampler data differently:
samplerBuffer is a real GL_TEXTURE_BUFFER, which OpenGL defines as a typed view over a buffer object: glTexBuffer binds the buffer's data store to the texture; there is no glTexImage* entry point for a buffer texture. The Buffer member is therefore the texture's actual storage (not a staging copy) and must outlive every fetch, so it is held for the lifetime of the texture rather than freed after upload. This keeps the flat texelFetch(samplerBuffer, int) indexing and the large GL_MAX_TEXTURE_BUFFER_SIZE limit.GL_TEXTURE_BUFFER, so vtkTextureObject emulates it with an ordinary 2D texture that owns its storage and is filled directly from client memory via glTexImage2D (see vtkTextureObject::EmulateTextureBufferWith2DTexturesFromRaw). No buffer object is involved, so Buffer stays null on that path; the shader instead reconstructs a 1D index into the tiled 2D image. Definition at line 44 of file vtkOpenGLArrayTextureBufferAdapter.h.
| vtkOpenGLArrayTextureBufferAdapter::vtkOpenGLArrayTextureBufferAdapter | ( | ) |
| vtkOpenGLArrayTextureBufferAdapter::vtkOpenGLArrayTextureBufferAdapter | ( | vtkDataArray * | array, |
| bool | asScalars, | ||
| bool * | integerTexture = nullptr ) |
|
default |
|
default |
| void vtkOpenGLArrayTextureBufferAdapter::Upload | ( | vtkOpenGLRenderWindow * | renderWindow, |
| bool | force = false ) |
| void vtkOpenGLArrayTextureBufferAdapter::ReleaseGraphicsResources | ( | vtkWindow * | window | ) |
|
inline |
Get/set the "already uploaded" guard.
When true, Upload() skips the GPU transfer unless forced; callers clear it (SetUploaded(false)) whenever the bound array list changes to request a re-upload. It is the GLES-safe replacement for the old Buffer->IsReady() check, since on GLES the data goes straight into the texture and no buffer object is kept around to query. The setter does not call Modified().
Definition at line 74 of file vtkOpenGLArrayTextureBufferAdapter.h.
|
inline |
Get/set the "already uploaded" guard.
When true, Upload() skips the GPU transfer unless forced; callers clear it (SetUploaded(false)) whenever the bound array list changes to request a re-upload. It is the GLES-safe replacement for the old Buffer->IsReady() check, since on GLES the data goes straight into the texture and no buffer object is kept around to query. The setter does not call Modified().
Definition at line 75 of file vtkOpenGLArrayTextureBufferAdapter.h.
|
inline |
Get/set who owns this adapter's Texture/Buffer.
True (the default) means the adapter owns them: it allocates them, may partially re-upload in place, and releases them in ReleaseGraphicsResources(). False means they are borrowed from a shared vtkOpenGLArrayTextureBufferCache entry that owns their lifetime; the adapter only references them and never frees or partially rewrites them. Upload() sets this automatically per call (false when it routes a single array through the cache, true otherwise). The setter does not call Modified().
Definition at line 88 of file vtkOpenGLArrayTextureBufferAdapter.h.
|
inline |
Get/set who owns this adapter's Texture/Buffer.
True (the default) means the adapter owns them: it allocates them, may partially re-upload in place, and releases them in ReleaseGraphicsResources(). False means they are borrowed from a shared vtkOpenGLArrayTextureBufferCache entry that owns their lifetime; the adapter only references them and never frees or partially rewrites them. Upload() sets this automatically per call (false when it routes a single array through the cache, true otherwise). The setter does not call Modified().
Definition at line 89 of file vtkOpenGLArrayTextureBufferAdapter.h.
|
inline |
Get/set the pending-reset flag used to recycle an adapter across rebuild cycles.
vtkDrawTexturedElements::BeginArrayRebuild() sets it on every adapter; the first Bind/Append of the new cycle then drops the stale source-array list (keeping the GL texture/buffer and layout records so the next Upload() can diff against them) and clears the flag. An adapter still flagged after the cycle was not re-listed this frame, so draw-time loops skip it rather than upload/activate a now-stale array. The setter does not call Modified().
Definition at line 101 of file vtkOpenGLArrayTextureBufferAdapter.h.
|
inline |
Get/set the pending-reset flag used to recycle an adapter across rebuild cycles.
vtkDrawTexturedElements::BeginArrayRebuild() sets it on every adapter; the first Bind/Append of the new cycle then drops the stale source-array list (keeping the GL texture/buffer and layout records so the next Upload() can diff against them) and clears the flag. An adapter still flagged after the cycle was not re-listed this frame, so draw-time loops skip it rather than upload/activate a now-stale array. The setter does not call Modified().
Definition at line 102 of file vtkOpenGLArrayTextureBufferAdapter.h.
| std::vector<vtkSmartPointer<vtkDataArray> > vtkOpenGLArrayTextureBufferAdapter::Arrays |
Definition at line 47 of file vtkOpenGLArrayTextureBufferAdapter.h.
| vtkSmartPointer<vtkTextureObject> vtkOpenGLArrayTextureBufferAdapter::Texture |
Definition at line 48 of file vtkOpenGLArrayTextureBufferAdapter.h.
| vtkSmartPointer<vtkOpenGLBufferObject> vtkOpenGLArrayTextureBufferAdapter::Buffer |
Definition at line 49 of file vtkOpenGLArrayTextureBufferAdapter.h.
| vtkOpenGLBufferObject::ObjectType vtkOpenGLArrayTextureBufferAdapter::BufferType |
Definition at line 50 of file vtkOpenGLArrayTextureBufferAdapter.h.
| vtkOpenGLBufferObject::ObjectUsage vtkOpenGLArrayTextureBufferAdapter::BufferUsage |
Definition at line 51 of file vtkOpenGLArrayTextureBufferAdapter.h.
| bool vtkOpenGLArrayTextureBufferAdapter::IntegerTexture |
Definition at line 52 of file vtkOpenGLArrayTextureBufferAdapter.h.
| bool vtkOpenGLArrayTextureBufferAdapter::ScalarComponents |
Definition at line 53 of file vtkOpenGLArrayTextureBufferAdapter.h.