All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
computeCmds.h
1 //
2 // Copyright 2020 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_HGI_COMPUTE_CMDS_H
25 #define PXR_IMAGING_HGI_COMPUTE_CMDS_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hgi/api.h"
29 #include "pxr/imaging/hgi/computePipeline.h"
30 #include "pxr/imaging/hgi/resourceBindings.h"
31 #include "pxr/imaging/hgi/cmds.h"
32 #include <memory>
33 
34 PXR_NAMESPACE_OPEN_SCOPE
35 
36 using HgiComputeCmdsUniquePtr = std::unique_ptr<class HgiComputeCmds>;
37 
38 
45 class HgiComputeCmds : public HgiCmds
46 {
47 public:
48  HGI_API
49  ~HgiComputeCmds() override;
50 
52  HGI_API
53  virtual void PushDebugGroup(const char* label) = 0;
54 
56  HGI_API
57  virtual void PopDebugGroup() = 0;
58 
63  HGI_API
64  virtual void BindPipeline(HgiComputePipelineHandle pipeline) = 0;
65 
69  HGI_API
70  virtual void BindResources(HgiResourceBindingsHandle resources) = 0;
71 
80  HGI_API
81  virtual void SetConstantValues(
82  HgiComputePipelineHandle pipeline,
83  uint32_t bindIndex,
84  uint32_t byteSize,
85  const void* data) = 0;
86 
89  HGI_API
90  virtual void Dispatch(int dimX, int dimY) = 0;
91 
94  HGI_API
95  virtual void MemoryBarrier(HgiMemoryBarrier barrier) = 0;
96 
97 protected:
98  HGI_API
100 
101 private:
102  HgiComputeCmds & operator=(const HgiComputeCmds&) = delete;
103  HgiComputeCmds(const HgiComputeCmds&) = delete;
104 };
105 
106 
107 
108 PXR_NAMESPACE_CLOSE_SCOPE
109 
110 #endif
virtual HGI_API void Dispatch(int dimX, int dimY)=0
Execute a compute shader with provided thread group count in each dimension.
A graphics API independent abstraction of compute commands.
Definition: computeCmds.h:45
virtual HGI_API void MemoryBarrier(HgiMemoryBarrier barrier)=0
Inserts a barrier so that data written to memory by commands before the barrier is available to comma...
virtual HGI_API void PushDebugGroup(const char *label)=0
Push a debug marker.
virtual HGI_API void BindResources(HgiResourceBindingsHandle resources)=0
Bind resources such as textures and uniform buffers.
virtual HGI_API void SetConstantValues(HgiComputePipelineHandle pipeline, uint32_t bindIndex, uint32_t byteSize, const void *data)=0
Set Push / Function constants.
virtual HGI_API void PopDebugGroup()=0
Pop the last debug marker.
virtual HGI_API void BindPipeline(HgiComputePipelineHandle pipeline)=0
Bind a pipeline state object.
Graphics commands are recorded in &#39;cmds&#39; objects which are later submitted to hgi.
Definition: cmds.h:44
Handle that contains a hgi object and unique id.
Definition: handle.h:49