VTK  9.7.1
Public Member Functions | Public Attributes | List of all members
vtkOpenGLArrayTextureBufferAdapter Class Reference

Interfaces vtkDataArray to an OpenGL texture buffer. More...

#include <vtkOpenGLArrayTextureBufferAdapter.h>

Collaboration diagram for vtkOpenGLArrayTextureBufferAdapter:
[legend]

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. More...
 
bool GetUploaded () const
 Get/set the "already uploaded" guard. More...
 
void SetOwnsTexture (bool ownsTexture)
 Get/set who owns this adapter's Texture/Buffer. More...
 
bool GetOwnsTexture () const
 Get/set who owns this adapter's Texture/Buffer. More...
 
void SetPendingReset (bool pendingReset)
 Get/set the pending-reset flag used to recycle an adapter across rebuild cycles. More...
 
bool GetPendingReset () const
 Get/set the pending-reset flag used to recycle an adapter across rebuild cycles. More...
 

Public Attributes

std::vector< vtkSmartPointer< vtkDataArray > > Arrays
 
vtkSmartPointer< vtkTextureObject > Texture
 
vtkSmartPointer< vtkOpenGLBufferObject > Buffer
 
vtkOpenGLBufferObject::ObjectType BufferType
 
vtkOpenGLBufferObject::ObjectUsage BufferUsage
 
bool IntegerTexture
 
bool ScalarComponents
 

Detailed Description

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:

Definition at line 44 of file vtkOpenGLArrayTextureBufferAdapter.h.

Constructor & Destructor Documentation

vtkOpenGLArrayTextureBufferAdapter::vtkOpenGLArrayTextureBufferAdapter ( )
vtkOpenGLArrayTextureBufferAdapter::vtkOpenGLArrayTextureBufferAdapter ( vtkDataArray *  array,
bool  asScalars,
bool *  integerTexture = nullptr 
)
vtkOpenGLArrayTextureBufferAdapter::vtkOpenGLArrayTextureBufferAdapter ( const vtkOpenGLArrayTextureBufferAdapter &  )
default

Member Function Documentation

vtkOpenGLArrayTextureBufferAdapter& vtkOpenGLArrayTextureBufferAdapter::operator= ( const vtkOpenGLArrayTextureBufferAdapter &  )
default
void vtkOpenGLArrayTextureBufferAdapter::Upload ( vtkOpenGLRenderWindow *  renderWindow,
bool  force = false 
)
void vtkOpenGLArrayTextureBufferAdapter::ReleaseGraphicsResources ( vtkWindow *  window)
void vtkOpenGLArrayTextureBufferAdapter::SetUploaded ( bool  uploaded)
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.

bool vtkOpenGLArrayTextureBufferAdapter::GetUploaded ( ) const
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.

void vtkOpenGLArrayTextureBufferAdapter::SetOwnsTexture ( bool  ownsTexture)
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.

bool vtkOpenGLArrayTextureBufferAdapter::GetOwnsTexture ( ) const
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.

void vtkOpenGLArrayTextureBufferAdapter::SetPendingReset ( bool  pendingReset)
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.

bool vtkOpenGLArrayTextureBufferAdapter::GetPendingReset ( ) const
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.

Member Data Documentation

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.


The documentation for this class was generated from the following file: