Loading...
Searching...
No Matches
resourceRegistry.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HD_ST_RESOURCE_REGISTRY_H
8#define PXR_IMAGING_HD_ST_RESOURCE_REGISTRY_H
9
10#include "pxr/pxr.h"
12
13#include "pxr/imaging/hdSt/api.h"
14#include "pxr/imaging/hdSt/bufferArrayRegistry.h"
15#include "pxr/imaging/hdSt/enums.h"
16#include "pxr/imaging/hdSt/renderBufferPool.h"
17
18#include "pxr/imaging/hgi/hgi.h"
19
20#include "pxr/imaging/hd/bufferArrayRange.h"
21#include "pxr/imaging/hd/bufferSource.h"
22#include "pxr/imaging/hd/bufferSpec.h"
23#include "pxr/imaging/hd/instanceRegistry.h"
24#include "pxr/imaging/hd/resourceRegistry.h"
25
26#include <tbb/concurrent_vector.h>
27
28#include <atomic>
29#include <map>
30#include <memory>
31
32#ifdef PXR_MATERIALX_SUPPORT_ENABLED
33#include <MaterialXCore/Library.h>
34MATERIALX_NAMESPACE_BEGIN
35 using ShaderPtr = std::shared_ptr<class Shader>;
36MATERIALX_NAMESPACE_END
37#endif
38
39PXR_NAMESPACE_OPEN_SCOPE
40
41using HdStComputationSharedPtr = std::shared_ptr<class HdStComputation>;
42using HdStDispatchBufferSharedPtr = std::shared_ptr<class HdStDispatchBuffer>;
43using HdStGLSLProgramSharedPtr = std::shared_ptr<class HdStGLSLProgram>;
44using HioGlslfxSharedPtr = std::shared_ptr<class HioGlslfx>;
45
46using HdSt_BasisCurvesTopologySharedPtr =
47 std::shared_ptr<class HdSt_BasisCurvesTopology>;
48
49using HdStShaderCodePtr =
50 std::weak_ptr<class HdStShaderCode>;
51using HdSt_GeometricShaderSharedPtr =
52 std::shared_ptr<class HdSt_GeometricShader>;
53using HdStRenderPassShaderSharedPtr =
54 std::shared_ptr<class HdStRenderPassShader>;
55
56using HdStTextureHandleSharedPtr =
57 std::shared_ptr<class HdStTextureHandle>;
58using HdStTextureObjectSharedPtr =
59 std::shared_ptr<class HdStTextureObject>;
60using HdStBufferResourceSharedPtr =
61 std::shared_ptr<class HdStBufferResource>;
62using HdStResourceRegistrySharedPtr =
63 std::shared_ptr<class HdStResourceRegistry>;
64using HdSt_VertexAdjacencyBuilderSharedPtr =
65 std::shared_ptr<class HdSt_VertexAdjacencyBuilder>;
66using HdSt_MeshTopologySharedPtr =
67 std::shared_ptr<class HdSt_MeshTopology>;
68using HgiResourceBindingsSharedPtr =
69 std::shared_ptr<HgiResourceBindingsHandle>;
70using HgiGraphicsPipelineSharedPtr =
71 std::shared_ptr<HgiGraphicsPipelineHandle>;
72using HgiComputePipelineSharedPtr =
73 std::shared_ptr<HgiComputePipelineHandle>;
74
78
92enum HdStComputeQueue {
93 HdStComputeQueueZero=0,
94 HdStComputeQueueOne,
95 HdStComputeQueueTwo,
96 HdStComputeQueueThree,
97 HdStComputeQueueCount};
98
99using HdStComputationComputeQueuePairVector =
100 std::vector<std::pair<HdStComputationSharedPtr, HdStComputeQueue>>;
101
102
108{
109public:
110 HF_MALLOC_TAG_NEW("new HdStResourceRegistry");
111
112 HDST_API
113 explicit HdStResourceRegistry(Hgi* hgi);
114
115 HDST_API
116 ~HdStResourceRegistry() override;
117
118 HDST_API
120
121 HDST_API
122 void ReloadResource(TfToken const& resourceType,
123 std::string const& path) override;
124
125 HDST_API
127
128 HDST_API
130
132 HDST_API
134
139
146 HDST_API
147 HdStTextureHandleSharedPtr AllocateTextureHandle(
151 const HdStTextureIdentifier &textureId,
153 HdStTextureType textureType,
156 const HdSamplerParameters &samplerParams,
161 size_t memoryRequest,
166 HdStShaderCodePtr const &shaderCode);
167
173 HDST_API
174 HdStTextureObjectSharedPtr AllocateTextureObject(
178 const HdStTextureIdentifier &textureId,
180 HdStTextureType textureType);
181
188 HDST_API
189 HdStPooledRenderBufferUniquePtr AllocateTempRenderBuffer(
190 const SdfPath& graphPath,
191 HdFormat fmt,
192 GfVec2i dims,
193 bool multiSampled,
194 bool depth);
195
203 HDST_API
205 HdStTextureType textureType,
206 size_t memoryRequest);
207
214
215 HDST_API
216 HdBufferArrayRangeSharedPtr AllocateNonUniformBufferArrayRange(
217 TfToken const &role,
218 HdBufferSpecVector const &bufferSpecs,
219 HdBufferArrayUsageHint usageHint);
220
221 HDST_API
222 HdBufferArrayRangeSharedPtr AllocateNonUniformImmutableBufferArrayRange(
223 TfToken const &role,
224 HdBufferSpecVector const &bufferSpecs,
225 HdBufferArrayUsageHint usageHint);
226
227 HDST_API
228 HdBufferArrayRangeSharedPtr AllocateUniformBufferArrayRange(
229 TfToken const &role,
230 HdBufferSpecVector const &bufferSpecs,
231 HdBufferArrayUsageHint usageHint);
232
233 HDST_API
234 HdBufferArrayRangeSharedPtr AllocateShaderStorageBufferArrayRange(
235 TfToken const &role,
236 HdBufferSpecVector const &bufferSpecs,
237 HdBufferArrayUsageHint usageHint);
238
239 HDST_API
240 HdBufferArrayRangeSharedPtr AllocateSingleBufferArrayRange(
241 TfToken const &role,
242 HdBufferSpecVector const &bufferSpecs,
243 HdBufferArrayUsageHint usageHint);
244
260
261 HDST_API
262 HdBufferArrayRangeSharedPtr UpdateNonUniformBufferArrayRange(
263 TfToken const &role,
264 HdBufferArrayRangeSharedPtr const& curRange,
265 HdBufferSpecVector const &updatedOrAddedSpecs,
266 HdBufferSpecVector const& removedSpecs,
267 HdBufferArrayUsageHint usageHint);
268
269 HDST_API
270 HdBufferArrayRangeSharedPtr UpdateNonUniformImmutableBufferArrayRange(
271 TfToken const &role,
272 HdBufferArrayRangeSharedPtr const& curRange,
273 HdBufferSpecVector const &updatedOrAddedSpecs,
274 HdBufferSpecVector const& removedSpecs,
275 HdBufferArrayUsageHint usageHint);
276
277 HDST_API
278 HdBufferArrayRangeSharedPtr UpdateUniformBufferArrayRange(
279 TfToken const &role,
280 HdBufferArrayRangeSharedPtr const& curRange,
281 HdBufferSpecVector const &updatedOrAddedSpecs,
282 HdBufferSpecVector const& removedSpecs,
283 HdBufferArrayUsageHint usageHint);
284
285 HDST_API
286 HdBufferArrayRangeSharedPtr UpdateShaderStorageBufferArrayRange(
287 TfToken const &role,
288 HdBufferArrayRangeSharedPtr const& curRange,
289 HdBufferSpecVector const &updatedOrAddedSpecs,
290 HdBufferSpecVector const& removedSpecs,
291 HdBufferArrayUsageHint usageHint);
292
296
298 HDST_API
299 void AddSources(HdBufferArrayRangeSharedPtr const &range,
300 HdBufferSourceSharedPtrVector &&sources);
301
303 HDST_API
304 void AddSource(HdBufferArrayRangeSharedPtr const &range,
305 HdBufferSourceSharedPtr const &source);
306
308 HDST_API
309 void AddSource(HdBufferSourceSharedPtr const &source);
310
317 HDST_API
318 void AddComputation(HdBufferArrayRangeSharedPtr const &range,
319 HdStComputationSharedPtr const &computation,
320 HdStComputeQueue const queue);
321
325
328 HDST_API
329 HdStDispatchBufferSharedPtr RegisterDispatchBuffer(
330 TfToken const &role, int count, int commandNumUints);
331
337 HDST_API
338 HdStBufferResourceSharedPtr RegisterBufferResource(
339 TfToken const &role,
340 HdTupleType tupleType,
341 HgiBufferUsage bufferUsage,
342 std::string debugName = "");
343
345 HDST_API
347
349 HDST_API
351
355
366
368 HDST_API
370 RegisterMeshTopology(HdInstance<HdSt_MeshTopologySharedPtr>::ID id);
371
372 HDST_API
374 RegisterBasisCurvesTopology(
375 HdInstance<HdSt_BasisCurvesTopologySharedPtr>::ID id);
376
377 HDST_API
379 RegisterVertexAdjacencyBuilder(
380 HdInstance<HdSt_VertexAdjacencyBuilderSharedPtr>::ID id);
381
386 HDST_API
389 HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
390
391 HDST_API
393 RegisterBasisCurvesIndexRange(
394 HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
395
396 HDST_API
398 RegisterImplicitPrimsIndexRange(
399 HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
400
405 HDST_API
408 HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
409
414 HDST_API
417 HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
418
420 HDST_API
422 RegisterGeometricShader(HdInstance<HdSt_GeometricShaderSharedPtr>::ID id);
423
425 HDST_API
427 RegisterRenderPassShader(HdInstance<HdStRenderPassShaderSharedPtr>::ID id);
428
430 HDST_API
432 RegisterGLSLProgram(HdInstance<HdStGLSLProgramSharedPtr>::ID id);
433
435 HDST_API
437 RegisterGLSLFXFile(HdInstance<HioGlslfxSharedPtr>::ID id);
438
439#ifdef PXR_MATERIALX_SUPPORT_ENABLED
441 HDST_API
443 RegisterMaterialXShader(HdInstance<MaterialX::ShaderPtr>::ID id);
444#endif
445
447 HDST_API
449 RegisterResourceBindings(HdInstance<HgiResourceBindingsSharedPtr>::ID id);
450
452 HDST_API
454 RegisterGraphicsPipeline(HdInstance<HgiGraphicsPipelineSharedPtr>::ID id);
455
457 HDST_API
459 RegisterComputePipeline(HdInstance<HgiComputePipelineSharedPtr>::ID id);
460
471 HDST_API
474 const std::string& identifier,
475 const std::function<std::unique_ptr<HdResourceRegistry>()>& factory);
476
482 HDST_API
484
490 HDST_API
492 HgiComputeDispatch dispatchMethod = HgiComputeDispatchSerial);
493
499 HDST_API
500 void SubmitBlitWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
501
507 HDST_API
508 void SubmitComputeWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
509
511 HDST_API
513
514public:
515 //
516 // Unit test API
517 //
518
523 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
524 _nonUniformAggregationStrategy = std::move(strategy);
525 }
526
531 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
532 _nonUniformImmutableAggregationStrategy = std::move(strategy);
533 }
534
538 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
539 _uniformUboAggregationStrategy = std::move(strategy);
540 }
541
545 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
546 _uniformSsboAggregationStrategy = std::move(strategy);
547 }
548
552 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
553 _singleAggregationStrategy = std::move(strategy);
554 }
555
557 HDST_API
558 friend std::ostream &operator <<(
559 std::ostream &out,
560 const HdStResourceRegistry& self);
561
562protected:
563 void _Commit() override;
564 void _GarbageCollect() override;
565
566private:
567 void _CommitTextures();
568 // Wrapper function for BAR allocation
569 HdBufferArrayRangeSharedPtr _AllocateBufferArrayRange(
570 HdStAggregationStrategy *strategy,
571 HdStBufferArrayRegistry &bufferArrayRegistry,
572 TfToken const &role,
573 HdBufferSpecVector const &bufferSpecs,
574 HdBufferArrayUsageHint usageHint);
575
577 HdBufferArrayRangeSharedPtr _UpdateBufferArrayRange(
578 HdStAggregationStrategy *strategy,
579 HdStBufferArrayRegistry &bufferArrayRegistry,
580 TfToken const &role,
581 HdBufferArrayRangeSharedPtr const& curRange,
582 HdBufferSpecVector const &updatedOrAddedSpecs,
583 HdBufferSpecVector const& removedSpecs,
584 HdBufferArrayUsageHint usageHint);
585
586 // Tally resources by key into the given dictionary. Any additions should
587 // be cumulative with the existing key values.
588 void _TallyResourceAllocation(VtDictionary *result) const;
589
590 // TODO: this is a transient structure. we'll revisit the BufferSource
591 // interface later.
592 struct _PendingSource {
593 _PendingSource(HdBufferArrayRangeSharedPtr const &range)
594 : range(range)
595 , sources()
596 {
597 }
598
599 _PendingSource(HdBufferArrayRangeSharedPtr const &range,
600 HdBufferSourceSharedPtr const &source)
601 : range(range)
602 , sources(1, source)
603 {
604 }
605
606 _PendingSource(HdBufferArrayRangeSharedPtr const &range,
607 HdBufferSourceSharedPtrVector && sources)
608 : range(range)
609 , sources(std::move(sources))
610 {
611 }
612
613 HdBufferArrayRangeSharedPtr range;
614 HdBufferSourceSharedPtrVector sources;
615 };
616
617 Hgi* _hgi;
618
619 using _PendingSourceList =
620 tbb::concurrent_vector<_PendingSource>;
621 // Contains (vector of sources we need to commit, BAR we need to commit them to).
622 _PendingSourceList _pendingSources;
623
624 using _PendingResolveList =
625 tbb::concurrent_vector<std::pair<HdBufferSourceSharedPtr,bool>>;
626 // Contains (unresolved source, whether said source requires staging).
627 _PendingResolveList _pendingSourcesToResolve;
628
629 // Size of the staging buffer we'll need for _pendingSources. Updated as sources
630 // are resolved.
631 std::atomic_size_t _pendingStagingSize;
632
633 struct _PendingComputation{
634 _PendingComputation(HdBufferArrayRangeSharedPtr const &range,
635 HdStComputationSharedPtr const &computation)
636 : range(range), computation(computation) { }
637 HdBufferArrayRangeSharedPtr range;
638 HdStComputationSharedPtr computation;
639 };
640
641 // If we need more 'compute queues' we can increase HdStComputeQueueCount.
642 // We could also consider tbb::concurrent_priority_queue if we want this
643 // to be dynamically scalable.
644 typedef tbb::concurrent_vector<_PendingComputation> _PendingComputationList;
645 _PendingComputationList _pendingComputations[HdStComputeQueueCount];
646
647 // aggregated buffer array
648 HdStBufferArrayRegistry _nonUniformBufferArrayRegistry;
649 HdStBufferArrayRegistry _nonUniformImmutableBufferArrayRegistry;
650 HdStBufferArrayRegistry _uniformUboBufferArrayRegistry;
651 HdStBufferArrayRegistry _uniformSsboBufferArrayRegistry;
652 HdStBufferArrayRegistry _singleBufferArrayRegistry;
653
654 // current aggregation strategies
655 std::unique_ptr<HdStAggregationStrategy> _nonUniformAggregationStrategy;
656 std::unique_ptr<HdStAggregationStrategy>
657 _nonUniformImmutableAggregationStrategy;
658 std::unique_ptr<HdStAggregationStrategy> _uniformUboAggregationStrategy;
659 std::unique_ptr<HdStAggregationStrategy> _uniformSsboAggregationStrategy;
660 std::unique_ptr<HdStAggregationStrategy> _singleAggregationStrategy;
661
662 typedef std::vector<HdStDispatchBufferSharedPtr>
663 _DispatchBufferRegistry;
664 _DispatchBufferRegistry _dispatchBufferRegistry;
665
666 typedef std::vector<HdStBufferResourceSharedPtr>
667 _BufferResourceRegistry;
668 _BufferResourceRegistry _bufferResourceRegistry;
669
670 // Register mesh topology.
672 _meshTopologyRegistry;
673
674 // Register basisCurves topology.
676 _basisCurvesTopologyRegistry;
677
678 // Register vertex adjacency.
680 _vertexAdjacencyBuilderRegistry;
681
682 // Register topology index buffers.
684 _TopologyIndexRangeInstanceRegistry;
685 typedef tbb::concurrent_unordered_map< TfToken,
686 _TopologyIndexRangeInstanceRegistry,
688 _TopologyIndexRangeInstanceRegMap;
689
690 _TopologyIndexRangeInstanceRegMap _meshTopologyIndexRangeRegistry;
691 _TopologyIndexRangeInstanceRegMap _basisCurvesTopologyIndexRangeRegistry;
692
693 // Right now, this map will only have one value since we have only
694 // implemented one repr for implicit spheres, but we expect it to
695 // expand as we add more reprs and implicit surfaces.
696 _TopologyIndexRangeInstanceRegMap _implicitPrimsTopologyIndexRangeRegistry;
697
698 // Register shared primvar buffers.
700 _primvarRangeRegistry;
701
702 // Register ext computation resource.
704 _extComputationDataRangeRegistry;
705
706 // geometric shader registry
708 _geometricShaderRegistry;
709
710 // render pass shader registry
712 _renderPassShaderRegistry;
713
714 // glsl shader program registry
716 _glslProgramRegistry;
717
718 // glslfx file registry
720 _glslfxFileRegistry;
721
722#ifdef PXR_MATERIALX_SUPPORT_ENABLED
723 // MaterialX glslfx shader registry
724 HdInstanceRegistry<MaterialX::ShaderPtr> _materialXShaderRegistry;
725#endif
726
727 // texture handle registry
728 std::unique_ptr<class HdSt_TextureHandleRegistry> _textureHandleRegistry;
729
730 // Hgi resource bindings registry
732 _resourceBindingsRegistry;
733
734 // Hgi graphics pipeline registry
736 _graphicsPipelineRegistry;
737
738 // Hgi compute pipeline registry
740 _computePipelineRegistry;
741
742 using _SubResourceRegistryMap =
743 tbb::concurrent_unordered_map<std::string,
744 std::unique_ptr<HdResourceRegistry>>;
745 _SubResourceRegistryMap _subResourceRegistries;
746
747 HgiBlitCmdsUniquePtr _blitCmds;
748 HgiComputeCmdsUniquePtr _computeCmds;
749
750 std::unique_ptr<HdStStagingBuffer> _stagingBuffer;
751
752 HdStRenderBufferPool _renderBufferPool;
753};
754
755
756PXR_NAMESPACE_CLOSE_SCOPE
757
758#endif //PXR_IMAGING_HD_ST_RESOURCE_REGISTRY_H
Basic type for a vector of 2 int components.
Definition vec2i.h:44
This class is used as an interface to a shared instance in HdInstanceRegistry.
HdInstanceRegistry is a dictionary container of HdInstance.
A central registry for resources.
Collection of standard parameters such as wrap modes to sample a texture.
Definition types.h:110
Aggregation strategy base class.
Manages the pool of buffer arrays.
System for re-using HdStRenderBuffers between tasks in different graphs that regenerate data per-fram...
A central registry of all GPU resources.
HDST_API HdResourceRegistry * FindOrCreateSubResourceRegistry(const std::string &identifier, const std::function< std::unique_ptr< HdResourceRegistry >()> &factory)
Finds a sub resource registry for the given identifier if it already exists or creates one by invokin...
HDST_API void SubmitComputeWork(HgiSubmitWaitType wait=HgiSubmitWaitTypeNoWait)
Submits compute work queued in global compute cmds for GPU execution.
HDST_API void AddSources(HdBufferArrayRangeSharedPtr const &range, HdBufferSourceSharedPtrVector &&sources)
Append source data for given range to be committed later.
HDST_API void AddSource(HdBufferArrayRangeSharedPtr const &range, HdBufferSourceSharedPtr const &source)
Append a source data for given range to be committed later.
HDST_API void AddSource(HdBufferSourceSharedPtr const &source)
Append a source data just to be resolved (used for cpu computations).
void SetShaderStorageAggregationStrategy(std::unique_ptr< HdStAggregationStrategy > &&strategy)
Set the aggregation strategy for SSBO (uniform primvars) Takes ownership of the passed in strategy ob...
HDST_API HdInstance< HdSt_MeshTopologySharedPtr > RegisterMeshTopology(HdInstance< HdSt_MeshTopologySharedPtr >::ID id)
These registries implement sharing and deduplication of data based on computed hash identifiers.
HDST_API HdStTextureObjectSharedPtr AllocateTextureObject(const HdStTextureIdentifier &textureId, HdStTextureType textureType)
Allocate texture object.
void SetNonUniformImmutableAggregationStrategy(std::unique_ptr< HdStAggregationStrategy > &&strategy)
Set the aggregation strategy for non uniform immutable parameters (vertex, varying,...
HDST_API HdInstance< HioGlslfxSharedPtr > RegisterGLSLFXFile(HdInstance< HioGlslfxSharedPtr >::ID id)
Register a GLSLFX file.
void _GarbageCollect() override
Hooks for derived registries to perform additional GC when GarbageCollect() is invoked.
HDST_API HdInstance< HdStGLSLProgramSharedPtr > RegisterGLSLProgram(HdInstance< HdStGLSLProgramSharedPtr >::ID id)
Register a GLSL program into the program registry.
HDST_API HdInstance< HdBufferArrayRangeSharedPtr > RegisterExtComputationDataRange(HdInstance< HdBufferArrayRangeSharedPtr >::ID id)
ExtComputation data array range instancing Returns the HdInstance pointing to shared HdBufferArrayRan...
HDST_API HgiBlitCmds * GetGlobalBlitCmds()
Returns the global hgi blit command queue for recording blitting work.
HDST_API VtDictionary GetDetailedResourceAllocation() const override
May return a more detailed report than GetResourceAllocation, at the expense of runtime.
HDST_API void SetMemoryRequestForTextureType(HdStTextureType textureType, size_t memoryRequest)
Sets how much memory a single texture can consume in bytes by texture type.
HDST_API void AddComputation(HdBufferArrayRangeSharedPtr const &range, HdStComputationSharedPtr const &computation, HdStComputeQueue const queue)
Append a gpu computation into queue.
void SetSingleStorageAggregationStrategy(std::unique_ptr< HdStAggregationStrategy > &&strategy)
Set the aggregation strategy for single buffers (for nested instancer).
HDST_API HdStBufferResourceSharedPtr RegisterBufferResource(TfToken const &role, HdTupleType tupleType, HgiBufferUsage bufferUsage, std::string debugName="")
Register a misc buffer resource.
void SetUniformAggregationStrategy(std::unique_ptr< HdStAggregationStrategy > &&strategy)
Set the aggregation strategy for uniform (shader globals) Takes ownership of the passed in strategy o...
HDST_API HdBufferArrayRangeSharedPtr UpdateNonUniformBufferArrayRange(TfToken const &role, HdBufferArrayRangeSharedPtr const &curRange, HdBufferSpecVector const &updatedOrAddedSpecs, HdBufferSpecVector const &removedSpecs, HdBufferArrayUsageHint usageHint)
HDST_API friend std::ostream & operator<<(std::ostream &out, const HdStResourceRegistry &self)
Debug dump.
HDST_API HdInstance< HgiComputePipelineSharedPtr > RegisterComputePipeline(HdInstance< HgiComputePipelineSharedPtr >::ID id)
Register a Hgi compute pipeline into the registry.
HDST_API void GarbageCollectDispatchBuffers()
Remove any entries associated with expired dispatch buffers.
HDST_API HdStStagingBuffer * GetStagingBuffer()
Returns the staging buffer used when committing data to the GPU.
HDST_API HdInstance< HgiResourceBindingsSharedPtr > RegisterResourceBindings(HdInstance< HgiResourceBindingsSharedPtr >::ID id)
Register a Hgi resource bindings into the registry.
HDST_API void InvalidateShaderRegistry() override
Invalidate any shaders registered with this registry.
HDST_API VtDictionary GetResourceAllocation() const override
Returns a report of resource allocation by role in bytes and a summary total allocation of GPU memory...
HDST_API Hgi * GetHgi()
Returns Hgi used to create/destroy GPU resources.
HDST_API HdStPooledRenderBufferUniquePtr AllocateTempRenderBuffer(const SdfPath &graphPath, HdFormat fmt, GfVec2i dims, bool multiSampled, bool depth)
Allocate a RenderBuffer to be used only for this Render Graph's execution.
void _Commit() override
A hook for derived registries to perform additional resource commits.
HDST_API void SubmitBlitWork(HgiSubmitWaitType wait=HgiSubmitWaitTypeNoWait)
Submits blit work queued in global blit cmds for GPU execution.
HDST_API HdInstance< HdBufferArrayRangeSharedPtr > RegisterPrimvarRange(HdInstance< HdBufferArrayRangeSharedPtr >::ID id)
Primvar array range instancing Returns the HdInstance pointing to shared HdBufferArrayRange,...
HDST_API HdInstance< HdBufferArrayRangeSharedPtr > RegisterMeshIndexRange(HdInstance< HdBufferArrayRangeSharedPtr >::ID id, TfToken const &name)
Topology Index buffer array range instancing Returns the HdInstance points to shared HdBufferArrayRan...
HDST_API HgiComputeCmds * GetGlobalComputeCmds(HgiComputeDispatch dispatchMethod=HgiComputeDispatchSerial)
Returns the global hgi compute cmd queue for recording compute work.
HDST_API HdStTextureHandleSharedPtr AllocateTextureHandle(const HdStTextureIdentifier &textureId, HdStTextureType textureType, const HdSamplerParameters &samplerParams, size_t memoryRequest, HdStShaderCodePtr const &shaderCode)
Allocate texture handle (encapsulates texture and sampler object, memory request and callback to shad...
HDST_API HdInstance< HdSt_GeometricShaderSharedPtr > RegisterGeometricShader(HdInstance< HdSt_GeometricShaderSharedPtr >::ID id)
Register a geometric shader.
HDST_API HdInstance< HdStRenderPassShaderSharedPtr > RegisterRenderPassShader(HdInstance< HdStRenderPassShaderSharedPtr >::ID id)
Register a render pass shader.
HDST_API void GarbageCollectBufferResources()
Remove any entries associated with expired misc buffers.
HDST_API void ReloadResource(TfToken const &resourceType, std::string const &path) override
Generic method to inform RenderDelegate a resource needs to be reloaded.
HDST_API HdBufferArrayRangeSharedPtr AllocateNonUniformBufferArrayRange(TfToken const &role, HdBufferSpecVector const &bufferSpecs, HdBufferArrayUsageHint usageHint)
HDST_API HdInstance< HgiGraphicsPipelineSharedPtr > RegisterGraphicsPipeline(HdInstance< HgiGraphicsPipelineSharedPtr >::ID id)
Register a Hgi graphics pipeline into the registry.
void SetNonUniformAggregationStrategy(std::unique_ptr< HdStAggregationStrategy > &&strategy)
Set the aggregation strategy for non uniform parameters (vertex, varying, facevarying) Takes ownershi...
HDST_API HdStDispatchBufferSharedPtr RegisterDispatchBuffer(TfToken const &role, int count, int commandNumUints)
Register a buffer allocated with count * commandNumUints * sizeof(uint32_t) to be used as an indirect...
Provides a staging buffer for CPU writes of triple-buffered resources.
Class to identify a texture file or a texture within the texture file (e.g., a frame in a movie).
A graphics API independent abstraction of resource copy commands.
Definition blitCmds.h:38
A graphics API independent abstraction of compute commands.
Definition computeCmds.h:29
Hydra Graphics Interface.
Definition hgi.h:95
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
Token for efficient comparison, assignment, and hashing of known strings.
Definition token.h:81
A map with string keys and VtValue values.
Definition dictionary.h:52
STL namespace.
HdTupleType represents zero, one, or more values of the same HdType.
Definition types.h:343
Functor to use for hash maps from tokens to other things.
Definition token.h:176