24#ifndef PXR_IMAGING_HD_ST_PRIM_UTILS_H
25#define PXR_IMAGING_HD_ST_PRIM_UTILS_H
28#include "pxr/imaging/hdSt/api.h"
29#include "pxr/imaging/hdSt/resourceRegistry.h"
30#include "pxr/imaging/hd/sceneDelegate.h"
31#include "pxr/imaging/hd/rprim.h"
37PXR_NAMESPACE_OPEN_SCOPE
44struct HdRprimSharedData;
48using HdBufferArrayRangeSharedPtr = std::shared_ptr<class HdBufferArrayRange>;
50using HdBufferSourceSharedPtrVector = std::vector<HdBufferSourceSharedPtr>;
51using HdBufferSpecVector = std::vector<struct HdBufferSpec>;
52using HdSt_MaterialNetworkShaderSharedPtr =
53 std::shared_ptr<class HdSt_MaterialNetworkShader>;
55using HdStComputationSharedPtr = std::shared_ptr<class HdStComputation>;
57using HdStResourceRegistrySharedPtr =
58 std::shared_ptr<HdStResourceRegistry>;
70void HdStMarkGeomSubsetDrawItemsDirty(
HdRenderParam *renderParam);
73void HdStMarkGarbageCollectionNeeded(
HdRenderParam *renderParam);
80HdPrimvarDescriptorVector
81HdStGetPrimvarDescriptors(
83 HdStDrawItem
const * drawItem,
85 HdInterpolation interpolation,
86 const HdReprSharedPtr &repr =
nullptr,
87 HdMeshGeomStyle descGeomStyle = HdMeshGeomStyleInvalid,
88 int geomSubsetDescIndex = 0,
89 size_t numGeomSubsets = 0);
93HdPrimvarDescriptorVector
94HdStGetInstancerPrimvarDescriptors(
125 bool hasDisplayOpacityPrimvar,
126 bool occludedSelectionShowsThrough);
130HdSt_MaterialNetworkShaderSharedPtr
131HdStGetMaterialNetworkShader(
136HdSt_MaterialNetworkShaderSharedPtr
137HdStGetMaterialNetworkShader(
147bool HdStIsValidBAR(HdBufferArrayRangeSharedPtr
const& range);
152bool HdStCanSkipBARAllocationOrUpdate(
153 HdBufferSourceSharedPtrVector
const& sources,
154 HdStComputationComputeQueuePairVector
const& computations,
155 HdBufferArrayRangeSharedPtr
const& curRange,
156 HdDirtyBits dirtyBits);
159bool HdStCanSkipBARAllocationOrUpdate(
160 HdBufferSourceSharedPtrVector
const& sources,
161 HdBufferArrayRangeSharedPtr
const& curRange,
162 HdDirtyBits dirtyBits);
170HdStGetRemovedPrimvarBufferSpecs(
171 HdBufferArrayRangeSharedPtr
const& curRange,
172 HdPrimvarDescriptorVector
const& newPrimvarDescs,
173 HdExtComputationPrimvarDescriptorVector
const& newCompPrimvarDescs,
179HdStGetRemovedPrimvarBufferSpecs(
180 HdBufferArrayRangeSharedPtr
const& curRange,
181 HdPrimvarDescriptorVector
const& newPrimvarDescs,
189void HdStUpdateDrawItemBAR(
190 HdBufferArrayRangeSharedPtr
const& newRange,
192 HdRprimSharedData *sharedData,
199bool HdStIsPrimvarExistentAndValid(
202 HdPrimvarDescriptorVector
const& primvars,
211bool HdStShouldPopulateConstantPrimvars(
212 HdDirtyBits
const *dirtyBits,
219void HdStPopulateConstantPrimvars(
221 HdRprimSharedData *sharedData,
224 HdStDrawItem *drawItem,
225 HdDirtyBits *dirtyBits,
226 HdPrimvarDescriptorVector
const& constantPrimvars,
227 bool *hasMirroredTransform =
nullptr);
235void HdStUpdateInstancerData(
239 HdStDrawItem *drawItem,
240 HdRprimSharedData *sharedData,
241 HdDirtyBits rprimDirtyBits);
246bool HdStIsInstancePrimvarExistentAndValid(
257void HdStProcessTopologyVisibility(
258 VtIntArray invisibleElements,
259 int numTotalElements,
260 VtIntArray invisiblePoints,
262 HdRprimSharedData *sharedData,
263 HdStDrawItem *drawItem,
266 HdStResourceRegistrySharedPtr
const &resourceRegistry,
307bool HdStIsEnabledSharedVertexPrimvar();
310uint64_t HdStComputeSharedPrimvarId(
312 HdBufferSourceSharedPtrVector
const &sources,
313 HdStComputationComputeQueuePairVector
const &computations);
316void HdStGetBufferSpecsFromCompuations(
317 HdStComputationComputeQueuePairVector
const& computations,
318 HdBufferSpecVector *bufferSpecs);
320PXR_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.