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,
210bool HdStShouldPopulateConstantPrimvars(
211 HdDirtyBits
const *dirtyBits,
218void HdStPopulateConstantPrimvars(
220 HdRprimSharedData *sharedData,
223 HdStDrawItem *drawItem,
224 HdDirtyBits *dirtyBits,
225 HdPrimvarDescriptorVector
const& constantPrimvars,
226 bool *hasMirroredTransform =
nullptr);
234void HdStUpdateInstancerData(
238 HdStDrawItem *drawItem,
239 HdRprimSharedData *sharedData,
240 HdDirtyBits rprimDirtyBits);
245bool HdStIsInstancePrimvarExistentAndValid(
256void HdStProcessTopologyVisibility(
257 VtIntArray invisibleElements,
258 int numTotalElements,
259 VtIntArray invisiblePoints,
261 HdRprimSharedData *sharedData,
262 HdStDrawItem *drawItem,
265 HdStResourceRegistrySharedPtr
const &resourceRegistry,
306bool HdStIsEnabledSharedVertexPrimvar();
309uint64_t HdStComputeSharedPrimvarId(
311 HdBufferSourceSharedPtrVector
const &sources,
312 HdStComputationComputeQueuePairVector
const &computations);
315void HdStGetBufferSpecsFromCompuations(
316 HdStComputationComputeQueuePairVector
const& computations,
317 HdBufferSpecVector *bufferSpecs);
319PXR_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.