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_BLIT_CMDS_H
25 #define PXR_IMAGING_HGI_BLIT_CMDS_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hgi/api.h"
29 #include "pxr/imaging/hgi/buffer.h"
30 #include "pxr/imaging/hgi/cmds.h"
31 #include "pxr/imaging/hgi/texture.h"
32 #include <memory>
33 
34 PXR_NAMESPACE_OPEN_SCOPE
35 
38 struct HgiBufferGpuToGpuOp;
39 struct HgiBufferCpuToGpuOp;
40 struct HgiBufferGpuToCpuOp;
43 struct HgiResolveImageOp;
44 
45 using HgiBlitCmdsUniquePtr = std::unique_ptr<class HgiBlitCmds>;
46 
47 
54 class HgiBlitCmds : public HgiCmds
55 {
56 public:
57  HGI_API
58  ~HgiBlitCmds() override;
59 
61  HGI_API
62  virtual void PushDebugGroup(const char* label) = 0;
63 
65  HGI_API
66  virtual void PopDebugGroup() = 0;
67 
71  HGI_API
72  virtual void CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const& copyOp) = 0;
73 
75  HGI_API
76  virtual void CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const& copyOp) = 0;
77 
79  HGI_API
80  virtual void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const& copyOp) = 0;
81 
84  HGI_API
85  virtual void CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const& copyOp) = 0;
86 
90  HGI_API
91  virtual void CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const& copyOp) = 0;
92 
94  HGI_API
95  virtual void CopyTextureToBuffer(HgiTextureToBufferOp const& copyOp) = 0;
96 
98  HGI_API
99  virtual void CopyBufferToTexture(HgiBufferToTextureOp const& copyOp) = 0;
100 
102  HGI_API
103  virtual void GenerateMipMaps(HgiTextureHandle const& texture) = 0;
104 
107  HGI_API
108  virtual void MemoryBarrier(HgiMemoryBarrier barrier) = 0;
109 
110 protected:
111  HGI_API
112  HgiBlitCmds();
113 
114 private:
115  HgiBlitCmds & operator=(const HgiBlitCmds&) = delete;
116  HgiBlitCmds(const HgiBlitCmds&) = delete;
117 };
118 
119 
120 
121 PXR_NAMESPACE_CLOSE_SCOPE
122 
123 #endif
Describes the properties needed to copy buffer data from CPU to GPU.
Definition: blitCmdsOps.h:190
virtual HGI_API void PopDebugGroup()=0
Pop the lastest debug.
Describes the properties needed to copy GPU buffer data into a GPU texture.
Definition: blitCmdsOps.h:314
virtual HGI_API void PushDebugGroup(const char *label)=0
Push a debug marker.
Describes the properties needed to copy texture data from GPU to CPU.
Definition: blitCmdsOps.h:67
virtual HGI_API void CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const &copyOp)=0
Copy new data from GPU into CPU buffer.
virtual HGI_API void CopyBufferToTexture(HgiBufferToTextureOp const &copyOp)=0
Copy a buffer resource into a texture resource from GPU to GPU.
virtual HGI_API void CopyTextureToBuffer(HgiTextureToBufferOp const &copyOp)=0
Copy a texture resource into a buffer resource from GPU to GPU.
virtual HGI_API void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const &copyOp)=0
Copy a buffer resource from GPU to GPU.
virtual HGI_API void GenerateMipMaps(HgiTextureHandle const &texture)=0
Generate mip maps for a texture.
virtual HGI_API void MemoryBarrier(HgiMemoryBarrier barrier)=0
Inserts a barrier so that data written to memory by commands before the barrier is available to comma...
virtual HGI_API void CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const &copyOp)=0
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
Graphics commands are recorded in &#39;cmds&#39; objects which are later submitted to hgi.
Definition: cmds.h:44
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
virtual HGI_API void CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const &copyOp)=0
Copy new data from CPU into GPU buffer.
Describes the properties needed to copy GPU texture data into a GPU buffer.
Definition: blitCmdsOps.h:270
virtual HGI_API void CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const &copyOp)=0
Copy a texture resource from GPU to CPU.