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_GL_BLIT_CMDS_H
8#define PXR_IMAGING_HGI_GL_BLIT_CMDS_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hgi/blitCmds.h"
12#include "pxr/imaging/hgiGL/api.h"
13#include "pxr/imaging/hgiGL/hgi.h"
14
15PXR_NAMESPACE_OPEN_SCOPE
16
17
22class HgiGLBlitCmds final : public HgiBlitCmds
23{
24public:
25 HGIGL_API
26 ~HgiGLBlitCmds() override;
27
28 HGIGL_API
29 void PushDebugGroup(const char* label) override;
30
31 HGIGL_API
32 void PopDebugGroup() override;
33
34 HGIGL_API
35 void CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const& copyOp) override;
36
37 HGIGL_API
38 void CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const& copyOp) override;
39
40 HGIGL_API
41 void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const& copyOp) override;
42
43 HGIGL_API
44 void CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const& copyOp) override;
45
46 HGIGL_API
47 void CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const& copyOp) override;
48
49 HGIGL_API
50 void CopyTextureToBuffer(HgiTextureToBufferOp const& copyOp) override;
51
52 HGIGL_API
53 void CopyBufferToTexture(HgiBufferToTextureOp const& copyOp) override;
54
55 HGIGL_API
56 void GenerateMipMaps(HgiTextureHandle const& texture) override;
57
58 HGIGL_API
59 void FillBuffer(HgiBufferHandle const& buffer, uint8_t value) override;
60
61 HGIGL_API
62 void InsertMemoryBarrier(HgiMemoryBarrier barrier) override;
63
64protected:
65 friend class HgiGL;
66
67 HGIGL_API
69
70 HGIGL_API
71 bool _Submit(Hgi* hgi, HgiSubmitWaitType wait) override;
72
73private:
74 HgiGLBlitCmds & operator=(const HgiGLBlitCmds&) = delete;
75 HgiGLBlitCmds(const HgiGLBlitCmds&) = delete;
76
77 HgiGLOpsVector _ops;
78 int _pushStack;
79
80 // BlitCmds is used only one frame so storing multi-frame state here will
81 // not survive.
82};
83
84PXR_NAMESPACE_CLOSE_SCOPE
85
86#endif
A graphics API independent abstraction of resource copy commands.
Definition: blitCmds.h:38
OpenGL implementation of HgiBlitCmds.
Definition: blitCmds.h:23
HGIGL_API void CopyBufferToTexture(HgiBufferToTextureOp const &copyOp) override
Copy a buffer resource into a texture resource from GPU to GPU.
HGIGL_API void CopyTextureToBuffer(HgiTextureToBufferOp const &copyOp) override
Copy a texture resource into a buffer resource from GPU to GPU.
HGIGL_API void GenerateMipMaps(HgiTextureHandle const &texture) override
Generate mip maps for a texture.
HGIGL_API void CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const &copyOp) override
Copy new data from CPU into GPU buffer.
HGIGL_API void InsertMemoryBarrier(HgiMemoryBarrier barrier) override
Inserts a barrier so that data written to memory by commands before the barrier is available to comma...
HGIGL_API void FillBuffer(HgiBufferHandle const &buffer, uint8_t value) override
Fill a buffer with a constant value.
HGIGL_API void CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const &copyOp) override
Copy a texture resource from GPU to CPU.
HGIGL_API void CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const &copyOp) override
Copy new data from the CPU into a GPU texture.
HGIGL_API void CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const &copyOp) override
Copy new data from GPU into CPU buffer.
HGIGL_API void PopDebugGroup() override
Pop the lastest debug.
HGIGL_API void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const &copyOp) override
Copy a buffer resource from GPU to GPU.
HGIGL_API void PushDebugGroup(const char *label) override
Push a debug marker.
OpenGL implementation of the Hydra Graphics Interface.
Definition: hgi.h:55
Hydra Graphics Interface.
Definition: hgi.h:95
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