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,
226void HdStPopulateConstantPrimvars(
228 HdRprimSharedData *sharedData,
231 HdStDrawItem *drawItem,
232 HdDirtyBits *dirtyBits,
233 HdReprSharedPtr
const &repr,
234 HdMeshGeomStyle descGeomStyle,
235 int geomSubsetDescIndex,
236 size_t numGeomSubsets,
237 HdBufferSpecVector
const& customSpecs,
238 bool *hasMirroredTransform =
nullptr,
239 bool *hasDisplayOpacity =
nullptr,
240 bool *hasNormals =
nullptr);
243void HdStPopulateConstantPrimvars(
245 HdRprimSharedData *sharedData,
248 HdStDrawItem *drawItem,
249 HdDirtyBits *dirtyBits,
250 HdReprSharedPtr
const &repr,
251 HdMeshGeomStyle descGeomStyle,
252 int geomSubsetDescIndex,
253 size_t numGeomSubsets,
254 bool *hasMirroredTransform =
nullptr,
255 bool *hasDisplayOpacity =
nullptr,
256 bool *hasNormals =
nullptr);
264void HdStUpdateInstancerData(
268 HdStDrawItem *drawItem,
269 HdRprimSharedData *sharedData,
270 HdDirtyBits rprimDirtyBits,
271 bool *hasDisplayOpacity =
nullptr,
272 bool *hasNormals =
nullptr);
277bool HdStIsInstancePrimvarExistentAndValid(
288void HdStProcessTopologyVisibility(
289 VtIntArray invisibleElements,
290 int numTotalElements,
291 VtIntArray invisiblePoints,
293 HdRprimSharedData *sharedData,
294 HdStDrawItem *drawItem,
297 HdStResourceRegistrySharedPtr
const &resourceRegistry,
338bool HdStIsEnabledSharedVertexPrimvar();
341uint64_t HdStComputeSharedPrimvarId(
343 HdBufferSourceSharedPtrVector
const &sources,
344 HdStComputationComputeQueuePairVector
const &computations);
347void HdStGetBufferSpecsFromCompuations(
348 HdStComputationComputeQueuePairVector
const& computations,
349 HdBufferSpecVector *bufferSpecs);
351PXR_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 render index is part of the Hydra 1.0 API and is only used for emulation purposes so that HdScene...
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.