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
129 HDST_API
131
136
143 HDST_API
144 HdStTextureHandleSharedPtr AllocateTextureHandle(
148 const HdStTextureIdentifier &textureId,
150 HdStTextureType textureType,
153 const HdSamplerParameters &samplerParams,
158 size_t memoryRequest,
163 HdStShaderCodePtr const &shaderCode);
164
170 HDST_API
171 HdStTextureObjectSharedPtr AllocateTextureObject(
175 const HdStTextureIdentifier &textureId,
177 HdStTextureType textureType);
178
185 HDST_API
186 HdStPooledRenderBufferUniquePtr AllocateTempRenderBuffer(
187 const SdfPath& graphPath,
188 HdFormat fmt,
189 GfVec2i dims,
190 bool multiSampled,
191 bool depth);
192
200 HDST_API
202 HdStTextureType textureType,
203 size_t memoryRequest);
204
211
212 HDST_API
213 HdBufferArrayRangeSharedPtr AllocateNonUniformBufferArrayRange(
214 TfToken const &role,
215 HdBufferSpecVector const &bufferSpecs,
216 HdBufferArrayUsageHint usageHint);
217
218 HDST_API
219 HdBufferArrayRangeSharedPtr AllocateNonUniformImmutableBufferArrayRange(
220 TfToken const &role,
221 HdBufferSpecVector const &bufferSpecs,
222 HdBufferArrayUsageHint usageHint);
223
224 HDST_API
225 HdBufferArrayRangeSharedPtr AllocateUniformBufferArrayRange(
226 TfToken const &role,
227 HdBufferSpecVector const &bufferSpecs,
228 HdBufferArrayUsageHint usageHint);
229
230 HDST_API
231 HdBufferArrayRangeSharedPtr AllocateShaderStorageBufferArrayRange(
232 TfToken const &role,
233 HdBufferSpecVector const &bufferSpecs,
234 HdBufferArrayUsageHint usageHint);
235
236 HDST_API
237 HdBufferArrayRangeSharedPtr AllocateSingleBufferArrayRange(
238 TfToken const &role,
239 HdBufferSpecVector const &bufferSpecs,
240 HdBufferArrayUsageHint usageHint);
241
257
258 HDST_API
259 HdBufferArrayRangeSharedPtr UpdateNonUniformBufferArrayRange(
260 TfToken const &role,
261 HdBufferArrayRangeSharedPtr const& curRange,
262 HdBufferSpecVector const &updatedOrAddedSpecs,
263 HdBufferSpecVector const& removedSpecs,
264 HdBufferArrayUsageHint usageHint);
265
266 HDST_API
267 HdBufferArrayRangeSharedPtr UpdateNonUniformImmutableBufferArrayRange(
268 TfToken const &role,
269 HdBufferArrayRangeSharedPtr const& curRange,
270 HdBufferSpecVector const &updatedOrAddedSpecs,
271 HdBufferSpecVector const& removedSpecs,
272 HdBufferArrayUsageHint usageHint);
273
274 HDST_API
275 HdBufferArrayRangeSharedPtr UpdateUniformBufferArrayRange(
276 TfToken const &role,
277 HdBufferArrayRangeSharedPtr const& curRange,
278 HdBufferSpecVector const &updatedOrAddedSpecs,
279 HdBufferSpecVector const& removedSpecs,
280 HdBufferArrayUsageHint usageHint);
281
282 HDST_API
283 HdBufferArrayRangeSharedPtr UpdateShaderStorageBufferArrayRange(
284 TfToken const &role,
285 HdBufferArrayRangeSharedPtr const& curRange,
286 HdBufferSpecVector const &updatedOrAddedSpecs,
287 HdBufferSpecVector const& removedSpecs,
288 HdBufferArrayUsageHint usageHint);
289
293
295 HDST_API
296 void AddSources(HdBufferArrayRangeSharedPtr const &range,
297 HdBufferSourceSharedPtrVector &&sources);
298
300 HDST_API
301 void AddSource(HdBufferArrayRangeSharedPtr const &range,
302 HdBufferSourceSharedPtr const &source);
303
305 HDST_API
306 void AddSource(HdBufferSourceSharedPtr const &source);
307
314 HDST_API
315 void AddComputation(HdBufferArrayRangeSharedPtr const &range,
316 HdStComputationSharedPtr const &computation,
317 HdStComputeQueue const queue);
318
322
325 HDST_API
326 HdStDispatchBufferSharedPtr RegisterDispatchBuffer(
327 TfToken const &role, int count, int commandNumUints);
328
334 HDST_API
335 HdStBufferResourceSharedPtr RegisterBufferResource(
336 TfToken const &role,
337 HdTupleType tupleType,
338 HgiBufferUsage bufferUsage,
339 std::string debugName = "");
340
342 HDST_API
344
346 HDST_API
348
352
363
365 HDST_API
367 RegisterMeshTopology(HdInstance<HdSt_MeshTopologySharedPtr>::ID id);
368
369 HDST_API
371 RegisterBasisCurvesTopology(
372 HdInstance<HdSt_BasisCurvesTopologySharedPtr>::ID id);
373
374 HDST_API
376 RegisterVertexAdjacencyBuilder(
377 HdInstance<HdSt_VertexAdjacencyBuilderSharedPtr>::ID id);
378
383 HDST_API
386 HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
387
388 HDST_API
390 RegisterBasisCurvesIndexRange(
391 HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
392
393 HDST_API
395 RegisterImplicitPrimsIndexRange(
396 HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
397
402 HDST_API
405 HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
406
411 HDST_API
414 HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
415
417 HDST_API
419 RegisterGeometricShader(HdInstance<HdSt_GeometricShaderSharedPtr>::ID id);
420
422 HDST_API
424 RegisterRenderPassShader(HdInstance<HdStRenderPassShaderSharedPtr>::ID id);
425
427 HDST_API
429 RegisterGLSLProgram(HdInstance<HdStGLSLProgramSharedPtr>::ID id);
430
432 HDST_API
434 RegisterGLSLFXFile(HdInstance<HioGlslfxSharedPtr>::ID id);
435
436#ifdef PXR_MATERIALX_SUPPORT_ENABLED
438 HDST_API
440 RegisterMaterialXShader(HdInstance<MaterialX::ShaderPtr>::ID id);
441#endif
442
444 HDST_API
446 RegisterResourceBindings(HdInstance<HgiResourceBindingsSharedPtr>::ID id);
447
449 HDST_API
451 RegisterGraphicsPipeline(HdInstance<HgiGraphicsPipelineSharedPtr>::ID id);
452
454 HDST_API
456 RegisterComputePipeline(HdInstance<HgiComputePipelineSharedPtr>::ID id);
457
468 HDST_API
471 const std::string& identifier,
472 const std::function<std::unique_ptr<HdResourceRegistry>()>& factory);
473
479 HDST_API
481
487 HDST_API
489 HgiComputeDispatch dispatchMethod = HgiComputeDispatchSerial);
490
496 HDST_API
497 void SubmitBlitWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
498
504 HDST_API
505 void SubmitComputeWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
506
508 HDST_API
510
511public:
512 //
513 // Unit test API
514 //
515
520 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
521 _nonUniformAggregationStrategy = std::move(strategy);
522 }
523
528 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
529 _nonUniformImmutableAggregationStrategy = std::move(strategy);
530 }
531
535 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
536 _uniformUboAggregationStrategy = std::move(strategy);
537 }
538
542 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
543 _uniformSsboAggregationStrategy = std::move(strategy);
544 }
545
549 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
550 _singleAggregationStrategy = std::move(strategy);
551 }
552
554 HDST_API
555 friend std::ostream &operator <<(
556 std::ostream &out,
557 const HdStResourceRegistry& self);
558
559protected:
560 void _Commit() override;
561 void _GarbageCollect() override;
562
563private:
564 void _CommitTextures();
565 // Wrapper function for BAR allocation
566 HdBufferArrayRangeSharedPtr _AllocateBufferArrayRange(
567 HdStAggregationStrategy *strategy,
568 HdStBufferArrayRegistry &bufferArrayRegistry,
569 TfToken const &role,
570 HdBufferSpecVector const &bufferSpecs,
571 HdBufferArrayUsageHint usageHint);
572
574 HdBufferArrayRangeSharedPtr _UpdateBufferArrayRange(
575 HdStAggregationStrategy *strategy,
576 HdStBufferArrayRegistry &bufferArrayRegistry,
577 TfToken const &role,
578 HdBufferArrayRangeSharedPtr const& curRange,
579 HdBufferSpecVector const &updatedOrAddedSpecs,
580 HdBufferSpecVector const& removedSpecs,
581 HdBufferArrayUsageHint usageHint);
582
583 // Tally resources by key into the given dictionary. Any additions should
584 // be cumulative with the existing key values.
585 void _TallyResourceAllocation(VtDictionary *result) const;
586
587 // TODO: this is a transient structure. we'll revisit the BufferSource
588 // interface later.
589 struct _PendingSource {
590 _PendingSource(HdBufferArrayRangeSharedPtr const &range)
591 : range(range)
592 , sources()
593 {
594 }
595
596 _PendingSource(HdBufferArrayRangeSharedPtr const &range,
597 HdBufferSourceSharedPtr const &source)
598 : range(range)
599 , sources(1, source)
600 {
601 }
602
603 _PendingSource(HdBufferArrayRangeSharedPtr const &range,
604 HdBufferSourceSharedPtrVector && sources)
605 : range(range)
606 , sources(std::move(sources))
607 {
608 }
609
610 HdBufferArrayRangeSharedPtr range;
611 HdBufferSourceSharedPtrVector sources;
612 };
613
614 Hgi* _hgi;
615
616 using _PendingSourceList =
617 tbb::concurrent_vector<_PendingSource>;
618 // Contains (vector of sources we need to commit, BAR we need to commit them to).
619 _PendingSourceList _pendingSources;
620
621 using _PendingResolveList =
622 tbb::concurrent_vector<std::pair<HdBufferSourceSharedPtr,bool>>;
623 // Contains (unresolved source, whether said source requires staging).
624 _PendingResolveList _pendingSourcesToResolve;
625
626 // Size of the staging buffer we'll need for _pendingSources. Updated as sources
627 // are resolved.
628 std::atomic_size_t _pendingStagingSize;
629
630 struct _PendingComputation{
631 _PendingComputation(HdBufferArrayRangeSharedPtr const &range,
632 HdStComputationSharedPtr const &computation)
633 : range(range), computation(computation) { }
634 HdBufferArrayRangeSharedPtr range;
635 HdStComputationSharedPtr computation;
636 };
637
638 // If we need more 'compute queues' we can increase HdStComputeQueueCount.
639 // We could also consider tbb::concurrent_priority_queue if we want this
640 // to be dynamically scalable.
641 typedef tbb::concurrent_vector<_PendingComputation> _PendingComputationList;
642 _PendingComputationList _pendingComputations[HdStComputeQueueCount];
643
644 // aggregated buffer array
645 HdStBufferArrayRegistry _nonUniformBufferArrayRegistry;
646 HdStBufferArrayRegistry _nonUniformImmutableBufferArrayRegistry;
647 HdStBufferArrayRegistry _uniformUboBufferArrayRegistry;
648 HdStBufferArrayRegistry _uniformSsboBufferArrayRegistry;
649 HdStBufferArrayRegistry _singleBufferArrayRegistry;
650
651 // current aggregation strategies
652 std::unique_ptr<HdStAggregationStrategy> _nonUniformAggregationStrategy;
653 std::unique_ptr<HdStAggregationStrategy>
654 _nonUniformImmutableAggregationStrategy;
655 std::unique_ptr<HdStAggregationStrategy> _uniformUboAggregationStrategy;
656 std::unique_ptr<HdStAggregationStrategy> _uniformSsboAggregationStrategy;
657 std::unique_ptr<HdStAggregationStrategy> _singleAggregationStrategy;
658
659 typedef std::vector<HdStDispatchBufferSharedPtr>
660 _DispatchBufferRegistry;
661 _DispatchBufferRegistry _dispatchBufferRegistry;
662
663 typedef std::vector<HdStBufferResourceSharedPtr>
664 _BufferResourceRegistry;
665 _BufferResourceRegistry _bufferResourceRegistry;
666
667 // Register mesh topology.
669 _meshTopologyRegistry;
670
671 // Register basisCurves topology.
673 _basisCurvesTopologyRegistry;
674
675 // Register vertex adjacency.
677 _vertexAdjacencyBuilderRegistry;
678
679 // Register topology index buffers.
681 _TopologyIndexRangeInstanceRegistry;
682 typedef tbb::concurrent_unordered_map< TfToken,
683 _TopologyIndexRangeInstanceRegistry,
685 _TopologyIndexRangeInstanceRegMap;
686
687 _TopologyIndexRangeInstanceRegMap _meshTopologyIndexRangeRegistry;
688 _TopologyIndexRangeInstanceRegMap _basisCurvesTopologyIndexRangeRegistry;
689
690 // Right now, this map will only have one value since we have only
691 // implemented one repr for implicit spheres, but we expect it to
692 // expand as we add more reprs and implicit surfaces.
693 _TopologyIndexRangeInstanceRegMap _implicitPrimsTopologyIndexRangeRegistry;
694
695 // Register shared primvar buffers.
697 _primvarRangeRegistry;
698
699 // Register ext computation resource.
701 _extComputationDataRangeRegistry;
702
703 // geometric shader registry
705 _geometricShaderRegistry;
706
707 // render pass shader registry
709 _renderPassShaderRegistry;
710
711 // glsl shader program registry
713 _glslProgramRegistry;
714
715 // glslfx file registry
717 _glslfxFileRegistry;
718
719#ifdef PXR_MATERIALX_SUPPORT_ENABLED
720 // MaterialX glslfx shader registry
721 HdInstanceRegistry<MaterialX::ShaderPtr> _materialXShaderRegistry;
722#endif
723
724 // texture handle registry
725 std::unique_ptr<class HdSt_TextureHandleRegistry> _textureHandleRegistry;
726
727 // Hgi resource bindings registry
729 _resourceBindingsRegistry;
730
731 // Hgi graphics pipeline registry
733 _graphicsPipelineRegistry;
734
735 // Hgi compute pipeline registry
737 _computePipelineRegistry;
738
739 using _SubResourceRegistryMap =
740 tbb::concurrent_unordered_map<std::string,
741 std::unique_ptr<HdResourceRegistry>>;
742 _SubResourceRegistryMap _subResourceRegistries;
743
744 HgiBlitCmdsUniquePtr _blitCmds;
745 HgiComputeCmdsUniquePtr _computeCmds;
746
747 std::unique_ptr<HdStStagingBuffer> _stagingBuffer;
748
749 HdStRenderBufferPool _renderBufferPool;
750};
751
752
753PXR_NAMESPACE_CLOSE_SCOPE
754
755#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 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:71
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:149