All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
32 PXR_NAMESPACE_OPEN_SCOPE
33 
34 
39 class HgiGLBlitCmds final : public HgiBlitCmds
40 {
41 public:
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 MemoryBarrier(HgiMemoryBarrier barrier) override;
77 
78 protected:
79  friend class HgiGL;
80 
81  HGIGL_API
82  HgiGLBlitCmds();
83 
84  HGIGL_API
85  bool _Submit(Hgi* hgi, HgiSubmitWaitType wait) override;
86 
87 private:
88  HgiGLBlitCmds & operator=(const HgiGLBlitCmds&) = delete;
89  HgiGLBlitCmds(const HgiGLBlitCmds&) = delete;
90 
91  HgiGLOpsVector _ops;
92  int _pushStack;
93 
94  // BlitCmds is used only one frame so storing multi-frame state here will
95  // not survive.
96 };
97 
98 PXR_NAMESPACE_CLOSE_SCOPE
99 
100 #endif
Describes the properties needed to copy buffer data from CPU to GPU.
Definition: blitCmdsOps.h:190
HGIGL_API void PushDebugGroup(const char *label) override
Push a debug marker.
Describes the properties needed to copy GPU buffer data into a GPU texture.
Definition: blitCmdsOps.h:314
HGIGL_API void GenerateMipMaps(HgiTextureHandle const &texture) override
Generate mip maps for a texture.
OpenGL implementation of HgiBlitCmds.
Definition: blitCmds.h:39
HGIGL_API void CopyTextureToBuffer(HgiTextureToBufferOp const &copyOp) override
Copy a texture resource into a buffer resource from GPU to GPU.
HGIGL_API void CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const &copyOp) override
Copy new data from GPU into CPU buffer.
Describes the properties needed to copy texture data from GPU to CPU.
Definition: blitCmdsOps.h:67
HGIGL_API void CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const &copyOp) override
Copy new data from CPU into GPU buffer.
HGIGL_API void MemoryBarrier(HgiMemoryBarrier barrier) override
Inserts a barrier so that data written to memory by commands before the barrier is available to comma...
HGIGL_API void PopDebugGroup() override
Pop the lastest debug.
OpenGL implementation of the Hydra Graphics Interface.
Definition: hgi.h:53
HGIGL_API void CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const &copyOp) override
Copy a texture resource from GPU to CPU.
HGIGL_API void CopyBufferToTexture(HgiBufferToTextureOp const &copyOp) override
Copy a buffer resource into a texture resource from GPU to GPU.
Hydra Graphics Interface.
Definition: hgi.h:106
HGIGL_API void CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const &copyOp) override
Copy new data from the CPU into a GPU texture.
Describes the properties needed to copy buffer data from GPU to CPU.
Definition: blitCmdsOps.h:230
Describes the properties needed to copy texture data from CPU to GPU.
Definition: blitCmdsOps.h:110
Describes the properties needed to copy buffer data from GPU to GPU.
Definition: blitCmdsOps.h:150
A graphics API independent abstraction of resource copy commands.
Definition: blitCmds.h:54
HGIGL_API void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const &copyOp) override
Copy a buffer resource from GPU to GPU.
Describes the properties needed to copy GPU texture data into a GPU buffer.
Definition: blitCmdsOps.h:270