Loading...
Searching...
No Matches
blitCmds.h
1//
2// Copyright 2019 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HGI_BLIT_CMDS_H
8#define PXR_IMAGING_HGI_BLIT_CMDS_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hgi/api.h"
12#include "pxr/imaging/hgi/buffer.h"
13#include "pxr/imaging/hgi/cmds.h"
14#include "pxr/imaging/hgi/texture.h"
15#include <memory>
16
17PXR_NAMESPACE_OPEN_SCOPE
18
26struct HgiResolveImageOp;
27
28using HgiBlitCmdsUniquePtr = std::unique_ptr<class HgiBlitCmds>;
29
30
37class HgiBlitCmds : public HgiCmds
38{
39public:
40 HGI_API
41 ~HgiBlitCmds() override;
42
44 HGI_API
45 virtual void PushDebugGroup(const char* label,
46 const GfVec4f& color = s_blitDebugColor) = 0;
47
49 HGI_API
50 virtual void PopDebugGroup() = 0;
51
53 HGI_API
54 virtual void InsertDebugMarker(
55 const char* label,
56 const GfVec4f& color = s_markerDebugColor) = 0;
57
61 HGI_API
62 virtual void CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const& copyOp) = 0;
63
65 HGI_API
66 virtual void CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const& copyOp) = 0;
67
69 HGI_API
70 virtual void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const& copyOp) = 0;
71
74 HGI_API
75 virtual void CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const& copyOp) = 0;
76
80 HGI_API
81 virtual void CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const& copyOp) = 0;
82
84 HGI_API
85 virtual void CopyTextureToBuffer(HgiTextureToBufferOp const& copyOp) = 0;
86
88 HGI_API
89 virtual void CopyBufferToTexture(HgiBufferToTextureOp const& copyOp) = 0;
90
92 HGI_API
93 virtual void GenerateMipMaps(HgiTextureHandle const& texture) = 0;
94
96 HGI_API
97 virtual void FillBuffer(HgiBufferHandle const& buffer, uint8_t value) = 0;
98
101 HGI_API
102 virtual void InsertMemoryBarrier(HgiMemoryBarrier barrier) = 0;
103
104protected:
105 HGI_API
106 HgiBlitCmds();
107
108private:
109 HgiBlitCmds & operator=(const HgiBlitCmds&) = delete;
110 HgiBlitCmds(const HgiBlitCmds&) = delete;
111};
112
113
114
115PXR_NAMESPACE_CLOSE_SCOPE
116
117#endif
Basic type for a vector of 4 float components.
Definition: vec4f.h:46
A graphics API independent abstraction of resource copy commands.
Definition: blitCmds.h:38
virtual HGI_API void InsertDebugMarker(const char *label, const GfVec4f &color=s_markerDebugColor)=0
Insert a debug marker.
virtual HGI_API void PushDebugGroup(const char *label, const GfVec4f &color=s_blitDebugColor)=0
Push a debug scope.
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 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 scope.
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:29
Describes the properties needed to copy buffer data from CPU to GPU.
Definition: blitCmdsOps.h:174
Describes the properties needed to copy buffer data from GPU to CPU.
Definition: blitCmdsOps.h:214
Describes the properties needed to copy buffer data from GPU to GPU.
Definition: blitCmdsOps.h:134
Describes the properties needed to copy GPU buffer data into a GPU texture.
Definition: blitCmdsOps.h:298
Describes the properties needed to copy texture data from CPU to GPU.
Definition: blitCmdsOps.h:94
Describes the properties needed to copy texture data from GPU to CPU.
Definition: blitCmdsOps.h:51
Describes the properties needed to copy GPU texture data into a GPU buffer.
Definition: blitCmdsOps.h:254