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
397 HDST_API
400 HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
401
406 HDST_API
409 HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
410
412 HDST_API
414 RegisterGeometricShader(HdInstance<HdSt_GeometricShaderSharedPtr>::ID id);
415
417 HDST_API
419 RegisterRenderPassShader(HdInstance<HdStRenderPassShaderSharedPtr>::ID id);
420
422 HDST_API
424 RegisterGLSLProgram(HdInstance<HdStGLSLProgramSharedPtr>::ID id);
425
427 HDST_API
429 RegisterGLSLFXFile(HdInstance<HioGlslfxSharedPtr>::ID id);
430
431#ifdef PXR_MATERIALX_SUPPORT_ENABLED
433 HDST_API
435 RegisterMaterialXShader(HdInstance<MaterialX::ShaderPtr>::ID id);
436#endif
437
439 HDST_API
441 RegisterResourceBindings(HdInstance<HgiResourceBindingsSharedPtr>::ID id);
442
444 HDST_API
446 RegisterGraphicsPipeline(HdInstance<HgiGraphicsPipelineSharedPtr>::ID id);
447
449 HDST_API
451 RegisterComputePipeline(HdInstance<HgiComputePipelineSharedPtr>::ID id);
452
463 HDST_API
466 const std::string& identifier,
467 const std::function<std::unique_ptr<HdResourceRegistry>()>& factory);
468
474 HDST_API
476
482 HDST_API
484 HgiComputeDispatch dispatchMethod = HgiComputeDispatchSerial);
485
491 HDST_API
492 void SubmitBlitWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
493
499 HDST_API
500 void SubmitComputeWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
501
503 HDST_API
505
506public:
507 //
508 // Unit test API
509 //
510
515 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
516 _nonUniformAggregationStrategy = std::move(strategy);
517 }
518
523 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
524 _nonUniformImmutableAggregationStrategy = std::move(strategy);
525 }
526
530 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
531 _uniformUboAggregationStrategy = std::move(strategy);
532 }
533
537 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
538 _uniformSsboAggregationStrategy = std::move(strategy);
539 }
540
544 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
545 _singleAggregationStrategy = std::move(strategy);
546 }
547
549 HDST_API
550 friend std::ostream &operator <<(
551 std::ostream &out,
552 const HdStResourceRegistry& self);
553
554protected:
555 void _Commit() override;
556 void _GarbageCollect() override;
557
558private:
559 void _CommitTextures();
560 // Wrapper function for BAR allocation
561 HdBufferArrayRangeSharedPtr _AllocateBufferArrayRange(
562 HdStAggregationStrategy *strategy,
563 HdStBufferArrayRegistry &bufferArrayRegistry,
564 TfToken const &role,
565 HdBufferSpecVector const &bufferSpecs,
566 HdBufferArrayUsageHint usageHint);
567
569 HdBufferArrayRangeSharedPtr _UpdateBufferArrayRange(
570 HdStAggregationStrategy *strategy,
571 HdStBufferArrayRegistry &bufferArrayRegistry,
572 TfToken const &role,
573 HdBufferArrayRangeSharedPtr const& curRange,
574 HdBufferSpecVector const &updatedOrAddedSpecs,
575 HdBufferSpecVector const& removedSpecs,
576 HdBufferArrayUsageHint usageHint);
577
578 // Tally resources by key into the given dictionary. Any additions should
579 // be cumulative with the existing key values.
580 void _TallyResourceAllocation(VtDictionary *result) const;
581
582 // TODO: this is a transient structure. we'll revisit the BufferSource
583 // interface later.
584 struct _PendingSource {
585 _PendingSource(HdBufferArrayRangeSharedPtr const &range)
586 : range(range)
587 , sources()
588 {
589 }
590
591 _PendingSource(HdBufferArrayRangeSharedPtr const &range,
592 HdBufferSourceSharedPtr const &source)
593 : range(range)
594 , sources(1, source)
595 {
596 }
597
598 _PendingSource(HdBufferArrayRangeSharedPtr const &range,
599 HdBufferSourceSharedPtrVector && sources)
600 : range(range)
601 , sources(std::move(sources))
602 {
603 }
604
605 HdBufferArrayRangeSharedPtr range;
606 HdBufferSourceSharedPtrVector sources;
607 };
608
609 Hgi* _hgi;
610
611 typedef tbb::concurrent_vector<_PendingSource> _PendingSourceList;
612 _PendingSourceList _pendingSources;
613 std::atomic_size_t _numBufferSourcesToResolve;
614
615 struct _PendingComputation{
616 _PendingComputation(HdBufferArrayRangeSharedPtr const &range,
617 HdStComputationSharedPtr const &computation)
618 : range(range), computation(computation) { }
619 HdBufferArrayRangeSharedPtr range;
620 HdStComputationSharedPtr computation;
621 };
622
623 // If we need more 'compute queues' we can increase HdStComputeQueueCount.
624 // We could also consider tbb::concurrent_priority_queue if we want this
625 // to be dynamically scalable.
626 typedef tbb::concurrent_vector<_PendingComputation> _PendingComputationList;
627 _PendingComputationList _pendingComputations[HdStComputeQueueCount];
628
629 // aggregated buffer array
630 HdStBufferArrayRegistry _nonUniformBufferArrayRegistry;
631 HdStBufferArrayRegistry _nonUniformImmutableBufferArrayRegistry;
632 HdStBufferArrayRegistry _uniformUboBufferArrayRegistry;
633 HdStBufferArrayRegistry _uniformSsboBufferArrayRegistry;
634 HdStBufferArrayRegistry _singleBufferArrayRegistry;
635
636 // current aggregation strategies
637 std::unique_ptr<HdStAggregationStrategy> _nonUniformAggregationStrategy;
638 std::unique_ptr<HdStAggregationStrategy>
639 _nonUniformImmutableAggregationStrategy;
640 std::unique_ptr<HdStAggregationStrategy> _uniformUboAggregationStrategy;
641 std::unique_ptr<HdStAggregationStrategy> _uniformSsboAggregationStrategy;
642 std::unique_ptr<HdStAggregationStrategy> _singleAggregationStrategy;
643
644 typedef std::vector<HdStDispatchBufferSharedPtr>
645 _DispatchBufferRegistry;
646 _DispatchBufferRegistry _dispatchBufferRegistry;
647
648 typedef std::vector<HdStBufferResourceSharedPtr>
649 _BufferResourceRegistry;
650 _BufferResourceRegistry _bufferResourceRegistry;
651
652 // Register mesh topology.
654 _meshTopologyRegistry;
655
656 // Register basisCurves topology.
658 _basisCurvesTopologyRegistry;
659
660 // Register vertex adjacency.
662 _vertexAdjacencyBuilderRegistry;
663
664 // Register topology index buffers.
666 _TopologyIndexRangeInstanceRegistry;
667 typedef tbb::concurrent_unordered_map< TfToken,
668 _TopologyIndexRangeInstanceRegistry,
670 _TopologyIndexRangeInstanceRegMap;
671
672 _TopologyIndexRangeInstanceRegMap _meshTopologyIndexRangeRegistry;
673 _TopologyIndexRangeInstanceRegMap _basisCurvesTopologyIndexRangeRegistry;
674
675 // Register shared primvar buffers.
677 _primvarRangeRegistry;
678
679 // Register ext computation resource.
681 _extComputationDataRangeRegistry;
682
683 // geometric shader registry
685 _geometricShaderRegistry;
686
687 // render pass shader registry
689 _renderPassShaderRegistry;
690
691 // glsl shader program registry
693 _glslProgramRegistry;
694
695 // glslfx file registry
697 _glslfxFileRegistry;
698
699#ifdef PXR_MATERIALX_SUPPORT_ENABLED
700 // MaterialX glslfx shader registry
701 HdInstanceRegistry<MaterialX::ShaderPtr> _materialXShaderRegistry;
702#endif
703
704 // texture handle registry
705 std::unique_ptr<class HdSt_TextureHandleRegistry> _textureHandleRegistry;
706
707 // Hgi resource bindings registry
709 _resourceBindingsRegistry;
710
711 // Hgi graphics pipeline registry
713 _graphicsPipelineRegistry;
714
715 // Hgi compute pipeline registry
717 _computePipelineRegistry;
718
719 using _SubResourceRegistryMap =
720 tbb::concurrent_unordered_map<std::string,
721 std::unique_ptr<HdResourceRegistry>>;
722 _SubResourceRegistryMap _subResourceRegistries;
723
724 HgiBlitCmdsUniquePtr _blitCmds;
725 HgiComputeCmdsUniquePtr _computeCmds;
726
727 std::unique_ptr<HdStStagingBuffer> _stagingBuffer;
728
729 HdStRenderBufferPool _renderBufferPool;
730};
731
732
733PXR_NAMESPACE_CLOSE_SCOPE
734
735#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.
Definition: strategyBase.h:31
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.
Definition: stagingBuffer.h:33
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:274
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:43
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