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 PXR_NAMESPACE_OPEN_SCOPE
49 
50 using HdComputationSharedPtr = std::shared_ptr<class HdComputation>;
51 using HdStDispatchBufferSharedPtr = std::shared_ptr<class HdStDispatchBuffer>;
52 using HdStGLSLProgramSharedPtr = std::shared_ptr<class HdStGLSLProgram>;
53 using HioGlslfxSharedPtr = std::shared_ptr<class HioGlslfx>;
54 
55 using HdSt_BasisCurvesTopologySharedPtr =
56  std::shared_ptr<class HdSt_BasisCurvesTopology>;
57 
58 using HdStShaderCodePtr =
59  std::weak_ptr<class HdStShaderCode>;
60 using HdSt_GeometricShaderSharedPtr =
61  std::shared_ptr<class HdSt_GeometricShader>;
62 
63 using HdStTextureHandleSharedPtr =
64  std::shared_ptr<class HdStTextureHandle>;
65 using HdStTextureObjectSharedPtr =
66  std::shared_ptr<class HdStTextureObject>;
67 using HdStBufferResourceSharedPtr =
68  std::shared_ptr<class HdStBufferResource>;
69 using HdStResourceRegistrySharedPtr =
70  std::shared_ptr<class HdStResourceRegistry>;
71 using Hd_VertexAdjacencySharedPtr =
72  std::shared_ptr<class Hd_VertexAdjacency>;
73 using HdSt_MeshTopologySharedPtr =
74  std::shared_ptr<class HdSt_MeshTopology>;
75 using HgiResourceBindingsSharedPtr =
76  std::shared_ptr<HgiResourceBindingsHandle>;
77 using HgiGraphicsPipelineSharedPtr =
78  std::shared_ptr<HgiGraphicsPipelineHandle>;
79 using HgiComputePipelineSharedPtr =
80  std::shared_ptr<HgiComputePipelineHandle>;
81 
84 class HdStStagingBuffer;
85 
99 enum HdStComputeQueue {
100  HdStComputeQueueZero=0,
101  HdStComputeQueueOne,
102  HdStComputeQueueTwo,
103  HdStComputeQueueThree,
104  HdStComputeQueueCount};
105 
106 using HdStComputationSharedPtrVector =
107  std::vector<std::pair<HdComputationSharedPtr, HdStComputeQueue>>;
108 
109 
115 {
116 public:
117  HF_MALLOC_TAG_NEW("new HdStResourceRegistry");
118 
119  HDST_API
120  explicit HdStResourceRegistry(Hgi* hgi);
121 
122  HDST_API
123  ~HdStResourceRegistry() override;
124 
125  HDST_API
126  void InvalidateShaderRegistry() override;
127 
128  HDST_API
129  void ReloadResource(TfToken const& resourceType,
130  std::string const& path) override;
131 
132  HDST_API
133  VtDictionary GetResourceAllocation() const override;
134 
136  HDST_API
137  Hgi* GetHgi();
138 
143 
150  HDST_API
151  HdStTextureHandleSharedPtr AllocateTextureHandle(
155  const HdStTextureIdentifier &textureId,
157  HdTextureType textureType,
160  const HdSamplerParameters &samplerParams,
165  size_t memoryRequest,
170  HdStShaderCodePtr const &shaderCode);
171 
177  HDST_API
178  HdStTextureObjectSharedPtr AllocateTextureObject(
182  const HdStTextureIdentifier &textureId,
184  HdTextureType textureType);
185 
193  HDST_API
195  HdTextureType textureType,
196  size_t memoryRequest);
197 
204 
205  HDST_API
206  HdBufferArrayRangeSharedPtr AllocateNonUniformBufferArrayRange(
207  TfToken const &role,
208  HdBufferSpecVector const &bufferSpecs,
209  HdBufferArrayUsageHint usageHint);
210 
211  HDST_API
212  HdBufferArrayRangeSharedPtr AllocateNonUniformImmutableBufferArrayRange(
213  TfToken const &role,
214  HdBufferSpecVector const &bufferSpecs,
215  HdBufferArrayUsageHint usageHint);
216 
217  HDST_API
218  HdBufferArrayRangeSharedPtr AllocateUniformBufferArrayRange(
219  TfToken const &role,
220  HdBufferSpecVector const &bufferSpecs,
221  HdBufferArrayUsageHint usageHint);
222 
223  HDST_API
224  HdBufferArrayRangeSharedPtr AllocateShaderStorageBufferArrayRange(
225  TfToken const &role,
226  HdBufferSpecVector const &bufferSpecs,
227  HdBufferArrayUsageHint usageHint);
228 
229  HDST_API
230  HdBufferArrayRangeSharedPtr AllocateSingleBufferArrayRange(
231  TfToken const &role,
232  HdBufferSpecVector const &bufferSpecs,
233  HdBufferArrayUsageHint usageHint);
234 
250 
251  HDST_API
252  HdBufferArrayRangeSharedPtr UpdateNonUniformBufferArrayRange(
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 UpdateNonUniformImmutableBufferArrayRange(
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 UpdateUniformBufferArrayRange(
269  TfToken const &role,
270  HdBufferArrayRangeSharedPtr const& curRange,
271  HdBufferSpecVector const &updatedOrAddedSpecs,
272  HdBufferSpecVector const& removedSpecs,
273  HdBufferArrayUsageHint usageHint);
274 
275  HDST_API
276  HdBufferArrayRangeSharedPtr UpdateShaderStorageBufferArrayRange(
277  TfToken const &role,
278  HdBufferArrayRangeSharedPtr const& curRange,
279  HdBufferSpecVector const &updatedOrAddedSpecs,
280  HdBufferSpecVector const& removedSpecs,
281  HdBufferArrayUsageHint usageHint);
282 
286 
288  HDST_API
289  void AddSources(HdBufferArrayRangeSharedPtr const &range,
290  HdBufferSourceSharedPtrVector &&sources);
291 
293  HDST_API
294  void AddSource(HdBufferArrayRangeSharedPtr const &range,
295  HdBufferSourceSharedPtr const &source);
296 
298  HDST_API
299  void AddSource(HdBufferSourceSharedPtr const &source);
300 
307  HDST_API
308  void AddComputation(HdBufferArrayRangeSharedPtr const &range,
309  HdComputationSharedPtr const &computation,
310  HdStComputeQueue const queue);
311 
315 
318  HDST_API
319  HdStDispatchBufferSharedPtr RegisterDispatchBuffer(
320  TfToken const &role, int count, int commandNumUints);
321 
327  HDST_API
328  HdStBufferResourceSharedPtr RegisterBufferResource(
329  TfToken const &role,
330  HdTupleType tupleType);
331 
333  HDST_API
335 
337  HDST_API
339 
343 
354 
356  HDST_API
358  RegisterMeshTopology(HdInstance<HdSt_MeshTopologySharedPtr>::ID id);
359 
360  HDST_API
362  RegisterBasisCurvesTopology(
363  HdInstance<HdSt_BasisCurvesTopologySharedPtr>::ID id);
364 
365  HDST_API
367  RegisterVertexAdjacency(HdInstance<Hd_VertexAdjacencySharedPtr>::ID id);
368 
373  HDST_API
376  HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
377 
378  HDST_API
380  RegisterBasisCurvesIndexRange(
381  HdInstance<HdBufferArrayRangeSharedPtr>::ID id, TfToken const &name);
382 
387  HDST_API
390  HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
391 
396  HDST_API
399  HdInstance<HdBufferArrayRangeSharedPtr>::ID id);
400 
402  HDST_API
404  RegisterGeometricShader(HdInstance<HdSt_GeometricShaderSharedPtr>::ID id);
405 
407  HDST_API
409  RegisterGLSLProgram(HdInstance<HdStGLSLProgramSharedPtr>::ID id);
410 
412  HDST_API
414  RegisterGLSLFXFile(HdInstance<HioGlslfxSharedPtr>::ID id);
415 
417  HDST_API
419  RegisterResourceBindings(HdInstance<HgiResourceBindingsSharedPtr>::ID id);
420 
422  HDST_API
424  RegisterGraphicsPipeline(HdInstance<HgiGraphicsPipelineSharedPtr>::ID id);
425 
427  HDST_API
429  RegisterComputePipeline(HdInstance<HgiComputePipelineSharedPtr>::ID id);
430 
436  HDST_API
438 
444  HDST_API
446 
452  HDST_API
453  void SubmitBlitWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
454 
460  HDST_API
461  void SubmitComputeWork(HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
462 
464  HDST_API
466 
467 public:
468  //
469  // Unit test API
470  //
471 
476  std::unique_ptr<HdAggregationStrategy> &&strategy) {
477  _nonUniformAggregationStrategy = std::move(strategy);
478  }
479 
484  std::unique_ptr<HdAggregationStrategy> &&strategy) {
485  _nonUniformImmutableAggregationStrategy = std::move(strategy);
486  }
487 
491  std::unique_ptr<HdAggregationStrategy> &&strategy) {
492  _uniformUboAggregationStrategy = std::move(strategy);
493  }
494 
498  std::unique_ptr<HdAggregationStrategy> &&strategy) {
499  _uniformSsboAggregationStrategy = std::move(strategy);
500  }
501 
505  std::unique_ptr<HdAggregationStrategy> &&strategy) {
506  _singleAggregationStrategy = std::move(strategy);
507  }
508 
510  HDST_API
511  friend std::ostream &operator <<(
512  std::ostream &out,
513  const HdStResourceRegistry& self);
514 
515 protected:
516  void _Commit() override;
517  void _GarbageCollect() override;
518 
519 private:
520  void _CommitTextures();
521  // Wrapper function for BAR allocation
522  HdBufferArrayRangeSharedPtr _AllocateBufferArrayRange(
523  HdAggregationStrategy *strategy,
524  HdBufferArrayRegistry &bufferArrayRegistry,
525  TfToken const &role,
526  HdBufferSpecVector const &bufferSpecs,
527  HdBufferArrayUsageHint usageHint);
528 
530  HdBufferArrayRangeSharedPtr _UpdateBufferArrayRange(
531  HdAggregationStrategy *strategy,
532  HdBufferArrayRegistry &bufferArrayRegistry,
533  TfToken const &role,
534  HdBufferArrayRangeSharedPtr const& curRange,
535  HdBufferSpecVector const &updatedOrAddedSpecs,
536  HdBufferSpecVector const& removedSpecs,
537  HdBufferArrayUsageHint usageHint);
538 
539  // Tally resources by key into the given dictionary. Any additions should
540  // be cumulative with the existing key values.
541  void _TallyResourceAllocation(VtDictionary *result) const;
542 
543  // TODO: this is a transient structure. we'll revisit the BufferSource
544  // interface later.
545  struct _PendingSource {
546  _PendingSource(HdBufferArrayRangeSharedPtr const &range)
547  : range(range)
548  , sources()
549  {
550  }
551 
552  _PendingSource(HdBufferArrayRangeSharedPtr const &range,
553  HdBufferSourceSharedPtr const &source)
554  : range(range)
555  , sources(1, source)
556  {
557  }
558 
559  _PendingSource(HdBufferArrayRangeSharedPtr const &range,
560  HdBufferSourceSharedPtrVector && sources)
561  : range(range)
562  , sources(std::move(sources))
563  {
564  }
565 
566  HdBufferArrayRangeSharedPtr range;
567  HdBufferSourceSharedPtrVector sources;
568  };
569 
570  Hgi* _hgi;
571 
572  typedef tbb::concurrent_vector<_PendingSource> _PendingSourceList;
573  _PendingSourceList _pendingSources;
574  std::atomic_size_t _numBufferSourcesToResolve;
575 
576  struct _PendingComputation{
577  _PendingComputation(HdBufferArrayRangeSharedPtr const &range,
578  HdComputationSharedPtr const &computation)
579  : range(range), computation(computation) { }
580  HdBufferArrayRangeSharedPtr range;
581  HdComputationSharedPtr computation;
582  };
583 
584  // If we need more 'compute queues' we can increase HdStComputeQueueCount.
585  // We could also consider tbb::concurrent_priority_queue if we want this
586  // to be dynamically scalable.
587  typedef tbb::concurrent_vector<_PendingComputation> _PendingComputationList;
588  _PendingComputationList _pendingComputations[HdStComputeQueueCount];
589 
590  // aggregated buffer array
591  HdBufferArrayRegistry _nonUniformBufferArrayRegistry;
592  HdBufferArrayRegistry _nonUniformImmutableBufferArrayRegistry;
593  HdBufferArrayRegistry _uniformUboBufferArrayRegistry;
594  HdBufferArrayRegistry _uniformSsboBufferArrayRegistry;
595  HdBufferArrayRegistry _singleBufferArrayRegistry;
596 
597  // current aggregation strategies
598  std::unique_ptr<HdAggregationStrategy> _nonUniformAggregationStrategy;
599  std::unique_ptr<HdAggregationStrategy>
600  _nonUniformImmutableAggregationStrategy;
601  std::unique_ptr<HdAggregationStrategy> _uniformUboAggregationStrategy;
602  std::unique_ptr<HdAggregationStrategy> _uniformSsboAggregationStrategy;
603  std::unique_ptr<HdAggregationStrategy> _singleAggregationStrategy;
604 
605  typedef std::vector<HdStDispatchBufferSharedPtr>
606  _DispatchBufferRegistry;
607  _DispatchBufferRegistry _dispatchBufferRegistry;
608 
609  typedef std::vector<HdStBufferResourceSharedPtr>
610  _BufferResourceRegistry;
611  _BufferResourceRegistry _bufferResourceRegistry;
612 
613  // Register mesh topology.
615  _meshTopologyRegistry;
616 
617  // Register basisCurves topology.
619  _basisCurvesTopologyRegistry;
620 
621  // Register vertex adjacency.
623  _vertexAdjacencyRegistry;
624 
625  // Register topology index buffers.
627  _TopologyIndexRangeInstanceRegistry;
628  typedef tbb::concurrent_unordered_map< TfToken,
629  _TopologyIndexRangeInstanceRegistry,
631  _TopologyIndexRangeInstanceRegMap;
632 
633  _TopologyIndexRangeInstanceRegMap _meshTopologyIndexRangeRegistry;
634  _TopologyIndexRangeInstanceRegMap _basisCurvesTopologyIndexRangeRegistry;
635 
636  // Register shared primvar buffers.
638  _primvarRangeRegistry;
639 
640  // Register ext computation resource.
642  _extComputationDataRangeRegistry;
643 
644  // geometric shader registry
646  _geometricShaderRegistry;
647 
648  // glsl shader program registry
650  _glslProgramRegistry;
651 
652  // glslfx file registry
654  _glslfxFileRegistry;
655 
656  // texture handle registry
657  std::unique_ptr<class HdSt_TextureHandleRegistry> _textureHandleRegistry;
658 
659  // Hgi resource bindings registry
661  _resourceBindingsRegistry;
662 
663  // Hgi graphics pipeline registry
665  _graphicsPipelineRegistry;
666 
667  // Hgi compute pipeline registry
669  _computePipelineRegistry;
670 
671  HgiBlitCmdsUniquePtr _blitCmds;
672  HgiComputeCmdsUniquePtr _computeCmds;
673 
674  std::unique_ptr<HdStStagingBuffer> _stagingBuffer;
675 };
676 
677 
678 PXR_NAMESPACE_CLOSE_SCOPE
679 
680 #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.
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:108
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...
HDST_API HgiComputeCmds * GetGlobalComputeCmds()
Returns the global hgi compute cmd queue for recording compute work.
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.