|
Hymn to Beauty
C++ 3D Engine
|
A buffer into which rendering commands are recorded. More...
#include <CommandBuffer.hpp>
Public Member Functions | |
| CommandBuffer () | |
| Create a new command buffer. More... | |
| virtual | ~CommandBuffer () |
| Destructor. More... | |
| virtual void | BeginRenderPass (RenderPass *renderPass, const std::string &name="Untitled render pass")=0 |
| Begin render pass. More... | |
| virtual void | BeginRenderPass (Texture *colorAttachment, RenderPass::LoadOperation colorLoadOperation=RenderPass::LoadOperation::CLEAR, Texture *depthAttachment=nullptr, RenderPass::LoadOperation depthLoadOperation=RenderPass::LoadOperation::CLEAR, const std::string &name="Untitled render pass")=0 |
| Begin render pass. More... | |
| virtual void | BeginAttachmentlessRenderPass (const glm::uvec2 &size, uint32_t msaaSamples=1, const std::string &name="Untitled render pass")=0 |
| Begin attachmentless render pass. More... | |
| virtual void | EndRenderPass ()=0 |
| End render pass. More... | |
| virtual void | BindGraphicsPipeline (GraphicsPipeline *graphicsPipeline)=0 |
| Bind graphics pipeline. More... | |
| virtual void | SetViewport (const glm::uvec2 &origin, const glm::uvec2 &size)=0 |
| Set the viewport to render to. More... | |
| virtual void | SetScissor (const glm::uvec2 &origin, const glm::uvec2 &size)=0 |
| Set the scissor box. More... | |
| void | SetViewportAndScissor (const glm::uvec2 &origin, const glm::uvec2 &size) |
| Set both viewport and scissor. More... | |
| virtual void | SetLineWidth (float width)=0 |
| Set width of lines. More... | |
| virtual void | BindGeometry (GeometryBinding *geometryBinding)=0 |
| Bind geometry to be used in upcoming draw calls. More... | |
| virtual void | BindUniformBuffer (ShaderProgram::BindingType bindingType, Buffer *uniformBuffer)=0 |
| Bind uniform buffer for use in a shader. More... | |
| virtual void | BindStorageBuffers (std::initializer_list< Buffer * > buffers)=0 |
| Bind storage buffers. More... | |
| virtual void | BindMaterial (std::initializer_list< std::pair< Texture *, const Sampler * > > textures)=0 |
| Bind a material. More... | |
| virtual void | PushConstants (const void *data)=0 |
| Update push constants. More... | |
| virtual void | Draw (unsigned int vertexCount, unsigned int firstVertex=0)=0 |
| Draw geometry. More... | |
| virtual void | DrawIndexed (unsigned int indexCount, unsigned int firstIndex=0, unsigned int baseVertex=0)=0 |
| Draw indexed geometry. More... | |
| virtual void | DrawIndexedInstanced (unsigned int indexCount, unsigned int instanceCount=1, unsigned int firstIndex=0, unsigned int baseVertex=0)=0 |
| Draw indexed instanced geometry. More... | |
| virtual void | BlitToSwapChain (Texture *texture)=0 |
| Blit a texture to the current swap chain image. More... | |
| virtual void | BindComputePipeline (ComputePipeline *computePipeline)=0 |
| Bind compute pipeline. More... | |
| virtual void | Dispatch (const glm::uvec3 &numGroups, const std::string &name="Untitled dispatch")=0 |
| Dispatch compute shader. More... | |
| virtual void | ClearBuffer (Buffer *buffer)=0 |
| Clear a buffer (fill with 0). More... | |
A buffer into which rendering commands are recorded.
Command buffers have to be recorded in the same order as they are submitted.
|
inline |
Create a new command buffer.
|
inlinevirtual |
Destructor.
|
pure virtual |
Begin attachmentless render pass.
| size | The framebuffer size. |
| msaaSamples | Number of MSAA samples. |
| name | The name of the render pass (displayed in profiling). |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Begin render pass.
| renderPass | The render pass to begin. |
| name | The name of the render pass (displayed in profiling). |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Begin render pass.
| colorAttachment | The color attachment to draw to. |
| colorLoadOperation | What to do with the previous contents of the color attachment. |
| depthAttachment | The depth attachment to draw to. |
| depthLoadOperation | What to do with the previous contents of the depth attachment. |
| name | The name of the render pass (displayed in profiling). |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Bind compute pipeline.
| computePipeline | The compute pipeline to bind. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Bind geometry to be used in upcoming draw calls.
| geometryBinding | The geometry to bind. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Bind graphics pipeline.
| graphicsPipeline | The graphics pipeline to bind. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Bind a material.
| textures | The textures to bind to the graphics pipeline. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Bind storage buffers.
| buffers | The buffers to bind. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Bind uniform buffer for use in a shader.
| bindingType | Where to bind the buffer. |
| uniformBuffer | The buffer to bind. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Blit a texture to the current swap chain image.
| texture | The texture to copy to the swap chain. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Clear a buffer (fill with 0).
| buffer | The buffer to clear. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Dispatch compute shader.
| numGroups | The number of groups in each dimension. |
| name | The name of the dispatch (displayed in profiling). |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Draw geometry.
| vertexCount | The number of vertices to render. |
| firstVertex | The vertex to start rendering at. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Draw indexed geometry.
| indexCount | The number of indices to render. |
| firstIndex | The index to start rendering at. |
| baseVertex | Constant that should be added to each value in the index buffer. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Draw indexed instanced geometry.
| indexCount | The number of indices to render. |
| instanceCount | The number of instances to render. |
| firstIndex | The index to start rendering at. |
| baseVertex | Constant that should be added to each value in the index buffer. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
End render pass.
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Update push constants.
| data | The data to push to the shader. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Set width of lines.
| width | The line width. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Set the scissor box.
| origin | The bottom-left corner of the scissor box. |
| size | The size of the scissor box. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
pure virtual |
Set the viewport to render to.
| origin | The bottom-left corner of the viewport. |
| size | The size of the viewport. |
Implemented in Video::OpenGLCommandBuffer, Video::VulkanCommandBuffer, and Video::WebGPUCommandBuffer.
|
inline |
Set both viewport and scissor.
| origin | The bottom-left corner of the viewport/scissor box. |
| size | The size of the viewport/scissor box. |