Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
VulkanCommandBuffer.hpp
1#pragma once
2
3#include <Common/Graphics/CommandBuffer.hpp>
4#include <vulkan/vulkan.h>
5
6namespace Grindstone::GraphicsAPI::Vulkan {
8 public:
9 static void SetupDebugLabelUtils(VkInstance instance);
10
11 CommandBuffer(const CreateInfo& createInfo);
12 virtual ~CommandBuffer() override;
13 public:
14 virtual VkCommandBuffer GetCommandBuffer();
15 private:
16 virtual void BeginCommandBuffer() override;
17 virtual void BindRenderPass(
20 uint32_t width,
21 uint32_t height,
22 ClearColorValue* colorClearValues,
23 uint32_t colorClearCount,
24 ClearDepthStencil depthStencilClearValue
25 ) override;
26 virtual void UnbindRenderPass() override;
27 virtual void BeginDebugLabelSection(const char* name, float color[4] = nullptr) override;
28 virtual void EndDebugLabelSection() override;
29 virtual void BindGraphicsDescriptorSet(
30 GraphicsAPI::GraphicsPipeline* graphicsPipeline,
31 GraphicsAPI::DescriptorSet** descriptorSets,
32 uint32_t descriptorSetCount
33 ) override;
34 virtual void BindComputeDescriptorSet(
35 GraphicsAPI::ComputePipeline* graphicsPipeline,
36 GraphicsAPI::DescriptorSet** descriptorSets,
37 uint32_t descriptorSetCount
38 ) override;
39 virtual void BindCommandBuffers(Grindstone::GraphicsAPI::CommandBuffer** commandBuffers, uint32_t commandBuffersCount) override;
40 virtual void SetViewport(float offsetX, float offsetY, float width, float height, float depthMin = 0.0f, float depthMax = 1.0f) override;
41 virtual void SetScissor(int32_t offsetX, int32_t offsetY, uint32_t width, uint32_t height) override;
42 virtual void SetDepthBias(float biasConstantFactor, float biasSlopeFactor) override;
43 virtual void BindGraphicsPipeline(GraphicsAPI::GraphicsPipeline* pipeline) override;
44 virtual void BindComputePipeline(GraphicsAPI::ComputePipeline* pipeline) override;
45 virtual void BindVertexArrayObject(GraphicsAPI::VertexArrayObject* vertexArrayObject) override;
46 virtual void BindVertexBuffers(GraphicsAPI::VertexBuffer** vb, uint32_t count) override;
47 virtual void BindIndexBuffer(GraphicsAPI::IndexBuffer* indexBuffer) override;
48 virtual void DrawVertices(uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount, int32_t vertexOffset) override;
49 virtual void DrawIndices(uint32_t firstIndex, uint32_t indexCount, uint32_t firstInstance, uint32_t instanceCount, int32_t vertexOffset) override;
50 virtual void DispatchCompute(uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) override;
52 virtual void WaitForComputeMemoryBarrier(Grindstone::GraphicsAPI::RenderTarget* renderTarget, bool shouldMakeWritable) override;
53
54 virtual void EndCommandBuffer() override;
55 private:
56 virtual void BindDescriptorSet(
57 VkPipelineLayout pipelineLayout,
58 VkPipelineBindPoint bindPoint,
59 GraphicsAPI::DescriptorSet** descriptorSets,
60 uint32_t descriptorSetCount
61 );
62
63 VkCommandBuffer commandBuffer;
64 VkCommandBufferBeginInfo beginInfo;
65 CommandBufferSecondaryInfo secondaryInfo;
66 };
67}
Definition CommandBuffer.hpp:21
Definition ComputePipeline.hpp:18
Definition DepthStencilTarget.hpp:15
Definition DescriptorSet.hpp:11
Definition Framebuffer.hpp:19
Definition GraphicsPipeline.hpp:18
Definition IndexBuffer.hpp:11
Definition RenderPass.hpp:27
Definition RenderTarget.hpp:12
Definition VertexArrayObject.hpp:10
Definition VertexBuffer.hpp:130
Definition VulkanCommandBuffer.hpp:7
Definition RenderPass.hpp:18
Definition RenderPass.hpp:11