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" 39 PXR_NAMESPACE_OPEN_SCOPE
47 using HdStRenderPassStateSharedPtr = std::shared_ptr<class HdStRenderPassState>;
48 using HdStResourceRegistrySharedPtr =
49 std::shared_ptr<class HdStResourceRegistry>;
51 using HdDrawItemConstPtrVector = std::vector<class HdDrawItem const*>;
52 using HdDrawItemConstPtrVectorSharedPtr
53 = std::shared_ptr<HdDrawItemConstPtrVector>;
55 using HdSt_DrawBatchSharedPtr = std::shared_ptr<class HdSt_DrawBatch>;
56 using HdSt_DrawBatchSharedPtrVector = std::vector<HdSt_DrawBatchSharedPtr>;
75 void PrepareDraw(HdStRenderPassStateSharedPtr
const &renderPassState,
76 HdStResourceRegistrySharedPtr
const &resourceRegistry);
81 HdStRenderPassStateSharedPtr
const &renderPassState,
82 HdStResourceRegistrySharedPtr
const &resourceRegistry);
96 void SetDrawItems(HdDrawItemConstPtrVectorSharedPtr
const &drawItems,
97 unsigned currentBatchVersion,
107 if (_drawItems)
return _drawItems->size();
117 return _drawItems->size() - _visibleSize;
123 void SetEnableTinyPrimCulling(
bool tinyPrimCulling);
128 HdDrawItemConstPtrVectorSharedPtr _drawItems;
129 std::vector<HdStDrawItemInstance> _drawItemInstances;
130 HdSt_DrawBatchSharedPtrVector _drawBatches;
132 unsigned int _visChangeCount;
133 unsigned int _drawBatchesVersion;
137 PXR_NAMESPACE_CLOSE_SCOPE
139 #endif //PXR_IMAGING_HD_ST_COMMAND_BUFFER_H HDST_API void SyncDrawItemVisibility(unsigned visChangeCount)
Sync visibility state from RprimSharedState to DrawItemInstances.
A graphics API independent abstraction of graphics commands.
HDST_API void PrepareDraw(HdStRenderPassStateSharedPtr const &renderPassState, HdStResourceRegistrySharedPtr const &resourceRegistry)
Prepare the command buffer for draw.
HDST_API void SetDrawItems(HdDrawItemConstPtrVectorSharedPtr const &drawItems, unsigned currentBatchVersion, HgiCapabilities const *hgiCapabilities)
Sets the draw items to use for batching.
A container to store instance state for a drawitem.
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 RebuildDrawBatchesIfNeeded(unsigned currentBatchVersion, HgiCapabilities const *hgiCapabilities)
Rebuild all draw batches if any underlying buffer array is invalidated.
size_t GetTotalSize() const
Returns the total number of draw items, including culled items.
Stores a 4x4 matrix of double elements.
Reports the capabilities of the Hgi device.
size_t GetCulledSize() const
Returns the number of culled draw items.
HDST_API void ExecuteDraw(HgiGraphicsCmds *gfxCmds, HdStRenderPassStateSharedPtr const &renderPassState, HdStResourceRegistrySharedPtr const &resourceRegistry)
Execute the command buffer.
HDST_API void FrustumCull(GfMatrix4d const &cullMatrix)
Cull drawItemInstances based on passed in combined view and projection matrix.