7#include <initializer_list>
12class VertexDescription;
17class GraphicsPipeline;
71 virtual void SetViewport(
const glm::uvec2& origin,
const glm::uvec2& size) = 0;
78 virtual void SetScissor(
const glm::uvec2& origin,
const glm::uvec2& size) = 0;
119 virtual void BindMaterial(std::initializer_list<std::pair<Texture*, const Sampler*>> textures) = 0;
132 virtual void Draw(
unsigned int vertexCount,
unsigned int firstVertex = 0) = 0;
140 virtual void DrawIndexed(
unsigned int indexCount,
unsigned int firstIndex = 0,
unsigned int baseVertex = 0) = 0;
149 virtual void DrawIndexedInstanced(
unsigned int indexCount,
unsigned int instanceCount = 1,
unsigned int firstIndex = 0,
unsigned int baseVertex = 0) = 0;
168 virtual void Dispatch(
const glm::uvec3& numGroups,
const std::string& name =
"Untitled dispatch") = 0;
A buffer containing GPU accessible data.
Definition: Buffer.hpp:8
A buffer into which rendering commands are recorded.
Definition: CommandBuffer.hpp:24
virtual void EndRenderPass()=0
End render pass.
virtual void DrawIndexed(unsigned int indexCount, unsigned int firstIndex=0, unsigned int baseVertex=0)=0
Draw indexed geometry.
virtual ~CommandBuffer()
Destructor.
Definition: CommandBuffer.hpp:30
virtual void BindComputePipeline(ComputePipeline *computePipeline)=0
Bind compute pipeline.
virtual void BlitToSwapChain(Texture *texture)=0
Blit a texture to the current swap chain image.
virtual void SetScissor(const glm::uvec2 &origin, const glm::uvec2 &size)=0
Set the scissor box.
virtual void BindGeometry(GeometryBinding *geometryBinding)=0
Bind geometry to be used in upcoming draw calls.
virtual void SetLineWidth(float width)=0
Set width of lines.
void SetViewportAndScissor(const glm::uvec2 &origin, const glm::uvec2 &size)
Set both viewport and scissor.
Definition: CommandBuffer.hpp:85
virtual void Draw(unsigned int vertexCount, unsigned int firstVertex=0)=0
Draw geometry.
CommandBuffer()
Create a new command buffer.
Definition: CommandBuffer.hpp:27
virtual void SetViewport(const glm::uvec2 &origin, const glm::uvec2 &size)=0
Set the viewport to render to.
virtual void DrawIndexedInstanced(unsigned int indexCount, unsigned int instanceCount=1, unsigned int firstIndex=0, unsigned int baseVertex=0)=0
Draw indexed instanced geometry.
virtual void PushConstants(const void *data)=0
Update push constants.
virtual void Dispatch(const glm::uvec3 &numGroups, const std::string &name="Untitled dispatch")=0
Dispatch compute shader.
virtual void BindUniformBuffer(ShaderProgram::BindingType bindingType, Buffer *uniformBuffer)=0
Bind uniform buffer for use in a shader.
virtual void ClearBuffer(Buffer *buffer)=0
Clear a buffer (fill with 0).
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.
virtual void BindGraphicsPipeline(GraphicsPipeline *graphicsPipeline)=0
Bind graphics pipeline.
virtual void BeginAttachmentlessRenderPass(const glm::uvec2 &size, uint32_t msaaSamples=1, const std::string &name="Untitled render pass")=0
Begin attachmentless render pass.
virtual void BindStorageBuffers(std::initializer_list< Buffer * > buffers)=0
Bind storage buffers.
virtual void BeginRenderPass(RenderPass *renderPass, const std::string &name="Untitled render pass")=0
Begin render pass.
virtual void BindMaterial(std::initializer_list< std::pair< Texture *, const Sampler * > > textures)=0
Bind a material.
A compute pipeline.
Definition: ComputePipeline.hpp:11
Binds together a vertex description with buffers.
Definition: GeometryBinding.hpp:8
A graphics pipeline.
Definition: GraphicsPipeline.hpp:11
A render pass.
Definition: RenderPass.hpp:11
LoadOperation
What to do with an image being rendered to before rendering to it.
Definition: RenderPass.hpp:14
@ CLEAR
Clear the image contents.
BindingType
A type of bound resource.
Definition: ShaderProgram.hpp:14
A texture.
Definition: Texture.hpp:8
Definition: Editor.hpp:18