24#ifndef PXR_IMAGING_HD_ST_COMMAND_BUFFER_H
25#define PXR_IMAGING_HD_ST_COMMAND_BUFFER_H
28#include "pxr/imaging/hdSt/api.h"
29#include "pxr/imaging/hd/version.h"
30#include "pxr/imaging/hdSt/drawItemInstance.h"
37PXR_NAMESPACE_OPEN_SCOPE
45using HdStRenderPassStateSharedPtr = std::shared_ptr<class HdStRenderPassState>;
46using HdStResourceRegistrySharedPtr =
47 std::shared_ptr<class HdStResourceRegistry>;
49using HdDrawItemConstPtrVector = std::vector<class HdDrawItem const*>;
50using HdDrawItemConstPtrVectorSharedPtr
51 = std::shared_ptr<HdDrawItemConstPtrVector>;
53using HdSt_DrawBatchSharedPtr = std::shared_ptr<class HdSt_DrawBatch>;
54using HdSt_DrawBatchSharedPtrVector = std::vector<HdSt_DrawBatchSharedPtr>;
74 HdStRenderPassStateSharedPtr
const &renderPassState,
80 HdStRenderPassStateSharedPtr
const &renderPassState,
81 HdStResourceRegistrySharedPtr
const &resourceRegistry);
91 void SetDrawItems(HdDrawItemConstPtrVectorSharedPtr
const &drawItems,
92 unsigned currentBatchVersion,
102 if (_drawItems)
return _drawItems->size();
112 return _drawItems->size() - _visibleSize;
118 void SetEnableTinyPrimCulling(
bool tinyPrimCulling);
121 void _RebuildDrawBatches(
Hgi const *hgi);
124 void _FrustumCullCPU(
GfMatrix4d const &cullMatrix);
126 HdDrawItemConstPtrVectorSharedPtr _drawItems;
127 std::vector<HdStDrawItemInstance> _drawItemInstances;
128 HdSt_DrawBatchSharedPtrVector _drawBatches;
130 unsigned int _visChangeCount;
131 unsigned int _drawBatchesVersion;
135PXR_NAMESPACE_CLOSE_SCOPE
Stores a 4x4 matrix of double elements.
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
A buffer of commands (HdStDrawItem or HdComputeItem objects) to be executed.
size_t GetVisibleSize() const
Returns the number of draw items, excluding culled items.
HDST_API void PrepareDraw(HgiGraphicsCmds *gfxCmds, HdStRenderPassStateSharedPtr const &renderPassState, HdRenderIndex *renderIndex)
Prepare the command buffer for draw.
HDST_API void RebuildDrawBatchesIfNeeded(unsigned currentBatchVersion, Hgi const *hgi)
Rebuild all draw batches if any underlying buffer array is invalidated.
HDST_API void SyncDrawItemVisibility(unsigned visChangeCount)
Sync visibility state from RprimSharedState to DrawItemInstances.
size_t GetCulledSize() const
Returns the number of culled draw items.
size_t GetTotalSize() const
Returns the total number of draw items, including culled items.
HDST_API void SetDrawItems(HdDrawItemConstPtrVectorSharedPtr const &drawItems, unsigned currentBatchVersion, Hgi const *hgi)
Sets the draw items to use for batching.
HDST_API void ExecuteDraw(HgiGraphicsCmds *gfxCmds, HdStRenderPassStateSharedPtr const &renderPassState, HdStResourceRegistrySharedPtr const &resourceRegistry)
Execute the command buffer.
A container to store instance state for a drawitem.
A graphics API independent abstraction of graphics commands.
Hydra Graphics Interface.