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,
30 const GfVec4f& color = s_blitDebugColor) override;
31
32 HGIGL_API
33 void PopDebugGroup() override;
34
35 HGIGL_API
37 const char* label,
38 const GfVec4f& color = s_markerDebugColor) override;
39
40 HGIGL_API
41 void CopyTextureGpuToCpu(HgiTextureGpuToCpuOp const& copyOp) override;
42
43 HGIGL_API
44 void CopyTextureCpuToGpu(HgiTextureCpuToGpuOp const& copyOp) override;
45
46 HGIGL_API
47 void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const& copyOp) override;
48
49 HGIGL_API
50 void CopyBufferCpuToGpu(HgiBufferCpuToGpuOp const& copyOp) override;
51
52 HGIGL_API
53 void CopyBufferGpuToCpu(HgiBufferGpuToCpuOp const& copyOp) override;
54
55 HGIGL_API
56 void CopyTextureToBuffer(HgiTextureToBufferOp const& copyOp) override;
57
58 HGIGL_API
59 void CopyBufferToTexture(HgiBufferToTextureOp const& copyOp) override;
60
61 HGIGL_API
62 void GenerateMipMaps(HgiTextureHandle const& texture) override;
63
64 HGIGL_API
65 void FillBuffer(HgiBufferHandle const& buffer, uint8_t value) override;
66
67 HGIGL_API
68 void InsertMemoryBarrier(HgiMemoryBarrier barrier) override;
69
70protected:
71 friend class HgiGL;
72
73 HGIGL_API
75
76 HGIGL_API
77 bool _Submit(Hgi* hgi, HgiSubmitWaitType wait) override;
78
79private:
80 HgiGLBlitCmds & operator=(const HgiGLBlitCmds&) = delete;
81 HgiGLBlitCmds(const HgiGLBlitCmds&) = delete;
82
83 HgiGLOpsVector _ops;
84 int _pushStack;
85
86 // BlitCmds is used only one frame so storing multi-frame state here will
87 // not survive.
88};
89
90PXR_NAMESPACE_CLOSE_SCOPE
91
92#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
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 PushDebugGroup(const char *label, const GfVec4f &color=s_blitDebugColor) override
Push a debug scope.
HGIGL_API void FillBuffer(HgiBufferHandle const &buffer, uint8_t value) override
Fill a buffer with a constant value.
HGIGL_API void InsertDebugMarker(const char *label, const GfVec4f &color=s_markerDebugColor) override
Insert a debug marker.
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 scope.
HGIGL_API void CopyBufferGpuToGpu(HgiBufferGpuToGpuOp const &copyOp) override
Copy a buffer resource from GPU to GPU.
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.
Describes the properties needed to copy buffer data from GPU to CPU.
Describes the properties needed to copy buffer data from GPU to GPU.
Describes the properties needed to copy GPU buffer data into a GPU texture.
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.