24 #ifndef PXR_IMAGING_HD_BINDING_H
25 #define PXR_IMAGING_HD_BINDING_H
101 Set(type, location, textureUnit);
104 _typeAndLocation = (textureUnit << 24)|(location << 8)|(
int)(type);
106 bool IsValid()
const {
return _typeAndLocation >= 0; }
108 int GetLocation()
const {
return (_typeAndLocation >> 8) & 0xffff; }
112 return (_typeAndLocation < b._typeAndLocation);
115 int _typeAndLocation;
136 : _bindingType(bindingType)
141 , _isInterleaved(false)
144 , _concatenateNames(false)
151 : _bindingType(bindingType)
152 , _dataType(dataType)
156 , _isInterleaved(false)
159 , _concatenateNames(false)
166 : _bindingType(bindingType)
167 , _dataType(resource->GetTupleType().
type)
169 , _resource(resource)
171 , _isInterleaved(false)
174 , _concatenateNames(false)
184 bool interleave,
bool writable =
false,
185 size_t arraySize = 0,
bool concatenateNames =
false)
191 , _isInterleaved(interleave)
192 , _isWritable(writable)
193 , _arraySize(arraySize)
194 , _concatenateNames(concatenateNames)
204 return bool(_resource);
211 return _bar && !_isInterleaved;
219 return _bar && _isInterleaved;
225 return _bar && _isWritable;
231 return (!_bar) && (!_resource) && (_dataType ==
HdTypeInvalid);
255 if (_resource)
return _resource->GetOffset();
259 if (_bar)
return _bar->GetByteOffset(
TfToken());
281 return _concatenateNames;
306 template <
class HashState>
336 bool _concatenateNames;
342 #endif // PXR_IMAGING_HD_BINDING_H
GLboolean GLboolean GLboolean b
friend void TfHashAppend(HashState &h, HdBindingRequest const &br)
HdBindingRequest(HdBinding::Type bindingType, TfToken const &name)
PXR_NAMESPACE_OPEN_SCOPE typedef std::vector< class HdBinding > HdBindingVector
int GetTextureUnit() const
GLuint const GLchar * name
size_t GetArraySize() const
Array size if request is for an array of structs.
bool IsBufferArray() const
HdBindingRequest(HdBinding::Type type, TfToken const &name, HdBufferArrayRangeSharedPtr bar, bool interleave, bool writable=false, size_t arraySize=0, bool concatenateNames=false)
HdBinding(Type type, int location, int textureUnit=0)
HD_API bool operator==(HdBindingRequest const &other) const
bool ConcatenateNames() const
HdBufferResourceSharedPtr const & GetResource() const
int GetByteOffset() const
Returns the resource or buffer array range offset, defaults to zero.
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
std::shared_ptr< HdBufferResource > HdBufferResourceSharedPtr
bool operator<(HdBinding const &b) const
HdType GetDataType() const
Return the data type of this request.
GLfloat GLfloat GLfloat GLfloat h
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
HdBufferArrayRangeSharedPtr const & GetBar() const
HdBinding::Type GetBindingType() const
Returns the HdBinding type of this request.
HD_API size_t ComputeHash() const
TfToken const & GetName() const
HdBindingRequest(HdBinding::Type bindingType, TfToken const &name, HdType dataType)
HdBindingRequest()=default
#define PXR_NAMESPACE_CLOSE_SCOPE
std::shared_ptr< HdBufferArrayRange > HdBufferArrayRangeSharedPtr
HdBindingRequest(HdBinding::Type bindingType, TfToken const &name, HdBufferResourceSharedPtr const &resource)
HD_API bool operator!=(HdBindingRequest const &other) const
void Set(Type type, int location, int textureUnit)
std::vector< class HdBindingRequest > HdBindingRequestVector
bool IsInterleavedBufferArray() const