7#ifndef PXR_IMAGING_HD_ST_PRIM_UTILS_H
8#define PXR_IMAGING_HD_ST_PRIM_UTILS_H
11#include "pxr/imaging/hdSt/api.h"
12#include "pxr/imaging/hdSt/resourceRegistry.h"
13#include "pxr/imaging/hd/sceneDelegate.h"
14#include "pxr/imaging/hd/rprim.h"
20PXR_NAMESPACE_OPEN_SCOPE
27struct HdRprimSharedData;
31using HdBufferArrayRangeSharedPtr = std::shared_ptr<class HdBufferArrayRange>;
33using HdBufferSourceSharedPtrVector = std::vector<HdBufferSourceSharedPtr>;
34using HdBufferSpecVector = std::vector<struct HdBufferSpec>;
35using HdSt_MaterialNetworkShaderSharedPtr =
36 std::shared_ptr<class HdSt_MaterialNetworkShader>;
38using HdStComputationSharedPtr = std::shared_ptr<class HdStComputation>;
40using HdStResourceRegistrySharedPtr =
41 std::shared_ptr<HdStResourceRegistry>;
53void HdStMarkGeomSubsetDrawItemsDirty(
HdRenderParam *renderParam);
56void HdStMarkGarbageCollectionNeeded(
HdRenderParam *renderParam);
63HdPrimvarDescriptorVector
64HdStGetPrimvarDescriptors(
66 HdStDrawItem
const * drawItem,
68 HdInterpolation interpolation,
69 const HdReprSharedPtr &repr =
nullptr,
70 HdMeshGeomStyle descGeomStyle = HdMeshGeomStyleInvalid,
71 int geomSubsetDescIndex = 0,
72 size_t numGeomSubsets = 0);
76HdPrimvarDescriptorVector
77HdStGetInstancerPrimvarDescriptors(
108 const bool hasDisplayOpacityPrimvar,
109 const bool displayInOverlay,
110 const bool occludedSelectionShowsThrough);
114HdSt_MaterialNetworkShaderSharedPtr
115HdStGetMaterialNetworkShader(
120HdSt_MaterialNetworkShaderSharedPtr
121HdStGetMaterialNetworkShader(
131bool HdStIsValidBAR(HdBufferArrayRangeSharedPtr
const& range);
136bool HdStCanSkipBARAllocationOrUpdate(
137 HdBufferSourceSharedPtrVector
const& sources,
138 HdStComputationComputeQueuePairVector
const& computations,
139 HdBufferArrayRangeSharedPtr
const& curRange,
140 HdDirtyBits dirtyBits);
143bool HdStCanSkipBARAllocationOrUpdate(
144 HdBufferSourceSharedPtrVector
const& sources,
145 HdBufferArrayRangeSharedPtr
const& curRange,
146 HdDirtyBits dirtyBits);
154HdStGetRemovedPrimvarBufferSpecs(
155 HdBufferArrayRangeSharedPtr
const& curRange,
156 HdPrimvarDescriptorVector
const& newPrimvarDescs,
157 HdExtComputationPrimvarDescriptorVector
const& newCompPrimvarDescs,
163HdStGetRemovedPrimvarBufferSpecs(
164 HdBufferArrayRangeSharedPtr
const& curRange,
165 HdPrimvarDescriptorVector
const& newPrimvarDescs,
177HdStGetRemovedOrReplacedPrimvarBufferSpecs(
178 HdBufferArrayRangeSharedPtr
const& curRange,
179 HdPrimvarDescriptorVector
const& newPrimvarDescs,
181 HdBufferSpecVector
const& updatedSpecs,
188void HdStUpdateDrawItemBAR(
189 HdBufferArrayRangeSharedPtr
const& newRange,
191 HdRprimSharedData *sharedData,
198bool HdStIsPrimvarExistentAndValid(
201 HdPrimvarDescriptorVector
const& primvars,
205bool HdStIsPrimvarValidForDrawItem(
206 const HdStDrawItem *drawItem,
216bool HdStShouldPopulateConstantPrimvars(
217 HdDirtyBits
const *dirtyBits,
224void HdStPopulateConstantPrimvars(
226 HdRprimSharedData *sharedData,
229 HdStDrawItem *drawItem,
230 HdDirtyBits *dirtyBits,
231 HdReprSharedPtr
const &repr,
232 HdMeshGeomStyle descGeomStyle,
233 int geomSubsetDescIndex,
234 size_t numGeomSubsets,
235 bool *hasMirroredTransform =
nullptr,
236 bool *hasDisplayOpacity =
nullptr,
237 bool *hasNormals =
nullptr);
245void HdStUpdateInstancerData(
249 HdStDrawItem *drawItem,
250 HdRprimSharedData *sharedData,
251 HdDirtyBits rprimDirtyBits,
252 bool *hasDisplayOpacity =
nullptr,
253 bool *hasNormals =
nullptr);
258bool HdStIsInstancePrimvarExistentAndValid(
269void HdStProcessTopologyVisibility(
270 VtIntArray invisibleElements,
271 int numTotalElements,
272 VtIntArray invisiblePoints,
274 HdRprimSharedData *sharedData,
275 HdStDrawItem *drawItem,
278 HdStResourceRegistrySharedPtr
const &resourceRegistry,
319bool HdStIsEnabledSharedVertexPrimvar();
322uint64_t HdStComputeSharedPrimvarId(
324 HdBufferSourceSharedPtrVector
const &sources,
325 HdStComputationComputeQueuePairVector
const &computations);
328void HdStGetBufferSpecsFromCompuations(
329 HdStComputationComputeQueuePairVector
const& computations,
330 HdBufferSpecVector *bufferSpecs);
332PXR_NAMESPACE_CLOSE_SCOPE
Tracks changes from the HdSceneDelegate, providing invalidation cues to the render engine.
A draw item is a light-weight representation of an HdRprim's resources and material to be used for re...
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
The render engine state for a given rprim from the scene graph.
Adapter class providing data exchange with the client scene graph.
HdSt implements instancing by drawing each proto multiple times with a single draw call.
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
std::vector< TfToken > TfTokenVector
Convenience types.