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
45 using HdStRenderPassStateSharedPtr = std::shared_ptr<class HdStRenderPassState>;
46 using HdStResourceRegistrySharedPtr =
47 std::shared_ptr<class HdStResourceRegistry>;
49 using HdSt_DrawBatchSharedPtr = std::shared_ptr<class HdSt_DrawBatch>;
50 using HdSt_DrawBatchSharedPtrVector = std::vector<HdSt_DrawBatchSharedPtr>;
69 void PrepareDraw(HdStRenderPassStateSharedPtr
const &renderPassState,
70 HdStResourceRegistrySharedPtr
const &resourceRegistry);
74 void ExecuteDraw(HdStRenderPassStateSharedPtr
const &renderPassState,
75 HdStResourceRegistrySharedPtr
const &resourceRegistry);
89 unsigned currentBatchVersion);
103 return _drawItems.size() - _visibleSize;
107 void SetEnableTinyPrimCulling(
bool tinyPrimCulling);
110 void _RebuildDrawBatches();
112 std::vector<HdStDrawItem const*> _drawItems;
113 std::vector<HdStDrawItemInstance> _drawItemInstances;
114 HdSt_DrawBatchSharedPtrVector _drawBatches;
116 unsigned int _visChangeCount;
117 unsigned int _drawBatchesVersion;
121 PXR_NAMESPACE_CLOSE_SCOPE
123 #endif //PXR_IMAGING_HD_ST_COMMAND_BUFFER_H
HDST_API void SyncDrawItemVisibility(unsigned visChangeCount)
Sync visibility state from RprimSharedState to DrawItemInstances.
HDST_API void RebuildDrawBatchesIfNeeded(unsigned currentBatchVersion)
Rebuild all draw batches if any underlying buffer array is invalidated.
HDST_API void PrepareDraw(HdStRenderPassStateSharedPtr const &renderPassState, HdStResourceRegistrySharedPtr const &resourceRegistry)
Prepare the command buffer for draw.
size_t GetVisibleSize() const
Returns the number of draw items, excluding culled items.
A container to store instance state for a drawitem.
A buffer of commands (HdStDrawItem or HdComputeItem objects) to be executed.
HDST_API void ExecuteDraw(HdStRenderPassStateSharedPtr const &renderPassState, HdStResourceRegistrySharedPtr const &resourceRegistry)
Execute the command buffer.
HDST_API void SwapDrawItems(std::vector< HdStDrawItem const * > *items, unsigned currentBatchVersion)
Destructively swaps the contents of items with the internal list of all draw items.
Stores a 4x4 matrix of double elements.
size_t GetCulledSize() const
Returns the number of culled draw items.
HDST_API void FrustumCull(GfMatrix4d const &cullMatrix)
Cull drawItemInstances based on passed in combined view and projection matrix.
size_t GetTotalSize() const
Returns the total number of draw items, including culled items.