CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
GLCommandBuffer.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "OpenGL.hpp"
11
13
15
16namespace CeresEngine {
17
18 class GLDevice;
19 class GLCommandQueue;
20
21 class GLGraphicsPipeline;
22
23 class GLCommandBuffer final : public GPUCommandBuffer, public GLDeviceObject<GLCommandBuffer, GPUCommandBuffer> {
24 friend class GLCommandQueue;
25
26 private:
29
33
34 public:
37
38 public:
41
43 void bindVertexBuffer(GPUBuffer& vertexBuffer, UInt32 offset = 0, UInt32 slot = 0) final;
44
47
49 void draw(UInt32 vertexCount, UInt32 instanceCount = 1, UInt32 firstVertex = 0, UInt32 firstInstance = 0) final;
50
53
55 void drawIndexed(UInt32 indexCount, UInt32 instanceCount = 1, UInt32 firstVertex = 0, Int32 vertexOffset = 0, UInt32 firstInstance = 0) final;
56
59
62
63 public: // Dynamic States
66
69
71 void setScissor(const Scissor& scissor) final;
72
75
76 public: // Mesh-shaders
79
82
85
86 public: // Buffer read, write & copy.
89
92
95
96 public: // Image read, write & copy.
100
103 const TExtent3<UInt32>& extent) final;
104
108
111 const TExtent3<UInt32>& extent) final;
112
114 void clear(GPUImage& image) final;
115
118
121
122 public: // Synchronization
124 void barrier(GPUImage& image, GPUImageLayout layout) final;
125
126 public:
128 void begin() final;
129
131 void end() final;
132
134 void wait() final;
135
136 public:
139 };
140
141} // namespace CeresEngine
unsigned int GLuint
Definition GLLoader.hpp:733
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Definition GLCommandBuffer.hpp:23
void bindGraphicsPipeline(GLGraphicsPipeline &graphicsPipeline)
void fillBuffer(GPUBuffer &dstBuffer, std::uint64_t dstOffset, std::uint32_t value, std::uint64_t fillSize=~0u) final
const GPUCommandBufferDescriptor descriptorGL
A structure that describes the command buffer and it's properties.
Definition GLCommandBuffer.hpp:28
void copyImageFromBuffer(GPUImage &dstImage, const GPUImageRegion &dstRegion, GPUBuffer &srcBuffer, std::uint64_t srcOffset, std::uint32_t rowStride=0, std::uint32_t layerStride=0) final
void bindIndexBuffer(GPUBuffer &indexBuffer, UInt32 offset=0, IndexType indexType=IndexType::UInt32) final
void drawMeshTasks(UInt32 groupCountX, UInt32 groupCountY, UInt32 groupCountZ) final
Draw mesh task work items.
void setScissor(const Scissor &scissor) final
void setScissors(const SmallVector< Scissor, 16 > &scissors) final
void bindVertexBuffer(GPUBuffer &vertexBuffer, UInt32 offset=0, UInt32 slot=0) final
void barrier(GPUImage &image, GPUImageLayout layout) final
void bindResourceSet(GPUResourceSet &resourceSet, UInt32 firstSet=0, Int32 offset=-1) final
GLGraphicsPipeline * mGraphicsPipeline
Definition GLCommandBuffer.hpp:31
void copyBuffer(GPUBuffer &dstBuffer, std::uint64_t dstOffset, GPUBuffer &srcBuffer, std::uint64_t srcOffset, std::uint64_t size) final
void generateMips(GPUImage &image) final
void setViewport(const Viewport &viewport) final
void updateBuffer(GPUBuffer &dstBuffer, std::uint64_t dstOffset, const void *data, std::uint16_t dataSize) final
void resolveImage(GPUImage &dstImage, const GPUImageLocation &dstLocation, GPUImage &srcImage, const GPUImageLocation &srcLocation, const TExtent3< UInt32 > &extent) final
void copyBufferFromImage(GPUBuffer &dstBuffer, std::uint64_t dstOffset, GPUImage &srcImage, const GPUImageRegion &srcImageRegion, std::uint32_t rowStride=0, std::uint32_t layerStride=0) final
void drawIndexed(UInt32 indexCount, UInt32 instanceCount=1, UInt32 firstVertex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) final
void copyImage(GPUImage &dstImage, const GPUImageLocation &dstLocation, GPUImage &srcImage, const GPUImageLocation &srcLocation, const TExtent3< UInt32 > &extent) final
GLuint mVAO
Definition GLCommandBuffer.hpp:30
IndexType indexType
Definition GLCommandBuffer.hpp:32
void setViewports(const SmallVector< Viewport, 16 > &viewports) final
void clear(GPUImage &image) final
void draw(UInt32 vertexCount, UInt32 instanceCount=1, UInt32 firstVertex=0, UInt32 firstInstance=0) final
GLCommandBuffer(GLDevicePtr device, const GPUCommandBufferDescriptor &descriptor)
void drawMeshTasksIndirect(GPUBuffer &buffer, UInt64 offset, UInt32 drawCount, UInt32 stride) final
Issue an indirect mesh tasks draw into a command buffer.
Definition GLCommandQueue.hpp:21
Definition OpenGL.hpp:117
Definition GLGraphicsPipeline.hpp:28
Definition GPUBuffer.hpp:124
Definition GPUCommandBuffer.hpp:77
GPUDevice & device
The owning device this object was created from.
Definition Common.hpp:55
Definition GPUImage.hpp:331
A RenderAPI object that holds a set of resources that can be bound into shader.
Definition GPUResourceSet.hpp:735
const Descriptor & descriptor
A structure that describes the object and it's properties.
Definition Common.hpp:69
Definition Application.hpp:19
std::uint64_t UInt64
Definition DataTypes.hpp:26
GPUImageLayout
Definition GPUImage.hpp:65
std::int32_t Int32
Definition DataTypes.hpp:21
sfl::small_vector< T, N, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > SmallVector
SmallVector is a sequence container similar to Vector.
Definition SmallVector.hpp:31
std::uint32_t UInt32
Definition DataTypes.hpp:23
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition Span.hpp:668
Command buffer descriptor structure.
Definition GPUCommandBuffer.hpp:32
Structure specifying a draw indirect command.
Definition GPUCommandBuffer.hpp:59
Structure specifying a draw indirect command.
Definition GPUCommandBuffer.hpp:44
Image location structure: MIP-map level and offset.
Definition GPUImage.hpp:120
Image region structure: Subresource (MIP-map level and array layer range), offset,...
Definition GPUImage.hpp:156
Image subresource descriptor which specifies the array layer and MIP-map level range of a image resou...
Definition GPUImage.hpp:77
Definition IndexType.hpp:20
@ UInt32
The index buffer is represented as a 32-bit unsigned integer.
Definition IndexType.hpp:26
Definition GPUGraphicsPipeline.hpp:281
Definition GPUGraphicsPipeline.hpp:214