7 #ifndef PXR_IMAGING_HDST_BINDING_H
8 #define PXR_IMAGING_HDST_BINDING_H
83 Set(type, location, textureUnit);
86 _typeAndLocation = (textureUnit << 24)|(location << 8)|(
int)(type);
88 bool IsValid()
const {
return _typeAndLocation >= 0; }
90 int GetLocation()
const {
return (_typeAndLocation >> 8) & 0xffff; }
92 int GetValue()
const {
return _typeAndLocation; }
94 return (_typeAndLocation < b._typeAndLocation);
118 : _bindingType(bindingType)
123 , _isInterleaved(false)
126 , _concatenateNames(false)
133 : _bindingType(bindingType)
134 , _dataType(dataType)
138 , _isInterleaved(false)
141 , _concatenateNames(false)
148 : _bindingType(bindingType)
149 , _dataType(resource->GetTupleType().
type)
151 , _resource(resource)
153 , _isInterleaved(false)
156 , _concatenateNames(false)
166 bool interleave,
bool writable =
false,
167 size_t arraySize = 0,
bool concatenateNames =
false)
173 , _isInterleaved(interleave)
174 , _isWritable(writable)
175 , _arraySize(arraySize)
176 , _concatenateNames(concatenateNames)
186 return bool(_resource);
193 return _bar && !_isInterleaved;
201 return _bar && _isInterleaved;
207 return _bar && _isWritable;
213 return (!_bar) && (!_resource) && (_dataType ==
HdTypeInvalid);
237 if (_resource)
return _resource->GetOffset();
241 if (_bar)
return _bar->GetByteOffset(
TfToken());
263 return _concatenateNames;
288 template <
class HashState>
318 bool _concatenateNames;
324 #endif // PXR_IMAGING_HDST_BINDING_H
HdStBindingRequest(HdStBinding::Type bindingType, TfToken const &name)
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
size_t GetArraySize() const
Array size if request is for an array of structs.
HdStBindingRequest(HdStBinding::Type bindingType, TfToken const &name, HdType dataType)
friend void TfHashAppend(HashState &h, HdStBindingRequest const &br)
std::vector< class HdStBindingRequest > HdStBindingRequestVector
int GetTextureUnit() const
HdStBinding::Type GetBindingType() const
Returns the HdStBinding type of this request.
HDST_API bool operator==(HdStBindingRequest const &other) const
HdBufferArrayRangeSharedPtr const & GetBar() const
bool IsBufferArray() const
HDST_API size_t ComputeHash() const
GLint GLint GLsizei GLint GLenum GLenum type
HdStBinding(Type type, int location, int textureUnit=0)
bool ConcatenateNames() const
HdStBufferResourceSharedPtr const & GetResource() const
HdStBindingRequest()=default
GLuint const GLchar * name
GLboolean GLboolean GLboolean b
HdStBindingRequest(HdStBinding::Type bindingType, TfToken const &name, HdStBufferResourceSharedPtr const &resource)
std::shared_ptr< class HdStBufferResource > HdStBufferResourceSharedPtr
int GetByteOffset() const
Returns the resource or buffer array range offset, defaults to zero.
GLfloat GLfloat GLfloat GLfloat h
TfToken const & GetName() const
bool IsInterleavedBufferArray() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
std::shared_ptr< HdBufferArrayRange > HdBufferArrayRangeSharedPtr
void Set(Type type, int location, int textureUnit)
HdType GetDataType() const
Return the data type of this request.
HdStBindingRequest(HdStBinding::Type type, TfToken const &name, HdBufferArrayRangeSharedPtr bar, bool interleave, bool writable=false, size_t arraySize=0, bool concatenateNames=false)
std::vector< class HdStBinding > HdStBindingVector
that also have some descendant prim *whose name begins with bar
HDST_API bool operator!=(HdStBindingRequest const &other) const
HUSD_API const char * dataType()
bool operator<(HdStBinding const &b) const