24#ifndef PXR_IMAGING_HD_ST_DISPATCH_BUFFER_H
25#define PXR_IMAGING_HD_ST_DISPATCH_BUFFER_H
28#include "pxr/imaging/hd/version.h"
29#include "pxr/imaging/hd/bufferArray.h"
30#include "pxr/imaging/hd/bufferSpec.h"
31#include "pxr/imaging/hdSt/api.h"
32#include "pxr/imaging/hdSt/bufferArrayRange.h"
33#include "pxr/imaging/hdSt/bufferResource.h"
37PXR_NAMESPACE_OPEN_SCOPE
41using HdStDispatchBufferSharedPtr = std::shared_ptr<class HdStDispatchBuffer>;
99 unsigned int commandNumUints);
128 return _entireResource;
136 std::vector<HdBufferArrayRangeSharedPtr>
const &,
137 HdBufferArraySharedPtr
const &)
override;
155 HdStBufferResourceNamedList
const&
GetResources()
const {
return _resourceList;}
168 unsigned int _commandNumUints;
169 HdStBufferResourceNamedList _resourceList;
170 HdStBufferResourceSharedPtr _entireResource;
171 HdStBufferArrayRangeSharedPtr _bar;
175PXR_NAMESPACE_CLOSE_SCOPE
Similar to a VAO, this object is a bundle of coherent buffers.
A VBO of a simple array of unsigned integers.
HDST_API HdStBufferResourceSharedPtr _AddResource(TfToken const &name, HdTupleType tupleType, int offset, int stride)
Adds a new, named GPU resource and returns it.
HDST_API HdStBufferResourceSharedPtr GetResource(TfToken const &name)
Returns the named GPU resource.
int GetCount() const
Returns the dispatch count.
HDST_API HdStBufferResourceSharedPtr GetResource() const
Returns the GPU resource.
HDST_API void CopyData(std::vector< uint32_t > const &data)
Update entire buffer data.
HDST_API void Reallocate(std::vector< HdBufferArrayRangeSharedPtr > const &, HdBufferArraySharedPtr const &) override
Performs reallocation.
HdStBufferResourceSharedPtr GetEntireResource() const
Returns entire buffer as a single HdStBufferResource.
HDST_API bool GarbageCollect() override
Performs compaction if necessary and returns true if it becomes empty.
HDST_API void DebugDump(std::ostream &out) const override
Debug output.
HdStBufferResourceNamedList const & GetResources() const
Returns the list of all named GPU resources for this bufferArray.
HDST_API ~HdStDispatchBuffer() override
Destructor.
HDST_API void AddBufferResourceView(TfToken const &name, HdTupleType tupleType, int offset)
Add an interleaved view to this buffer.
HDST_API HdStDispatchBuffer(HdStResourceRegistry *resourceRegistry, TfToken const &role, int count, unsigned int commandNumUints)
Constructor. commandNumUints is given in how many integers.
unsigned int GetCommandNumUints() const
Returns the number of uints in a single draw command.
HdStBufferArrayRangeSharedPtr GetBufferArrayRange() const
Returns a bar which locates all interleaved resources of the entire buffer.
A central registry of all GPU resources.
Token for efficient comparison, assignment, and hashing of known strings.
HdTupleType represents zero, one, or more values of the same HdType.