7#ifndef PXR_IMAGING_HD_ST_COMMAND_BUFFER_H
8#define PXR_IMAGING_HD_ST_COMMAND_BUFFER_H
11#include "pxr/imaging/hdSt/api.h"
12#include "pxr/imaging/hd/version.h"
13#include "pxr/imaging/hdSt/drawItemInstance.h"
20PXR_NAMESPACE_OPEN_SCOPE
28using HdStRenderPassStateSharedPtr = std::shared_ptr<class HdStRenderPassState>;
29using HdStResourceRegistrySharedPtr =
30 std::shared_ptr<class HdStResourceRegistry>;
32using HdDrawItemConstPtrVector = std::vector<class HdDrawItem const*>;
33using HdDrawItemConstPtrVectorSharedPtr
34 = std::shared_ptr<HdDrawItemConstPtrVector>;
36using HdSt_DrawBatchSharedPtr = std::shared_ptr<class HdSt_DrawBatch>;
37using HdSt_DrawBatchSharedPtrVector = std::vector<HdSt_DrawBatchSharedPtr>;
57 HdStRenderPassStateSharedPtr
const &renderPassState,
63 HdStRenderPassStateSharedPtr
const &renderPassState,
64 HdStResourceRegistrySharedPtr
const &resourceRegistry);
74 void SetDrawItems(HdDrawItemConstPtrVectorSharedPtr
const &drawItems,
75 unsigned currentBatchVersion,
85 if (_drawItems)
return _drawItems->size();
95 return _drawItems->size() - _visibleSize;
101 void SetEnableTinyPrimCulling(
bool tinyPrimCulling);
104 void _RebuildDrawBatches(
Hgi const *hgi);
107 void _FrustumCullCPU(
GfMatrix4d const &cullMatrix);
109 HdDrawItemConstPtrVectorSharedPtr _drawItems;
110 std::vector<HdStDrawItemInstance> _drawItemInstances;
111 HdSt_DrawBatchSharedPtrVector _drawBatches;
113 unsigned int _visChangeCount;
114 unsigned int _drawBatchesVersion;
118PXR_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.