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_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
34PXR_NAMESPACE_OPEN_SCOPE
35
43struct HgiResolveImageOp;
44
45using HgiBlitCmdsUniquePtr = std::unique_ptr<class HgiBlitCmds>;
46
47
54class HgiBlitCmds : public HgiCmds
55{
56public:
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
106 HGI_API
107 virtual void FillBuffer(HgiBufferHandle const& buffer, uint8_t value) = 0;
108
111 HGI_API
112 virtual void InsertMemoryBarrier(HgiMemoryBarrier barrier) = 0;
113
114protected:
115 HGI_API
116 HgiBlitCmds();
117
118private:
119 HgiBlitCmds & operator=(const HgiBlitCmds&) = delete;
120 HgiBlitCmds(const HgiBlitCmds&) = delete;
121};
122
123
124
125PXR_NAMESPACE_CLOSE_SCOPE
126
127#endif
A graphics API independent abstraction of resource copy commands.
Definition: blitCmds.h:55
virtual HGI_API void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const &copyOp)=0
Copy a buffer resource from GPU to GPU.
virtual HGI_API void CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const &copyOp)=0
Copy new data from CPU into GPU buffer.
virtual HGI_API void PushDebugGroup(const char *label)=0
Push a debug marker.
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 PopDebugGroup()=0
Pop the lastest debug.
virtual HGI_API void GenerateMipMaps(HgiTextureHandle const &texture)=0
Generate mip maps for a texture.
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 CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const &copyOp)=0
Copy new data from the CPU into a GPU texture.
virtual HGI_API void CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const &copyOp)=0
Copy new data from GPU into CPU buffer.
virtual HGI_API void FillBuffer(HgiBufferHandle const &buffer, uint8_t value)=0
Fill a buffer with a constant value.
virtual HGI_API void CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const &copyOp)=0
Copy a texture resource from GPU to CPU.
virtual HGI_API void InsertMemoryBarrier(HgiMemoryBarrier barrier)=0
Inserts a barrier so that data written to memory by commands before the barrier is available to comma...
Graphics commands are recorded in 'cmds' objects which are later submitted to hgi.
Definition: cmds.h:45
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