resourceRegistry.h
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_IMAGING_HD_ST_RESOURCE_REGISTRY_H
25 #define PXR_IMAGING_HD_ST_RESOURCE_REGISTRY_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/base/vt/dictionary.h"
29 
30 #include "pxr/imaging/hdSt/api.h"
31 
32 #include "pxr/imaging/hgi/hgi.h"
33 
34 #include "pxr/imaging/hd/bufferArrayRange.h"
35 #include "pxr/imaging/hd/bufferArrayRegistry.h"
36 #include "pxr/imaging/hd/bufferSource.h"
37 #include "pxr/imaging/hd/bufferSpec.h"
38 #include "pxr/imaging/hd/enums.h"
39 #include "pxr/imaging/hd/instanceRegistry.h"
40 #include "pxr/imaging/hd/resourceRegistry.h"
41 
42 #include <tbb/concurrent_vector.h>
43 
44 #include <atomic>
45 #include <map>
46 #include <memory>
47 
48 #ifdef PXR_MATERIALX_SUPPORT_ENABLED
49 #include <MaterialXCore/Library.h>
50 MATERIALX_NAMESPACE_BEGIN
51  using ShaderPtr = std::shared_ptr<class Shader>;
52 MATERIALX_NAMESPACE_END
53 #endif
54 
55 PXR_NAMESPACE_OPEN_SCOPE
56 
57 using HdComputationSharedPtr = std::shared_ptr<class HdComputation>;
58 using HdStDispatchBufferSharedPtr = std::shared_ptr<class HdStDispatchBuffer>;
59 using HdStGLSLProgramSharedPtr = std::shared_ptr<class HdStGLSLProgram>;
60 using HioGlslfxSharedPtr = std::shared_ptr<class HioGlslfx>;
61 
62 using HdSt_BasisCurvesTopologySharedPtr =
63  std::shared_ptr<class HdSt_BasisCurvesTopology>;
64 
65 using HdStShaderCodePtr =
66  std::weak_ptr<class HdStShaderCode>;
67 using HdSt_GeometricShaderSharedPtr =
68  std::shared_ptr<class HdSt_GeometricShader>;
69 
70 using HdStTextureHandleSharedPtr =
71  std::shared_ptr<class HdStTextureHandle>;
72 using HdStTextureObjectSharedPtr =
73  std::shared_ptr<class HdStTextureObject>;
74 using HdStBufferResourceSharedPtr =
75  std::shared_ptr<class HdStBufferResource>;
76 using HdStResourceRegistrySharedPtr =
77  std::shared_ptr<class HdStResourceRegistry>;
78 using Hd_VertexAdjacencySharedPtr =
79  std::shared_ptr<class Hd_VertexAdjacency>;
80 using HdSt_MeshTopologySharedPtr =
81  std::shared_ptr<class HdSt_MeshTopology>;
82 using HgiResourceBindingsSharedPtr =
83  std::shared_ptr<HgiResourceBindingsHandle>;
84 using HgiGraphicsPipelineSharedPtr =
85  std::shared_ptr<HgiGraphicsPipelineHandle>;
86 using HgiComputePipelineSharedPtr =
87  std::shared_ptr<HgiComputePipelineHandle>;
88 
91 class HdStStagingBuffer;
92 
106 enum HdStComputeQueue {
107  HdStComputeQueueZero=0,
108  HdStComputeQueueOne,
109  HdStComputeQueueTwo,
110  HdStComputeQueueThree,
111  HdStComputeQueueCount};
112 
113 using HdStComputationSharedPtrVector =
114  std::vector<std::pair<HdComputationSharedPtr, HdStComputeQueue>>;
115 
116 
122 {
123 public:
124  HF_MALLOC_TAG_NEW("new HdStResourceRegistry");
125 
126  HDST_API
127  explicit HdStResourceRegistry(Hgi* hgi);
128 
129  HDST_API
130  ~HdStResourceRegistry() override;
131 
132  HDST_API
133  void InvalidateShaderRegistry() override;
134 
135  HDST_API
136  void ReloadResource(TfToken const& resourceType,
137  std::string const& path) override;
138 
139  HDST_API
140  VtDictionary GetResourceAllocation() const override;
141 
143  HDST_API
144  Hgi* GetHgi();
145 
150 
157  HDST_API
158  HdStTextureHandleSharedPtr AllocateTextureHandle(
162  const HdStTextureIdentifier &textureId,
164  HdTextureType textureType,
167  const HdSamplerParameters &samplerParams,
172  size_t memoryRequest,
177  HdStShaderCodePtr const &shaderCode);
178 
184  HDST_API
185  HdStTextureObjectSharedPtr AllocateTextureObject(
189  const HdStTextureIdentifier &textureId,
191  HdTextureType textureType);
192 
200  HDST_API
202  HdTextureType 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  HdComputationSharedPtr 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 
340  HDST_API
342 
344  HDST_API
346 
350 
361 
363  HDST_API
365  RegisterMeshTopology(HdInstance<HdSt_MeshTopologySharedPtr>::ID id);
366 
367  HDST_API
369  RegisterBasisCurvesTopology(
370  HdInstance<HdSt_BasisCurvesTopologySharedPtr>::ID id);
371 
372  HDST_API
374  RegisterVertexAdjacency(HdInstance<Hd_VertexAdjacencySharedPtr>::ID id);
375 
380  HDST_API
383  HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
384 
385  HDST_API
387  RegisterBasisCurvesIndexRange(
388  HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
389 
394  HDST_API
397  HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
398 
403  HDST_API
406  HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
407 
409  HDST_API
411  RegisterGeometricShader(HdInstance<HdSt_GeometricShaderSharedPtr>::ID id);
412 
414  HDST_API
416  RegisterGLSLProgram(HdInstance<HdStGLSLProgramSharedPtr>::ID id);
417 
419  HDST_API
421  RegisterGLSLFXFile(HdInstance<HioGlslfxSharedPtr>::ID id);
422 
423 #ifdef PXR_MATERIALX_SUPPORT_ENABLED
424  HDST_API
427  RegisterMaterialXShader(HdInstance<MaterialX::ShaderPtr>::ID id);
428 #endif
429 
431  HDST_API
433  RegisterResourceBindings(HdInstance<HgiResourceBindingsSharedPtr>::ID id);
434 
436  HDST_API
438  RegisterGraphicsPipeline(HdInstance<HgiGraphicsPipelineSharedPtr>::ID id);
439 
441  HDST_API
443  RegisterComputePipeline(HdInstance<HgiComputePipelineSharedPtr>::ID id);
444 
450  HDST_API
452 
458  HDST_API
460  HgiComputeDispatch dispatchMethod = HgiComputeDispatchSerial);
461 
467  HDST_API
468  void SubmitBlitWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
469 
475  HDST_API
476  void SubmitComputeWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
477 
479  HDST_API
481 
482 public:
483  //
484  // Unit test API
485  //
486 
491  std::unique_ptr<HdAggregationStrategy> &&strategy) {
492  _nonUniformAggregationStrategy = std::move(strategy);
493  }
494 
499  std::unique_ptr<HdAggregationStrategy> &&strategy) {
500  _nonUniformImmutableAggregationStrategy = std::move(strategy);
501  }
502 
506  std::unique_ptr<HdAggregationStrategy> &&strategy) {
507  _uniformUboAggregationStrategy = std::move(strategy);
508  }
509 
513  std::unique_ptr<HdAggregationStrategy> &&strategy) {
514  _uniformSsboAggregationStrategy = std::move(strategy);
515  }
516 
520  std::unique_ptr<HdAggregationStrategy> &&strategy) {
521  _singleAggregationStrategy = std::move(strategy);
522  }
523 
525  HDST_API
526  friend std::ostream &operator <<(
527  std::ostream &out,
528  const HdStResourceRegistry& self);
529 
530 protected:
531  void _Commit() override;
532  void _GarbageCollect() override;
533 
534 private:
535  void _CommitTextures();
536  // Wrapper function for BAR allocation
537  HdBufferArrayRangeSharedPtr _AllocateBufferArrayRange(
538  HdAggregationStrategy *strategy,
539  HdBufferArrayRegistry &bufferArrayRegistry,
540  TfToken const &role,
541  HdBufferSpecVector const &bufferSpecs,
542  HdBufferArrayUsageHint usageHint);
543 
545  HdBufferArrayRangeSharedPtr _UpdateBufferArrayRange(
546  HdAggregationStrategy *strategy,
547  HdBufferArrayRegistry &bufferArrayRegistry,
548  TfToken const &role,
549  HdBufferArrayRangeSharedPtr const& curRange,
550  HdBufferSpecVector const &updatedOrAddedSpecs,
551  HdBufferSpecVector const& removedSpecs,
552  HdBufferArrayUsageHint usageHint);
553 
554  // Tally resources by key into the given dictionary. Any additions should
555  // be cumulative with the existing key values.
556  void _TallyResourceAllocation(VtDictionary *result) const;
557 
558  // TODO: this is a transient structure. we'll revisit the BufferSource
559  // interface later.
560  struct _PendingSource {
561  _PendingSource(HdBufferArrayRangeSharedPtr const &range)
562  : range(range)
563  , sources()
564  {
565  }
566 
567  _PendingSource(HdBufferArrayRangeSharedPtr const &range,
568  HdBufferSourceSharedPtr const &source)
569  : range(range)
570  , sources(1, source)
571  {
572  }
573 
574  _PendingSource(HdBufferArrayRangeSharedPtr const &range,
575  HdBufferSourceSharedPtrVector && sources)
576  : range(range)
577  , sources(std::move(sources))
578  {
579  }
580 
581  HdBufferArrayRangeSharedPtr range;
582  HdBufferSourceSharedPtrVector sources;
583  };
584 
585  Hgi* _hgi;
586 
587  typedef tbb::concurrent_vector<_PendingSource> _PendingSourceList;
588  _PendingSourceList _pendingSources;
589  std::atomic_size_t _numBufferSourcesToResolve;
590 
591  struct _PendingComputation{
592  _PendingComputation(HdBufferArrayRangeSharedPtr const &range,
593  HdComputationSharedPtr const &computation)
594  : range(range), computation(computation) { }
595  HdBufferArrayRangeSharedPtr range;
596  HdComputationSharedPtr computation;
597  };
598 
599  // If we need more 'compute queues' we can increase HdStComputeQueueCount.
600  // We could also consider tbb::concurrent_priority_queue if we want this
601  // to be dynamically scalable.
602  typedef tbb::concurrent_vector<_PendingComputation> _PendingComputationList;
603  _PendingComputationList _pendingComputations[HdStComputeQueueCount];
604 
605  // aggregated buffer array
606  HdBufferArrayRegistry _nonUniformBufferArrayRegistry;
607  HdBufferArrayRegistry _nonUniformImmutableBufferArrayRegistry;
608  HdBufferArrayRegistry _uniformUboBufferArrayRegistry;
609  HdBufferArrayRegistry _uniformSsboBufferArrayRegistry;
610  HdBufferArrayRegistry _singleBufferArrayRegistry;
611 
612  // current aggregation strategies
613  std::unique_ptr<HdAggregationStrategy> _nonUniformAggregationStrategy;
614  std::unique_ptr<HdAggregationStrategy>
615  _nonUniformImmutableAggregationStrategy;
616  std::unique_ptr<HdAggregationStrategy> _uniformUboAggregationStrategy;
617  std::unique_ptr<HdAggregationStrategy> _uniformSsboAggregationStrategy;
618  std::unique_ptr<HdAggregationStrategy> _singleAggregationStrategy;
619 
620  typedef std::vector<HdStDispatchBufferSharedPtr>
621  _DispatchBufferRegistry;
622  _DispatchBufferRegistry _dispatchBufferRegistry;
623 
624  typedef std::vector<HdStBufferResourceSharedPtr>
625  _BufferResourceRegistry;
626  _BufferResourceRegistry _bufferResourceRegistry;
627 
628  // Register mesh topology.
630  _meshTopologyRegistry;
631 
632  // Register basisCurves topology.
634  _basisCurvesTopologyRegistry;
635 
636  // Register vertex adjacency.
638  _vertexAdjacencyRegistry;
639 
640  // Register topology index buffers.
642  _TopologyIndexRangeInstanceRegistry;
643  typedef tbb::concurrent_unordered_map< TfToken,
644  _TopologyIndexRangeInstanceRegistry,
646  _TopologyIndexRangeInstanceRegMap;
647 
648  _TopologyIndexRangeInstanceRegMap _meshTopologyIndexRangeRegistry;
649  _TopologyIndexRangeInstanceRegMap _basisCurvesTopologyIndexRangeRegistry;
650 
651  // Register shared primvar buffers.
653  _primvarRangeRegistry;
654 
655  // Register ext computation resource.
657  _extComputationDataRangeRegistry;
658 
659  // geometric shader registry
661  _geometricShaderRegistry;
662 
663  // glsl shader program registry
665  _glslProgramRegistry;
666 
667  // glslfx file registry
669  _glslfxFileRegistry;
670 
671 #ifdef PXR_MATERIALX_SUPPORT_ENABLED
672  // MaterialX glslfx shader registry
673  HdInstanceRegistry<MaterialX::ShaderPtr> _materialXShaderRegistry;
674 #endif
675 
676  // texture handle registry
677  std::unique_ptr<class HdSt_TextureHandleRegistry> _textureHandleRegistry;
678 
679  // Hgi resource bindings registry
681  _resourceBindingsRegistry;
682 
683  // Hgi graphics pipeline registry
685  _graphicsPipelineRegistry;
686 
687  // Hgi compute pipeline registry
689  _computePipelineRegistry;
690 
691  HgiBlitCmdsUniquePtr _blitCmds;
692  HgiComputeCmdsUniquePtr _computeCmds;
693 
694  std::unique_ptr<HdStStagingBuffer> _stagingBuffer;
695 };
696 
697 
698 PXR_NAMESPACE_CLOSE_SCOPE
699 
700 #endif //PXR_IMAGING_HD_ST_RESOURCE_REGISTRY_H
HDST_API HdInstance< HgiGraphicsPipelineSharedPtr > RegisterGraphicsPipeline(HdInstance< HgiGraphicsPipelineSharedPtr >::ID id)
Register a Hgi graphics pipeline into the registry.
The union provides a set of flags that provide hints to the memory management system about the proper...
Definition: bufferArray.h:70
Aggregation strategy base class.
Definition: strategyBase.h:48
HDST_API HdInstance< HdBufferArrayRangeSharedPtr > RegisterPrimvarRange(HdInstance< HdBufferArrayRangeSharedPtr >::ID id)
Primvar array range instancing Returns the HdInstance pointing to shared HdBufferArrayRange,...
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 HdStBufferResourceSharedPtr RegisterBufferResource(TfToken const &role, HdTupleType tupleType)
Register a misc buffer resource.
HdTupleType represents zero, one, or more values of the same HdType.
Definition: types.h:358
HDST_API HdStTextureHandleSharedPtr AllocateTextureHandle(const HdStTextureIdentifier &textureId, HdTextureType textureType, const HdSamplerParameters &samplerParams, size_t memoryRequest, HdStShaderCodePtr const &shaderCode)
Allocate texture handle (encapsulates texture and sampler object, memory request and callback to shad...
A map with string keys and VtValue values.
Definition: dictionary.h:63
HDST_API void SubmitComputeWork(HgiSubmitWaitType wait=HgiSubmitWaitTypeNoWait)
Submits compute work queued in global compute cmds for GPU execution.
HDST_API HgiComputeCmds * GetGlobalComputeCmds(HgiComputeDispatch dispatchMethod=HgiComputeDispatchSerial)
Returns the global hgi compute cmd queue for recording compute work.
Functor to use for hash maps from tokens to other things.
Definition: token.h:166
HDST_API void GarbageCollectDispatchBuffers()
Remove any entries associated with expired dispatch buffers.
void SetNonUniformImmutableAggregationStrategy(std::unique_ptr< HdAggregationStrategy > &&strategy)
Set the aggregation strategy for non uniform immutable parameters (vertex, varying,...
HDST_API HdStStagingBuffer * GetStagingBuffer()
Returns the staging buffer used when committing data to the GPU.
Manages the pool of buffer arrays.
HDST_API void SetMemoryRequestForTextureType(HdTextureType textureType, size_t memoryRequest)
Sets how much memory a single texture can consume in bytes by texture type.
A graphics API independent abstraction of compute commands.
Definition: computeCmds.h:45
HDST_API void AddSources(HdBufferArrayRangeSharedPtr const &range, HdBufferSourceSharedPtrVector &&sources)
Append source data for given range to be committed later.
void SetNonUniformAggregationStrategy(std::unique_ptr< HdAggregationStrategy > &&strategy)
Set the aggregation strategy for non uniform parameters (vertex, varying, facevarying) Takes ownershi...
HDST_API Hgi * GetHgi()
Returns Hgi used to create/destroy GPU resources.
Class to identify a texture file or a texture within the texture file (e.g., a frame in a movie).
HDST_API void AddSource(HdBufferArrayRangeSharedPtr const &range, HdBufferSourceSharedPtr const &source)
Append a source data for given range to be committed later.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
HDST_API HdInstance< HioGlslfxSharedPtr > RegisterGLSLFXFile(HdInstance< HioGlslfxSharedPtr >::ID id)
Register a GLSLFX file.
A central registry of all GPU resources.
void _Commit() override
A hook for derived registries to perform additional resource commits.
A central registry for resources.
void SetUniformAggregationStrategy(std::unique_ptr< HdAggregationStrategy > &&strategy)
Set the aggregation strategy for uniform (shader globals) Takes ownership of the passed in strategy o...
HDST_API HgiBlitCmds * GetGlobalBlitCmds()
Returns the global hgi blit command queue for recording blitting work.
void SetSingleStorageAggregationStrategy(std::unique_ptr< HdAggregationStrategy > &&strategy)
Set the aggregation strategy for single buffers (for nested instancer).
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...
HDST_API HdInstance< HgiComputePipelineSharedPtr > RegisterComputePipeline(HdInstance< HgiComputePipelineSharedPtr >::ID id)
Register a Hgi compute pipeline into the registry.
Hydra Graphics Interface.
Definition: hgi.h:110
HDST_API HdStTextureObjectSharedPtr AllocateTextureObject(const HdStTextureIdentifier &textureId, HdTextureType textureType)
Allocate texture object.
HDST_API HdBufferArrayRangeSharedPtr UpdateNonUniformBufferArrayRange(TfToken const &role, HdBufferArrayRangeSharedPtr const &curRange, HdBufferSpecVector const &updatedOrAddedSpecs, HdBufferSpecVector const &removedSpecs, HdBufferArrayUsageHint usageHint)
HDST_API HdInstance< HdBufferArrayRangeSharedPtr > RegisterExtComputationDataRange(HdInstance< HdBufferArrayRangeSharedPtr >::ID id)
ExtComputation data array range instancing Returns the HdInstance pointing to shared HdBufferArrayRan...
void SetShaderStorageAggregationStrategy(std::unique_ptr< HdAggregationStrategy > &&strategy)
Set the aggregation strategy for SSBO (uniform primvars) Takes ownership of the passed in strategy ob...
Collection of standard parameters such as wrap modes to sample a texture.
Definition: types.h:127
void _GarbageCollect() override
Hooks for derived registries to perform additional GC when GarbageCollect() is invoked.
HDST_API HdInstance< HdSt_GeometricShaderSharedPtr > RegisterGeometricShader(HdInstance< HdSt_GeometricShaderSharedPtr >::ID id)
Register a geometric shader.
HDST_API void GarbageCollectBufferResources()
Remove any entries associated with expired misc buffers.
Provides a staging buffer for CPU writes of triple-buffered resources.
Definition: stagingBuffer.h:49
HDST_API void SubmitBlitWork(HgiSubmitWaitType wait=HgiSubmitWaitTypeNoWait)
Submits blit work queued in global blit cmds for GPU execution.
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 friend std::ostream & operator<<(std::ostream &out, const HdStResourceRegistry &self)
Debug dump.
HDST_API HdInstance< HdSt_MeshTopologySharedPtr > RegisterMeshTopology(HdInstance< HdSt_MeshTopologySharedPtr >::ID id)
These registries implement sharing and deduplication of data based on computed hash identifiers.
This class is used as an interface to a shared instance in HdInstanceRegistry.
A graphics API independent abstraction of resource copy commands.
Definition: blitCmds.h:54
HDST_API HdInstance< HgiResourceBindingsSharedPtr > RegisterResourceBindings(HdInstance< HgiResourceBindingsSharedPtr >::ID id)
Register a Hgi resource bindings into the registry.
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 HdBufferArrayRangeSharedPtr AllocateNonUniformBufferArrayRange(TfToken const &role, HdBufferSpecVector const &bufferSpecs, HdBufferArrayUsageHint usageHint)
HDST_API HdInstance< HdStGLSLProgramSharedPtr > RegisterGLSLProgram(HdInstance< HdStGLSLProgramSharedPtr >::ID id)
Register a GLSL program into the program registry.
HDST_API void AddComputation(HdBufferArrayRangeSharedPtr const &range, HdComputationSharedPtr const &computation, HdStComputeQueue const queue)
Append a gpu computation into queue.
HDST_API void InvalidateShaderRegistry() override
Invalidate any shaders registered with this registry.