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
17#include "pxr/imaging/hgi/hgi.h"
18
19#include "pxr/imaging/hd/bufferArrayRange.h"
20#include "pxr/imaging/hd/bufferSource.h"
21#include "pxr/imaging/hd/bufferSpec.h"
22#include "pxr/imaging/hd/instanceRegistry.h"
23#include "pxr/imaging/hd/resourceRegistry.h"
24
25#include <tbb/concurrent_vector.h>
26
27#include <atomic>
28#include <map>
29#include <memory>
30
31#ifdef PXR_MATERIALX_SUPPORT_ENABLED
32#include <MaterialXCore/Library.h>
33MATERIALX_NAMESPACE_BEGIN
34 using ShaderPtr = std::shared_ptr<class Shader>;
35MATERIALX_NAMESPACE_END
36#endif
37
38PXR_NAMESPACE_OPEN_SCOPE
39
40using HdStComputationSharedPtr = std::shared_ptr<class HdStComputation>;
41using HdStDispatchBufferSharedPtr = std::shared_ptr<class HdStDispatchBuffer>;
42using HdStGLSLProgramSharedPtr = std::shared_ptr<class HdStGLSLProgram>;
43using HioGlslfxSharedPtr = std::shared_ptr<class HioGlslfx>;
44
45using HdSt_BasisCurvesTopologySharedPtr =
46 std::shared_ptr<class HdSt_BasisCurvesTopology>;
47
48using HdStShaderCodePtr =
49 std::weak_ptr<class HdStShaderCode>;
50using HdSt_GeometricShaderSharedPtr =
51 std::shared_ptr<class HdSt_GeometricShader>;
52using HdStRenderPassShaderSharedPtr =
53 std::shared_ptr<class HdStRenderPassShader>;
54
55using HdStTextureHandleSharedPtr =
56 std::shared_ptr<class HdStTextureHandle>;
57using HdStTextureObjectSharedPtr =
58 std::shared_ptr<class HdStTextureObject>;
59using HdStBufferResourceSharedPtr =
60 std::shared_ptr<class HdStBufferResource>;
61using HdStResourceRegistrySharedPtr =
62 std::shared_ptr<class HdStResourceRegistry>;
63using HdSt_VertexAdjacencyBuilderSharedPtr =
64 std::shared_ptr<class HdSt_VertexAdjacencyBuilder>;
65using HdSt_MeshTopologySharedPtr =
66 std::shared_ptr<class HdSt_MeshTopology>;
67using HgiResourceBindingsSharedPtr =
68 std::shared_ptr<HgiResourceBindingsHandle>;
69using HgiGraphicsPipelineSharedPtr =
70 std::shared_ptr<HgiGraphicsPipelineHandle>;
71using HgiComputePipelineSharedPtr =
72 std::shared_ptr<HgiComputePipelineHandle>;
73
77
91enum HdStComputeQueue {
92 HdStComputeQueueZero=0,
93 HdStComputeQueueOne,
94 HdStComputeQueueTwo,
95 HdStComputeQueueThree,
96 HdStComputeQueueCount};
97
98using HdStComputationComputeQueuePairVector =
99 std::vector<std::pair<HdStComputationSharedPtr, HdStComputeQueue>>;
100
101
107{
108public:
109 HF_MALLOC_TAG_NEW("new HdStResourceRegistry");
110
111 HDST_API
112 explicit HdStResourceRegistry(Hgi* hgi);
113
114 HDST_API
115 ~HdStResourceRegistry() override;
116
117 HDST_API
119
120 HDST_API
121 void ReloadResource(TfToken const& resourceType,
122 std::string const& path) override;
123
124 HDST_API
126
128 HDST_API
130
135
142 HDST_API
143 HdStTextureHandleSharedPtr AllocateTextureHandle(
147 const HdStTextureIdentifier &textureId,
149 HdStTextureType textureType,
152 const HdSamplerParameters &samplerParams,
157 size_t memoryRequest,
162 HdStShaderCodePtr const &shaderCode);
163
169 HDST_API
170 HdStTextureObjectSharedPtr AllocateTextureObject(
174 const HdStTextureIdentifier &textureId,
176 HdStTextureType textureType);
177
185 HDST_API
187 HdStTextureType textureType,
188 size_t memoryRequest);
189
196
197 HDST_API
198 HdBufferArrayRangeSharedPtr AllocateNonUniformBufferArrayRange(
199 TfToken const &role,
200 HdBufferSpecVector const &bufferSpecs,
201 HdBufferArrayUsageHint usageHint);
202
203 HDST_API
204 HdBufferArrayRangeSharedPtr AllocateNonUniformImmutableBufferArrayRange(
205 TfToken const &role,
206 HdBufferSpecVector const &bufferSpecs,
207 HdBufferArrayUsageHint usageHint);
208
209 HDST_API
210 HdBufferArrayRangeSharedPtr AllocateUniformBufferArrayRange(
211 TfToken const &role,
212 HdBufferSpecVector const &bufferSpecs,
213 HdBufferArrayUsageHint usageHint);
214
215 HDST_API
216 HdBufferArrayRangeSharedPtr AllocateShaderStorageBufferArrayRange(
217 TfToken const &role,
218 HdBufferSpecVector const &bufferSpecs,
219 HdBufferArrayUsageHint usageHint);
220
221 HDST_API
222 HdBufferArrayRangeSharedPtr AllocateSingleBufferArrayRange(
223 TfToken const &role,
224 HdBufferSpecVector const &bufferSpecs,
225 HdBufferArrayUsageHint usageHint);
226
242
243 HDST_API
244 HdBufferArrayRangeSharedPtr UpdateNonUniformBufferArrayRange(
245 TfToken const &role,
246 HdBufferArrayRangeSharedPtr const& curRange,
247 HdBufferSpecVector const &updatedOrAddedSpecs,
248 HdBufferSpecVector const& removedSpecs,
249 HdBufferArrayUsageHint usageHint);
250
251 HDST_API
252 HdBufferArrayRangeSharedPtr UpdateNonUniformImmutableBufferArrayRange(
253 TfToken const &role,
254 HdBufferArrayRangeSharedPtr const& curRange,
255 HdBufferSpecVector const &updatedOrAddedSpecs,
256 HdBufferSpecVector const& removedSpecs,
257 HdBufferArrayUsageHint usageHint);
258
259 HDST_API
260 HdBufferArrayRangeSharedPtr UpdateUniformBufferArrayRange(
261 TfToken const &role,
262 HdBufferArrayRangeSharedPtr const& curRange,
263 HdBufferSpecVector const &updatedOrAddedSpecs,
264 HdBufferSpecVector const& removedSpecs,
265 HdBufferArrayUsageHint usageHint);
266
267 HDST_API
268 HdBufferArrayRangeSharedPtr UpdateShaderStorageBufferArrayRange(
269 TfToken const &role,
270 HdBufferArrayRangeSharedPtr const& curRange,
271 HdBufferSpecVector const &updatedOrAddedSpecs,
272 HdBufferSpecVector const& removedSpecs,
273 HdBufferArrayUsageHint usageHint);
274
278
280 HDST_API
281 void AddSources(HdBufferArrayRangeSharedPtr const &range,
282 HdBufferSourceSharedPtrVector &&sources);
283
285 HDST_API
286 void AddSource(HdBufferArrayRangeSharedPtr const &range,
287 HdBufferSourceSharedPtr const &source);
288
290 HDST_API
291 void AddSource(HdBufferSourceSharedPtr const &source);
292
299 HDST_API
300 void AddComputation(HdBufferArrayRangeSharedPtr const &range,
301 HdStComputationSharedPtr const &computation,
302 HdStComputeQueue const queue);
303
307
310 HDST_API
311 HdStDispatchBufferSharedPtr RegisterDispatchBuffer(
312 TfToken const &role, int count, int commandNumUints);
313
319 HDST_API
320 HdStBufferResourceSharedPtr RegisterBufferResource(
321 TfToken const &role,
322 HdTupleType tupleType,
323 HgiBufferUsage bufferUsage,
324 std::string debugName = "");
325
327 HDST_API
329
331 HDST_API
333
337
348
350 HDST_API
352 RegisterMeshTopology(HdInstance<HdSt_MeshTopologySharedPtr>::ID id);
353
354 HDST_API
356 RegisterBasisCurvesTopology(
357 HdInstance<HdSt_BasisCurvesTopologySharedPtr>::ID id);
358
359 HDST_API
361 RegisterVertexAdjacencyBuilder(
362 HdInstance<HdSt_VertexAdjacencyBuilderSharedPtr>::ID id);
363
368 HDST_API
371 HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
372
373 HDST_API
375 RegisterBasisCurvesIndexRange(
376 HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
377
382 HDST_API
385 HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
386
391 HDST_API
394 HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
395
397 HDST_API
399 RegisterGeometricShader(HdInstance<HdSt_GeometricShaderSharedPtr>::ID id);
400
402 HDST_API
404 RegisterRenderPassShader(HdInstance<HdStRenderPassShaderSharedPtr>::ID id);
405
407 HDST_API
409 RegisterGLSLProgram(HdInstance<HdStGLSLProgramSharedPtr>::ID id);
410
412 HDST_API
414 RegisterGLSLFXFile(HdInstance<HioGlslfxSharedPtr>::ID id);
415
416#ifdef PXR_MATERIALX_SUPPORT_ENABLED
418 HDST_API
420 RegisterMaterialXShader(HdInstance<MaterialX::ShaderPtr>::ID id);
421#endif
422
424 HDST_API
426 RegisterResourceBindings(HdInstance<HgiResourceBindingsSharedPtr>::ID id);
427
429 HDST_API
431 RegisterGraphicsPipeline(HdInstance<HgiGraphicsPipelineSharedPtr>::ID id);
432
434 HDST_API
436 RegisterComputePipeline(HdInstance<HgiComputePipelineSharedPtr>::ID id);
437
448 HDST_API
451 const std::string& identifier,
452 const std::function<std::unique_ptr<HdResourceRegistry>()>& factory);
453
459 HDST_API
461
467 HDST_API
469 HgiComputeDispatch dispatchMethod = HgiComputeDispatchSerial);
470
476 HDST_API
477 void SubmitBlitWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
478
484 HDST_API
485 void SubmitComputeWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
486
488 HDST_API
490
491public:
492 //
493 // Unit test API
494 //
495
500 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
501 _nonUniformAggregationStrategy = std::move(strategy);
502 }
503
508 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
509 _nonUniformImmutableAggregationStrategy = std::move(strategy);
510 }
511
515 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
516 _uniformUboAggregationStrategy = std::move(strategy);
517 }
518
522 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
523 _uniformSsboAggregationStrategy = std::move(strategy);
524 }
525
529 std::unique_ptr<HdStAggregationStrategy> &&strategy) {
530 _singleAggregationStrategy = std::move(strategy);
531 }
532
534 HDST_API
535 friend std::ostream &operator <<(
536 std::ostream &out,
537 const HdStResourceRegistry& self);
538
539protected:
540 void _Commit() override;
541 void _GarbageCollect() override;
542
543private:
544 void _CommitTextures();
545 // Wrapper function for BAR allocation
546 HdBufferArrayRangeSharedPtr _AllocateBufferArrayRange(
547 HdStAggregationStrategy *strategy,
548 HdStBufferArrayRegistry &bufferArrayRegistry,
549 TfToken const &role,
550 HdBufferSpecVector const &bufferSpecs,
551 HdBufferArrayUsageHint usageHint);
552
554 HdBufferArrayRangeSharedPtr _UpdateBufferArrayRange(
555 HdStAggregationStrategy *strategy,
556 HdStBufferArrayRegistry &bufferArrayRegistry,
557 TfToken const &role,
558 HdBufferArrayRangeSharedPtr const& curRange,
559 HdBufferSpecVector const &updatedOrAddedSpecs,
560 HdBufferSpecVector const& removedSpecs,
561 HdBufferArrayUsageHint usageHint);
562
563 // Tally resources by key into the given dictionary. Any additions should
564 // be cumulative with the existing key values.
565 void _TallyResourceAllocation(VtDictionary *result) const;
566
567 // TODO: this is a transient structure. we'll revisit the BufferSource
568 // interface later.
569 struct _PendingSource {
570 _PendingSource(HdBufferArrayRangeSharedPtr const &range)
571 : range(range)
572 , sources()
573 {
574 }
575
576 _PendingSource(HdBufferArrayRangeSharedPtr const &range,
577 HdBufferSourceSharedPtr const &source)
578 : range(range)
579 , sources(1, source)
580 {
581 }
582
583 _PendingSource(HdBufferArrayRangeSharedPtr const &range,
584 HdBufferSourceSharedPtrVector && sources)
585 : range(range)
586 , sources(std::move(sources))
587 {
588 }
589
590 HdBufferArrayRangeSharedPtr range;
591 HdBufferSourceSharedPtrVector sources;
592 };
593
594 Hgi* _hgi;
595
596 typedef tbb::concurrent_vector<_PendingSource> _PendingSourceList;
597 _PendingSourceList _pendingSources;
598 std::atomic_size_t _numBufferSourcesToResolve;
599
600 struct _PendingComputation{
601 _PendingComputation(HdBufferArrayRangeSharedPtr const &range,
602 HdStComputationSharedPtr const &computation)
603 : range(range), computation(computation) { }
604 HdBufferArrayRangeSharedPtr range;
605 HdStComputationSharedPtr computation;
606 };
607
608 // If we need more 'compute queues' we can increase HdStComputeQueueCount.
609 // We could also consider tbb::concurrent_priority_queue if we want this
610 // to be dynamically scalable.
611 typedef tbb::concurrent_vector<_PendingComputation> _PendingComputationList;
612 _PendingComputationList _pendingComputations[HdStComputeQueueCount];
613
614 // aggregated buffer array
615 HdStBufferArrayRegistry _nonUniformBufferArrayRegistry;
616 HdStBufferArrayRegistry _nonUniformImmutableBufferArrayRegistry;
617 HdStBufferArrayRegistry _uniformUboBufferArrayRegistry;
618 HdStBufferArrayRegistry _uniformSsboBufferArrayRegistry;
619 HdStBufferArrayRegistry _singleBufferArrayRegistry;
620
621 // current aggregation strategies
622 std::unique_ptr<HdStAggregationStrategy> _nonUniformAggregationStrategy;
623 std::unique_ptr<HdStAggregationStrategy>
624 _nonUniformImmutableAggregationStrategy;
625 std::unique_ptr<HdStAggregationStrategy> _uniformUboAggregationStrategy;
626 std::unique_ptr<HdStAggregationStrategy> _uniformSsboAggregationStrategy;
627 std::unique_ptr<HdStAggregationStrategy> _singleAggregationStrategy;
628
629 typedef std::vector<HdStDispatchBufferSharedPtr>
630 _DispatchBufferRegistry;
631 _DispatchBufferRegistry _dispatchBufferRegistry;
632
633 typedef std::vector<HdStBufferResourceSharedPtr>
634 _BufferResourceRegistry;
635 _BufferResourceRegistry _bufferResourceRegistry;
636
637 // Register mesh topology.
639 _meshTopologyRegistry;
640
641 // Register basisCurves topology.
643 _basisCurvesTopologyRegistry;
644
645 // Register vertex adjacency.
647 _vertexAdjacencyBuilderRegistry;
648
649 // Register topology index buffers.
651 _TopologyIndexRangeInstanceRegistry;
652 typedef tbb::concurrent_unordered_map< TfToken,
653 _TopologyIndexRangeInstanceRegistry,
655 _TopologyIndexRangeInstanceRegMap;
656
657 _TopologyIndexRangeInstanceRegMap _meshTopologyIndexRangeRegistry;
658 _TopologyIndexRangeInstanceRegMap _basisCurvesTopologyIndexRangeRegistry;
659
660 // Register shared primvar buffers.
662 _primvarRangeRegistry;
663
664 // Register ext computation resource.
666 _extComputationDataRangeRegistry;
667
668 // geometric shader registry
670 _geometricShaderRegistry;
671
672 // render pass shader registry
674 _renderPassShaderRegistry;
675
676 // glsl shader program registry
678 _glslProgramRegistry;
679
680 // glslfx file registry
682 _glslfxFileRegistry;
683
684#ifdef PXR_MATERIALX_SUPPORT_ENABLED
685 // MaterialX glslfx shader registry
686 HdInstanceRegistry<MaterialX::ShaderPtr> _materialXShaderRegistry;
687#endif
688
689 // texture handle registry
690 std::unique_ptr<class HdSt_TextureHandleRegistry> _textureHandleRegistry;
691
692 // Hgi resource bindings registry
694 _resourceBindingsRegistry;
695
696 // Hgi graphics pipeline registry
698 _graphicsPipelineRegistry;
699
700 // Hgi compute pipeline registry
702 _computePipelineRegistry;
703
704 using _SubResourceRegistryMap =
705 tbb::concurrent_unordered_map<std::string,
706 std::unique_ptr<HdResourceRegistry>>;
707 _SubResourceRegistryMap _subResourceRegistries;
708
709 HgiBlitCmdsUniquePtr _blitCmds;
710 HgiComputeCmdsUniquePtr _computeCmds;
711
712 std::unique_ptr<HdStStagingBuffer> _stagingBuffer;
713};
714
715
716PXR_NAMESPACE_CLOSE_SCOPE
717
718#endif //PXR_IMAGING_HD_ST_RESOURCE_REGISTRY_H
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.
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.
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:94
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