13 #ifndef RE_VERTEX_ARRAY_H
14 #define RE_VERTEX_ARRAY_H
18 class RE_OGLConstAttribute;
35 const char *cachename =
nullptr,
40 const char *cachename =
nullptr,
45 const char *cachename =
nullptr,
49 const char *cachename =
nullptr,
56 const char *cachename);
66 int64 getMemoryUsage(
bool inclusive)
const;
70 { myCacheName =
name; }
81 void markAsUnused(
bool move_to_unused_cache =
true);
82 bool isUsed()
const {
return myInUse; }
103 void resetBuffer(
bool delete_cached =
false,
104 bool mark_as_unused =
true);
123 void setAttributeName(
const char *attrib);
131 void setLength(
int len);
135 bool setCapacity(
int cap);
139 void setInstanceStride(
int nprims);
143 { myInstanceGroup = instance_group; }
157 int array_index = 0);
162 {
return setArray(r,data, 0,myLength, array_index); }
169 {
return setArray(r, data, offset, length, array_index); }
179 int array_index = 0)
const;
192 void createConstant();
196 const fpreal64 *getConstant()
const;
210 int array_index = 0);
213 int array_index = 0);
214 void unmap(
RE_Render *
r,
int array_index = 0);
219 void *getPersistentMap(
int array_index = 0)
const;
222 bool isPersistentMap()
const;
242 const char *shader_attrib =
nullptr);
250 bool setupForAttribIndex(
RE_Render *
r,
int attrib_location,
272 int vertices_per_patch);
281 int vertices_per_patch);
289 int index_num_elements,
292 int vertices_per_patch);
303 {
return (i < myArray.entries()) ? myArray(i) : theNullArray; }
306 bool isBufferBound(
int array_index=0)
const;
313 int64 getSizeBytes()
const;
316 void print(std::ostream *os =
nullptr)
const;
317 void printValues(
RE_Render *
r, std::ostream &os,
318 int start=0,
int len=0)
const;
320 void addRef(
void (*callback)(
void *),
void *
data);
321 void removeRef(
void (*callback)(
void *),
void *
data);
337 void detachTexBuffer(
int index);
357 bool myMappedFlag[4];
410 static void arrayDeleted(
void *);
bool replaceArrayRange(RE_Render *r, const void *data, int offset, int length, int array_index)
RE_GenericAttribID getGenericID() const
UT_StringHolder myAttribName
int getNumBuffers() const
void setArrayType(RE_ArrayType t)
const RE_VertexArray * operator->() const
UT_Array< re_VertexArrayCB > myRefs
void cacheBuffer(const UT_StringHolder &name)
GLuint GLsizei GLsizei * length
bool isDefaultValue() const
UT_StringHolder myCacheName
RE_PersistentBufferMode myPersistentBufferMode
RE_GenericAttribID myGenID
RE_OGLConstAttribute * myConstAttrib
const char * getAttributeName() const
RE_BufferType myBufferType
bool isConstantBuffer() const
RE_CacheTagHandle myCacheTagHandle
RE_GPUType getDataType() const
GLuint GLint GLboolean GLint GLenum access
void setGenericID(RE_GenericAttribID id)
void allowShared(bool shared)
GLint GLenum GLboolean GLsizei stride
Wrapper around hboost::intrusive_ptr.
int getLengthScale() const
GLuint const GLchar * name
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
GLint GLenum GLboolean normalized
bool replaceArray(RE_Render *r, const void *data, int array_index=0)
int getInstanceStride() const
bool myPersistentMapCopied
RE_BufferUsageHint myUsage
void markAsDefaultValue(bool def)
static RE_OGLBufferHandle theNullArray
GLfloat GLfloat GLfloat GLfloat h
re_VertexArrayCB(void(*cb)(void *), void *d)
LeafData & operator=(const LeafData &)=delete
const RE_OGLBufferHandle & getArrayBuffer(int i=0) const
RE_VertexArray * operator->()
const char * getCacheName() const
RE_ArrayType getArrayType() const
RE_Texture * getTextureBufferObject() const
Simple class for a mutli-integer cache tag.
UT_Array< RE_OGLBufferHandle > myArray
int getInstanceGroup() const
int getVectorSize() const
ImageBuf OIIO_API zero(ROI roi, int nthreads=0)
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
RE_BufferType getBufferType() const
void setInstanceGroup(int instance_group)