24 #ifndef PXR_IMAGING_HDST_BINDING_H
25 #define PXR_IMAGING_HDST_BINDING_H
100 Set(type, location, textureUnit);
103 _typeAndLocation = (textureUnit << 24)|(location << 8)|(
int)(type);
105 bool IsValid()
const {
return _typeAndLocation >= 0; }
107 int GetLocation()
const {
return (_typeAndLocation >> 8) & 0xffff; }
111 return (_typeAndLocation < b._typeAndLocation);
114 int _typeAndLocation;
135 : _bindingType(bindingType)
140 , _isInterleaved(false)
143 , _concatenateNames(false)
150 : _bindingType(bindingType)
151 , _dataType(dataType)
155 , _isInterleaved(false)
158 , _concatenateNames(false)
165 : _bindingType(bindingType)
166 , _dataType(resource->GetTupleType().
type)
168 , _resource(resource)
170 , _isInterleaved(false)
173 , _concatenateNames(false)
183 bool interleave,
bool writable =
false,
184 size_t arraySize = 0,
bool concatenateNames =
false)
190 , _isInterleaved(interleave)
191 , _isWritable(writable)
192 , _arraySize(arraySize)
193 , _concatenateNames(concatenateNames)
203 return bool(_resource);
210 return _bar && !_isInterleaved;
218 return _bar && _isInterleaved;
224 return _bar && _isWritable;
230 return (!_bar) && (!_resource) && (_dataType ==
HdTypeInvalid);
254 if (_resource)
return _resource->GetOffset();
258 if (_bar)
return _bar->GetByteOffset(
TfToken());
280 return _concatenateNames;
305 template <
class HashState>
335 bool _concatenateNames;
341 #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
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