Loading...
Searching...
No Matches
blitCmds.h
1//
2// Copyright 2019 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_GL_BLIT_CMDS_H
25#define PXR_IMAGING_HGI_GL_BLIT_CMDS_H
26
27#include "pxr/pxr.h"
28#include "pxr/imaging/hgi/blitCmds.h"
29#include "pxr/imaging/hgiGL/api.h"
30#include "pxr/imaging/hgiGL/hgi.h"
31
32PXR_NAMESPACE_OPEN_SCOPE
33
34
39class HgiGLBlitCmds final : public HgiBlitCmds
40{
41public:
42 HGIGL_API
43 ~HgiGLBlitCmds() override;
44
45 HGIGL_API
46 void PushDebugGroup(const char* label) override;
47
48 HGIGL_API
49 void PopDebugGroup() override;
50
51 HGIGL_API
52 void CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const& copyOp) override;
53
54 HGIGL_API
55 void CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const& copyOp) override;
56
57 HGIGL_API
58 void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const& copyOp) override;
59
60 HGIGL_API
61 void CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const& copyOp) override;
62
63 HGIGL_API
64 void CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const& copyOp) override;
65
66 HGIGL_API
67 void CopyTextureToBuffer(HgiTextureToBufferOp const& copyOp) override;
68
69 HGIGL_API
70 void CopyBufferToTexture(HgiBufferToTextureOp const& copyOp) override;
71
72 HGIGL_API
73 void GenerateMipMaps(HgiTextureHandle const& texture) override;
74
75 HGIGL_API
76 void FillBuffer(HgiBufferHandle const& buffer, uint8_t value) override;
77
78 HGIGL_API
79 void InsertMemoryBarrier(HgiMemoryBarrier barrier) override;
80
81protected:
82 friend class HgiGL;
83
84 HGIGL_API
86
87 HGIGL_API
88 bool _Submit(Hgi* hgi, HgiSubmitWaitType wait) override;
89
90private:
91 HgiGLBlitCmds & operator=(const HgiGLBlitCmds&) = delete;
92 HgiGLBlitCmds(const HgiGLBlitCmds&) = delete;
93
94 HgiGLOpsVector _ops;
95 int _pushStack;
96
97 // BlitCmds is used only one frame so storing multi-frame state here will
98 // not survive.
99};
100
101PXR_NAMESPACE_CLOSE_SCOPE
102
103#endif
A graphics API independent abstraction of resource copy commands.
Definition: blitCmds.h:55
OpenGL implementation of HgiBlitCmds.
Definition: blitCmds.h:40
HGIGL_API void CopyBufferToTexture(HgiBufferToTextureOp const &copyOp) override
Copy a buffer resource into a texture resource from GPU to GPU.
HGIGL_API void CopyTextureToBuffer(HgiTextureToBufferOp const &copyOp) override
Copy a texture resource into a buffer resource from GPU to GPU.
HGIGL_API void GenerateMipMaps(HgiTextureHandle const &texture) override
Generate mip maps for a texture.
HGIGL_API void CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const &copyOp) override
Copy new data from CPU into GPU buffer.
HGIGL_API void InsertMemoryBarrier(HgiMemoryBarrier barrier) override
Inserts a barrier so that data written to memory by commands before the barrier is available to comma...
HGIGL_API void FillBuffer(HgiBufferHandle const &buffer, uint8_t value) override
Fill a buffer with a constant value.
HGIGL_API void CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const &copyOp) override
Copy a texture resource from GPU to CPU.
HGIGL_API void CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const &copyOp) override
Copy new data from the CPU into a GPU texture.
HGIGL_API void CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const &copyOp) override
Copy new data from GPU into CPU buffer.
HGIGL_API void PopDebugGroup() override
Pop the lastest debug.
HGIGL_API void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const &copyOp) override
Copy a buffer resource from GPU to GPU.
HGIGL_API void PushDebugGroup(const char *label) override
Push a debug marker.
OpenGL implementation of the Hydra Graphics Interface.
Definition: hgi.h:72
Hydra Graphics Interface.
Definition: hgi.h:111
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 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