|
Hymn to Beauty
C++ 3D Engine
|
Vulkan implementation of CommandBuffer. More...
#include <VulkanCommandBuffer.hpp>
Classes | |
| struct | Timing |
| Timing for a block of work. More... | |
Public Member Functions | |
| VulkanCommandBuffer (VulkanRenderer *vulkanRenderer, VkDevice device, VkCommandPool commandPool, VulkanRenderPassAllocator &renderPassAllocator) | |
| Create new Vulkan command buffer. More... | |
| ~VulkanCommandBuffer () final | |
| Destructor. More... | |
| void | BeginRenderPass (RenderPass *renderPass, const std::string &name) final |
| Begin render pass. More... | |
| void | BeginRenderPass (Texture *colorAttachment, RenderPass::LoadOperation colorLoadOperation, Texture *depthAttachment, RenderPass::LoadOperation depthLoadOperation, const std::string &name) final |
| Begin render pass. More... | |
| void | BeginAttachmentlessRenderPass (const glm::uvec2 &size, uint32_t msaaSamples, const std::string &name) final |
| Begin attachmentless render pass. More... | |
| void | EndRenderPass () final |
| End render pass. More... | |
| void | BindGraphicsPipeline (GraphicsPipeline *graphicsPipeline) final |
| Bind graphics pipeline. More... | |
| void | SetViewport (const glm::uvec2 &origin, const glm::uvec2 &size) final |
| Set the viewport to render to. More... | |
| void | SetScissor (const glm::uvec2 &origin, const glm::uvec2 &size) final |
| Set the scissor box. More... | |
| void | SetLineWidth (float width) final |
| Set width of lines. More... | |
| void | BindGeometry (GeometryBinding *geometryBinding) final |
| Bind geometry to be used in upcoming draw calls. More... | |
| void | BindUniformBuffer (ShaderProgram::BindingType bindingType, Buffer *uniformBuffer) final |
| Bind uniform buffer for use in a shader. More... | |
| void | BindStorageBuffers (std::initializer_list< Buffer * > buffers) final |
| Bind storage buffers. More... | |
| void | BindMaterial (std::initializer_list< std::pair< Texture *, const Sampler * > > textures) final |
| Bind a material. More... | |
| void | PushConstants (const void *data) final |
| Update push constants. More... | |
| void | Draw (unsigned int vertexCount, unsigned int firstVertex) final |
| Draw geometry. More... | |
| void | DrawIndexed (unsigned int indexCount, unsigned int firstIndex, unsigned int baseVertex) final |
| Draw indexed geometry. More... | |
| void | DrawIndexedInstanced (unsigned int indexCount, unsigned int instanceCount, unsigned int firstIndex, unsigned int baseVertex) final |
| Draw indexed instanced geometry. More... | |
| void | BlitToSwapChain (Texture *texture) final |
| Blit a texture to the current swap chain image. More... | |
| void | BindComputePipeline (ComputePipeline *computePipeline) final |
| Bind compute pipeline. More... | |
| void | Dispatch (const glm::uvec3 &numGroups, const std::string &name) final |
| Dispatch compute shader. More... | |
| void | ClearBuffer (Buffer *buffer) final |
| Clear a buffer (fill with 0). More... | |
| VkCommandBuffer | GetCommandBuffer () const |
| Get command buffer. More... | |
| void | End () |
| Finish recording the command buffer. More... | |
| void | NextFrame () |
| Cycle the command buffer for the next frame. More... | |
| bool | ContainsBlitToSwapChain () const |
| Get whether the command buffer contains a blit to the swap chain. More... | |
| const std::vector< Timing > & | GetTimings () const |
| Get the all timings in the command buffer. More... | |
Public Member Functions inherited from Video::CommandBuffer | |
| CommandBuffer () | |
| Create a new command buffer. More... | |
| virtual | ~CommandBuffer () |
| Destructor. More... | |
| void | SetViewportAndScissor (const glm::uvec2 &origin, const glm::uvec2 &size) |
| Set both viewport and scissor. More... | |
Vulkan implementation of CommandBuffer.
| Video::VulkanCommandBuffer::VulkanCommandBuffer | ( | VulkanRenderer * | vulkanRenderer, |
| VkDevice | device, | ||
| VkCommandPool | commandPool, | ||
| VulkanRenderPassAllocator & | renderPassAllocator | ||
| ) |
Create new Vulkan command buffer.
| vulkanRenderer | The Vulkan renderer. |
| device | The Vulkan device. |
| commandPool | The command pool to allocate the command buffer from. |
| renderPassAllocator | The render pass allocator. |
|
final |
Destructor.
|
finalvirtual |
Begin attachmentless render pass.
| size | The framebuffer size. |
| msaaSamples | Number of MSAA samples. |
| name | The name of the render pass (displayed in profiling). |
Implements Video::CommandBuffer.
|
finalvirtual |
Begin render pass.
| renderPass | The render pass to begin. |
| name | The name of the render pass (displayed in profiling). |
Implements Video::CommandBuffer.
|
finalvirtual |
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). |
Implements Video::CommandBuffer.
|
finalvirtual |
Bind compute pipeline.
| computePipeline | The compute pipeline to bind. |
Implements Video::CommandBuffer.
|
finalvirtual |
Bind geometry to be used in upcoming draw calls.
| geometryBinding | The geometry to bind. |
Implements Video::CommandBuffer.
|
finalvirtual |
Bind graphics pipeline.
| graphicsPipeline | The graphics pipeline to bind. |
Implements Video::CommandBuffer.
|
finalvirtual |
Bind a material.
| textures | The textures to bind to the graphics pipeline. |
Implements Video::CommandBuffer.
|
finalvirtual |
|
finalvirtual |
Bind uniform buffer for use in a shader.
| bindingType | Where to bind the buffer. |
| uniformBuffer | The buffer to bind. |
Implements Video::CommandBuffer.
|
finalvirtual |
Blit a texture to the current swap chain image.
| texture | The texture to copy to the swap chain. |
Implements Video::CommandBuffer.
|
finalvirtual |
Clear a buffer (fill with 0).
| buffer | The buffer to clear. |
Implements Video::CommandBuffer.
| bool Video::VulkanCommandBuffer::ContainsBlitToSwapChain | ( | ) | const |
Get whether the command buffer contains a blit to the swap chain.
|
finalvirtual |
Dispatch compute shader.
| numGroups | The number of groups in each dimension. |
| name | The name of the dispatch (displayed in profiling). |
Implements Video::CommandBuffer.
|
finalvirtual |
Draw geometry.
| vertexCount | The number of vertices to render. |
| firstVertex | The vertex to start rendering at. |
Implements Video::CommandBuffer.
|
finalvirtual |
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. |
Implements Video::CommandBuffer.
|
finalvirtual |
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. |
Implements Video::CommandBuffer.
| void Video::VulkanCommandBuffer::End | ( | ) |
Finish recording the command buffer.
|
finalvirtual |
End render pass.
Implements Video::CommandBuffer.
| VkCommandBuffer Video::VulkanCommandBuffer::GetCommandBuffer | ( | ) | const |
Get command buffer.
| const std::vector< VulkanCommandBuffer::Timing > & Video::VulkanCommandBuffer::GetTimings | ( | ) | const |
Get the all timings in the command buffer.
| void Video::VulkanCommandBuffer::NextFrame | ( | ) |
Cycle the command buffer for the next frame.
|
finalvirtual |
Update push constants.
| data | The data to push to the shader. |
Implements Video::CommandBuffer.
|
finalvirtual |
Set width of lines.
| width | The line width. |
Implements Video::CommandBuffer.
|
finalvirtual |
Set the scissor box.
| origin | The bottom-left corner of the scissor box. |
| size | The size of the scissor box. |
Implements Video::CommandBuffer.
|
finalvirtual |
Set the viewport to render to.
| origin | The bottom-left corner of the viewport. |
| size | The size of the viewport. |
Implements Video::CommandBuffer.