Loading...
Searching...
No Matches
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
34PXR_NAMESPACE_OPEN_SCOPE
35
36using HgiComputeCmdsUniquePtr = std::unique_ptr<class HgiComputeCmds>;
37
38
45class HgiComputeCmds : public HgiCmds
46{
47public:
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(
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 InsertMemoryBarrier(HgiMemoryBarrier barrier) = 0;
96
98 HGI_API
99 virtual HgiComputeDispatch GetDispatchMethod() const = 0;
100
101protected:
102 HGI_API
104
105private:
106 HgiComputeCmds & operator=(const HgiComputeCmds&) = delete;
107 HgiComputeCmds(const HgiComputeCmds&) = delete;
108};
109
110
111
112PXR_NAMESPACE_CLOSE_SCOPE
113
114#endif
Graphics commands are recorded in 'cmds' objects which are later submitted to hgi.
Definition: cmds.h:45
A graphics API independent abstraction of compute commands.
Definition: computeCmds.h:46
virtual HGI_API void PushDebugGroup(const char *label)=0
Push a debug marker.
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 BindPipeline(HgiComputePipelineHandle pipeline)=0
Bind a pipeline state object.
virtual HGI_API void Dispatch(int dimX, int dimY)=0
Execute a compute shader with provided thread group count in each dimension.
virtual HGI_API void PopDebugGroup()=0
Pop the last debug marker.
virtual HGI_API HgiComputeDispatch GetDispatchMethod() const =0
Returns the dispatch method for this encoder.
virtual HGI_API void BindResources(HgiResourceBindingsHandle resources)=0
Bind resources such as textures and uniform buffers.
virtual HGI_API void InsertMemoryBarrier(HgiMemoryBarrier barrier)=0
Inserts a barrier so that data written to memory by commands before the barrier is available to comma...
Handle that contains a hgi object and unique id.
Definition: handle.h:50