85 #ifndef RE_OGLBuffer_H
86 #define RE_OGLBuffer_H
112 const char *
name =
nullptr,
120 void setAttributeName(
const char *attrib);
123 bool setFormat(
RE_GPUType type,
int vectorsize);
133 void setNormalizedFormat(
bool normalize =
true);
137 bool setLength(
int len);
143 bool setCapacity(
int size);
147 void setInstanceStride(
int nprim);
163 void setSubComponentIndex(
int index);
167 void setLabel(
RE_Render *,
const char *);
174 int offset = 0,
int sublen = 0);
177 int suboffset,
int sublength)
178 {
return setData(r, subdata, suboffset, sublength); }
183 int offset = 0,
int sublen = 0)
const;
193 bool geo_object =
false);
219 int vertices_per_patch);
225 int vertices_per_patch);
233 int vertices_per_patch);
249 {
return myMappedPersistentData; }
252 int64 getSizeBytes()
const;
257 int64 mem = inclusive ?
sizeof(*this) : 0;
258 mem += myAttribName.getMemoryUsage(
false);
277 int getID()
const {
return myBufferID; }
287 static int getMaxVertexArraySize(
RE_Render *r);
288 static int getMaxElementArraySize(
RE_Render *r);
292 {
bool e=myEnableFlag; myEnableFlag=
enabled;
return e; }
313 bool isUsed()
const {
return myUseCount>0; }
325 int vertices_per_patch);
386 bool geo_object =
false)
override;
397 int vertices_per_patch)
override;
404 int vertices_per_patch)
override;
413 int vertices_per_patch)
override;
419 int64 mem = inclusive ?
sizeof(*this) : 0;
532 bool bind_for_gpu_read =
true)
override;
RE_OGLPixelWriteBuffer(int xres=0, int yres=1)
int getInstanceStride() const
bool isBufferShared() const
bool setEnabled(bool enabled)
~RE_OGLVertexBuffer() override
virtual bool enable(RE_Render *r, unsigned int stride=0, bool geo_object=false)
RE_OGLVertexBuffer(RE_BufferType type, int num_elements, int capacity=-1)
GLuint GLsizei GLsizei * length
void setUsage(RE_BufferUsageHint hint)
uint32 getBufferOffset() const
bool replaceData(RE_Render *r, const void *subdata, int suboffset, int sublength)
GLenum GLenum GLsizei const GLuint GLboolean enabled
RE_OGLTexBuffer(int size, int cap=-1)
RE_OGLPixelReadBuffer(int xres=0, int yres=1)
RE_OGLShaderStorageBuffer(int size, int cap=-1)
RE_BufferAccess getMapAccess() const
RE_BufferUsageHint myUsage
void * myMappedPersistentData
bool enable(RE_Render *r, unsigned int stride=0, bool geo_object=false) override
void intrusive_ptr_release(T *x)
int getVectorSize() const
RE_OGLCopyPixelBuffer(int xres=0, int yres=1)
GLuint GLint GLboolean GLint GLenum access
GLint GLenum GLboolean GLsizei stride
int getSubComponentIndex() const
void setAttributeName(const char *attrib)
void drawRange(RE_Render *r, RE_PrimType prim_type, int start, int num, int num_instanced, int vertices_per_patch) override
GLuint const GLchar * name
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
RE_PersistentBufferMode myPersistentBufferMode
GLboolean GLboolean GLboolean b
~RE_OGLShaderStorageBuffer() override
void allowSharedBuffer(bool b=true)
RE_GPUType getDataType() const
RE_OGLTexture * getTBO() const
void intrusive_ptr_add_ref(T *x)
Basic cached object, with version and extra data only.
bool setFormat(RE_GPUType type, int vectorsize)
bool disable(RE_Render *r) override
void draw(RE_Render *r, RE_PrimType prim_type, unsigned int stride, int num_instanced, int vertices_per_patch) override
int64 getMemoryUsage(bool inclusive) const override
Returns the amount of main memory owned by this RE_OGLBuffer.
RE_BufferAccess myMappedAccess
void drawElements(RE_Render *r, RE_PrimType prim_type, RE_OGLBuffer *element_bufer, int offset, int num, int num_instanced, int vertices_per_patch) override
RE_BufferType getBufferType() const
void * getPersistentMap() const
int64 getMemoryUsage(bool inclusive) const override
const char * getAttributeName() const
RE_BufferType myBufferType
uint32 getBufferSize() const
RE_OGLElementBuffer(int num=0, int cap=-1)
constexpr T normalize(UT_FixedVector< T, D > &a) noexcept
RE_OGLAttributeBuffer(const char *name, int num=0, int cap=-1)