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 bool hasDisplayOpacityPrimvar,
109 bool occludedSelectionShowsThrough);
113HdSt_MaterialNetworkShaderSharedPtr
114HdStGetMaterialNetworkShader(
119HdSt_MaterialNetworkShaderSharedPtr
120HdStGetMaterialNetworkShader(
130bool HdStIsValidBAR(HdBufferArrayRangeSharedPtr
const& range);
135bool HdStCanSkipBARAllocationOrUpdate(
136 HdBufferSourceSharedPtrVector
const& sources,
137 HdStComputationComputeQueuePairVector
const& computations,
138 HdBufferArrayRangeSharedPtr
const& curRange,
139 HdDirtyBits dirtyBits);
142bool HdStCanSkipBARAllocationOrUpdate(
143 HdBufferSourceSharedPtrVector
const& sources,
144 HdBufferArrayRangeSharedPtr
const& curRange,
145 HdDirtyBits dirtyBits);
153HdStGetRemovedPrimvarBufferSpecs(
154 HdBufferArrayRangeSharedPtr
const& curRange,
155 HdPrimvarDescriptorVector
const& newPrimvarDescs,
156 HdExtComputationPrimvarDescriptorVector
const& newCompPrimvarDescs,
162HdStGetRemovedPrimvarBufferSpecs(
163 HdBufferArrayRangeSharedPtr
const& curRange,
164 HdPrimvarDescriptorVector
const& newPrimvarDescs,
176HdStGetRemovedOrReplacedPrimvarBufferSpecs(
177 HdBufferArrayRangeSharedPtr
const& curRange,
178 HdPrimvarDescriptorVector
const& newPrimvarDescs,
180 HdBufferSpecVector
const& updatedSpecs,
187void HdStUpdateDrawItemBAR(
188 HdBufferArrayRangeSharedPtr
const& newRange,
190 HdRprimSharedData *sharedData,
197bool HdStIsPrimvarExistentAndValid(
200 HdPrimvarDescriptorVector
const& primvars,
209bool HdStShouldPopulateConstantPrimvars(
210 HdDirtyBits
const *dirtyBits,
217void HdStPopulateConstantPrimvars(
219 HdRprimSharedData *sharedData,
222 HdStDrawItem *drawItem,
223 HdDirtyBits *dirtyBits,
224 HdPrimvarDescriptorVector
const& constantPrimvars,
225 bool *hasMirroredTransform =
nullptr);
233void HdStUpdateInstancerData(
237 HdStDrawItem *drawItem,
238 HdRprimSharedData *sharedData,
239 HdDirtyBits rprimDirtyBits);
244bool HdStIsInstancePrimvarExistentAndValid(
255void HdStProcessTopologyVisibility(
256 VtIntArray invisibleElements,
257 int numTotalElements,
258 VtIntArray invisiblePoints,
260 HdRprimSharedData *sharedData,
261 HdStDrawItem *drawItem,
264 HdStResourceRegistrySharedPtr
const &resourceRegistry,
305bool HdStIsEnabledSharedVertexPrimvar();
308uint64_t HdStComputeSharedPrimvarId(
310 HdBufferSourceSharedPtrVector
const &sources,
311 HdStComputationComputeQueuePairVector
const &computations);
314void HdStGetBufferSpecsFromCompuations(
315 HdStComputationComputeQueuePairVector
const& computations,
316 HdBufferSpecVector *bufferSpecs);
318PXR_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.
std::vector< TfToken > TfTokenVector
Convenience types.