Loading...
Searching...
No Matches
ops.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_HGIGL_OPS_H
25#define PXR_IMAGING_HGIGL_OPS_H
26
27#include "pxr/pxr.h"
28#include "pxr/base/gf/vec4i.h"
29
30#include "pxr/imaging/hgi/buffer.h"
31#include "pxr/imaging/hgi/blitCmdsOps.h"
32#include "pxr/imaging/hgi/graphicsCmdsDesc.h"
33#include "pxr/imaging/hgi/graphicsPipeline.h"
34#include "pxr/imaging/hgi/resourceBindings.h"
35
36#include "pxr/imaging/hgiGL/api.h"
37#include "pxr/imaging/hgiGL/device.h"
38
39#include <cstdint>
40#include <functional>
41#include <vector>
42
43PXR_NAMESPACE_OPEN_SCOPE
44
45using HgiGLOpsFn = std::function<void(void)>;
46
71{
72public:
73 HGIGL_API
74 static HgiGLOpsFn PushDebugGroup(const char* label);
75
76 HGIGL_API
77 static HgiGLOpsFn PopDebugGroup();
78
79 HGIGL_API
80 static HgiGLOpsFn CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const& copyOp);
81
82 HGIGL_API
83 static HgiGLOpsFn CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const& copyOp);
84
85 HGIGL_API
86 static HgiGLOpsFn CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const& copyOp);
87
88 HGIGL_API
89 static HgiGLOpsFn CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const& copyOp);
90
91 HGIGL_API
92 static HgiGLOpsFn CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const& copyOp);
93
94 HGIGL_API
95 static HgiGLOpsFn CopyTextureToBuffer(HgiTextureToBufferOp const& copyOp);
96
97 HGIGL_API
98 static HgiGLOpsFn CopyBufferToTexture(HgiBufferToTextureOp const& copyOp);
99
100 HGIGL_API
101 static HgiGLOpsFn ResolveFramebuffer(
102 HgiGLDevice* device,
103 HgiGraphicsCmdsDesc const &graphicsCmds);
104
105 HGIGL_API
106 static HgiGLOpsFn SetViewport(GfVec4i const& vp);
107
108 HGIGL_API
109 static HgiGLOpsFn SetScissor(GfVec4i const& sc);
110
111 HGIGL_API
112 static HgiGLOpsFn BindPipeline(HgiGraphicsPipelineHandle pipeline);
113
114 HGIGL_API
115 static HgiGLOpsFn BindPipeline(HgiComputePipelineHandle pipeline);
116
117 HGIGL_API
118 static HgiGLOpsFn BindResources(HgiResourceBindingsHandle resources);
119
120 HGIGL_API
121 static HgiGLOpsFn SetConstantValues(
123 HgiShaderStage stages,
124 uint32_t bindIndex,
125 uint32_t byteSize,
126 const void* data);
127
128 HGIGL_API
129 static HgiGLOpsFn SetConstantValues(
131 uint32_t bindIndex,
132 uint32_t byteSize,
133 const void* data);
134
135 HGIGL_API
136 static HgiGLOpsFn BindVertexBuffers(
137 HgiVertexBufferBindingVector const &bindings);
138
139 HGIGL_API
140 static HgiGLOpsFn Draw(
141 HgiPrimitiveType primitiveType,
142 uint32_t primitiveIndexSize,
143 uint32_t vertexCount,
144 uint32_t baseVertex,
145 uint32_t instanceCount,
146 uint32_t baseInstance);
147
148 HGIGL_API
149 static HgiGLOpsFn DrawIndirect(
150 HgiPrimitiveType primitiveType,
151 uint32_t primitiveIndexSize,
152 HgiBufferHandle const& drawParameterBuffer,
153 uint32_t drawBufferByteOffset,
154 uint32_t drawCount,
155 uint32_t stride);
156
157 HGIGL_API
158 static HgiGLOpsFn DrawIndexed(
159 HgiPrimitiveType primitiveType,
160 uint32_t primitiveIndexSize,
161 HgiBufferHandle const& indexBuffer,
162 uint32_t indexCount,
163 uint32_t indexBufferByteOffset,
164 uint32_t baseVertex,
165 uint32_t instanceCount,
166 uint32_t baseInstance);
167
168 HGIGL_API
169 static HgiGLOpsFn DrawIndexedIndirect(
170 HgiPrimitiveType primitiveType,
171 uint32_t primitiveIndexSize,
172 HgiBufferHandle const& indexBuffer,
173 HgiBufferHandle const& drawParameterBuffer,
174 uint32_t drawBufferByteOffset,
175 uint32_t drawCount,
176 uint32_t stride);
177
178 HGIGL_API
179 static HgiGLOpsFn BindFramebufferOp(
180 HgiGLDevice* device,
181 HgiGraphicsCmdsDesc const& desc);
182
183 HGIGL_API
184 static HgiGLOpsFn Dispatch(int dimX, int dimY);
185
186 HGIGL_API
187 static HgiGLOpsFn FillBuffer(HgiBufferHandle const& buffer, uint8_t value);
188
189 HGIGL_API
190 static HgiGLOpsFn GenerateMipMaps(HgiTextureHandle const& texture);
191
192 HGIGL_API
193 static HgiGLOpsFn InsertMemoryBarrier(HgiMemoryBarrier barrier);
194
195};
196
197PXR_NAMESPACE_CLOSE_SCOPE
198
199#endif
Basic type for a vector of 4 int components.
Definition: vec4i.h:61
OpenGL implementation of GPU device.
Definition: device.h:46
A collection of functions used by cmds objects to do deferred cmd recording.
Definition: ops.h:71
Describes the properties needed to copy buffer data from CPU to GPU.
Definition: blitCmdsOps.h:191
Describes the properties needed to copy buffer data from GPU to CPU.
Definition: blitCmdsOps.h:231
Describes the properties needed to copy buffer data from GPU to GPU.
Definition: blitCmdsOps.h:151
Describes the properties needed to copy GPU buffer data into a GPU texture.
Definition: blitCmdsOps.h:315
Describes the properties to begin a HgiGraphicsCmds.
Describes the properties needed to copy texture data from CPU to GPU.
Definition: blitCmdsOps.h:111
Describes the properties needed to copy texture data from GPU to CPU.
Definition: blitCmdsOps.h:68
Describes the properties needed to copy GPU texture data into a GPU buffer.
Definition: blitCmdsOps.h:271