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,
193HdStGetRemovedOrReplacedPrimvarBufferSpecs(
194 HdBufferArrayRangeSharedPtr
const& curRange,
195 HdPrimvarDescriptorVector
const& newPrimvarDescs,
197 HdBufferSpecVector
const& updatedSpecs,
204void HdStUpdateDrawItemBAR(
205 HdBufferArrayRangeSharedPtr
const& newRange,
207 HdRprimSharedData *sharedData,
214bool HdStIsPrimvarExistentAndValid(
217 HdPrimvarDescriptorVector
const& primvars,
226bool HdStShouldPopulateConstantPrimvars(
227 HdDirtyBits
const *dirtyBits,
234void HdStPopulateConstantPrimvars(
236 HdRprimSharedData *sharedData,
239 HdStDrawItem *drawItem,
240 HdDirtyBits *dirtyBits,
241 HdPrimvarDescriptorVector
const& constantPrimvars,
242 bool *hasMirroredTransform =
nullptr);
250void HdStUpdateInstancerData(
254 HdStDrawItem *drawItem,
255 HdRprimSharedData *sharedData,
256 HdDirtyBits rprimDirtyBits);
261bool HdStIsInstancePrimvarExistentAndValid(
272void HdStProcessTopologyVisibility(
273 VtIntArray invisibleElements,
274 int numTotalElements,
275 VtIntArray invisiblePoints,
277 HdRprimSharedData *sharedData,
278 HdStDrawItem *drawItem,
281 HdStResourceRegistrySharedPtr
const &resourceRegistry,
322bool HdStIsEnabledSharedVertexPrimvar();
325uint64_t HdStComputeSharedPrimvarId(
327 HdBufferSourceSharedPtrVector
const &sources,
328 HdStComputationComputeQueuePairVector
const &computations);
331void HdStGetBufferSpecsFromCompuations(
332 HdStComputationComputeQueuePairVector
const& computations,
333 HdBufferSpecVector *bufferSpecs);
335PXR_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.