HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
blitCmds.h
Go to the documentation of this file.
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"
29 #include "pxr/imaging/hgiGL/api.h"
30 #include "pxr/imaging/hgiGL/hgi.h"
31 
33 
34 
35 /// \class HgiGLBlitCmds
36 ///
37 /// OpenGL implementation of HgiBlitCmds.
38 ///
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 FillBuffer(HgiBufferHandle const& buffer, uint8_t value) override;
77 
78  HGIGL_API
79  void InsertMemoryBarrier(HgiMemoryBarrier barrier) override;
80 
81 protected:
82  friend class HgiGL;
83 
84  HGIGL_API
85  HgiGLBlitCmds();
86 
87  HGIGL_API
88  bool _Submit(Hgi* hgi, HgiSubmitWaitType wait) override;
89 
90 private:
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 
102 
103 #endif
HGIGL_API void PopDebugGroup() override
Pop the lastest debug.
HGIGL_API void CopyTextureToBuffer(HgiTextureToBufferOp const &copyOp) override
Copy a texture resource into a buffer resource from GPU to GPU.
HGIGL_API void CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const &copyOp) override
Copy new data from the CPU into a GPU texture.
HGIGL_API void CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const &copyOp) override
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
HGIGL_API void FillBuffer(HgiBufferHandle const &buffer, uint8_t value) override
Fill a buffer with a constant value.
int HgiHandle< class HgiTexture > HgiTextureHandle
HGIGL_API void GenerateMipMaps(HgiTextureHandle const &texture) override
Generate mip maps for a texture.
HGIGL_API void CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const &copyOp) override
HgiSubmitWaitType
Definition: enums.h:663
Definition: core.h:760
Definition: hgi.h:71
HgiBits HgiMemoryBarrier
Definition: enums.h:685
#define HGIGL_API
Definition: api.h:40
HGIGL_API bool _Submit(Hgi *hgi, HgiSubmitWaitType wait) override
HGIGL_API void CopyBufferToTexture(HgiBufferToTextureOp const &copyOp) override
Copy a buffer resource into a texture resource from GPU to GPU.
HGIGL_API void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const &copyOp) override
Copy a buffer resource from GPU to GPU.
*tasks wait()
Definition: hgi.h:110
HGIGL_API ~HgiGLBlitCmds() override
HGIGL_API void InsertMemoryBarrier(HgiMemoryBarrier barrier) override
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
HGIGL_API void CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const &copyOp) override
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
GLuint texture
Definition: glcorearb.h:415
Definition: core.h:1131
HGIGL_API void PushDebugGroup(const char *label) override
Push a debug marker.
std::vector< HgiGLOpsFn > HgiGLOpsVector
Definition: hgi.h:43
HGIGL_API HgiGLBlitCmds()