7 #ifndef PXR_IMAGING_HDST_BINDING_H
8 #define PXR_IMAGING_HDST_BINDING_H
85 Set(type, location, textureUnit);
88 _typeAndLocation = (textureUnit << 24)|(location << 8)|(
int)(type);
90 bool IsValid()
const {
return _typeAndLocation >= 0; }
92 int GetLocation()
const {
return (_typeAndLocation >> 8) & 0xffff; }
94 int GetValue()
const {
return _typeAndLocation; }
96 return (_typeAndLocation < b._typeAndLocation);
120 : _bindingType(bindingType)
125 , _isInterleaved(false)
128 , _concatenateNames(false)
135 : _bindingType(bindingType)
136 , _dataType(dataType)
140 , _isInterleaved(false)
143 , _concatenateNames(false)
150 : _bindingType(bindingType)
151 , _dataType(resource->GetTupleType().
type)
153 , _resource(resource)
155 , _isInterleaved(false)
158 , _concatenateNames(false)
168 bool interleave,
bool writable =
false,
169 size_t arraySize = 0,
bool concatenateNames =
false)
175 , _isInterleaved(interleave)
176 , _isWritable(writable)
177 , _arraySize(arraySize)
178 , _concatenateNames(concatenateNames)
188 return bool(_resource);
195 return _bar && !_isInterleaved;
203 return _bar && _isInterleaved;
209 return _bar && _isWritable;
215 return (!_bar) && (!_resource) && (_dataType ==
HdTypeInvalid);
239 if (_resource)
return _resource->GetOffset();
243 if (_bar)
return _bar->GetByteOffset(
TfToken());
265 return _concatenateNames;
290 template <
class HashState>
320 bool _concatenateNames;
326 #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)
#define PXR_NAMESPACE_OPEN_SCOPE
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
#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