9 #ifndef TALVOS_COMMANDS_H
10 #define TALVOS_COMMANDS_H
15 #include "vulkan/vulkan_core.h"
24 class ComputePipeline;
25 class GraphicsPipeline;
28 class RenderPassInstance;
88 std::shared_ptr<RenderPassInstance>
RPI;
99 Regions(Regions), Filter(Filter)
129 ClearRects(ClearRects)
153 const std::vector<VkImageSubresourceRange> &
Ranges)
170 std::vector<VkImageSubresourceRange>
Ranges;
179 const std::vector<VkBufferCopy> &
Regions)
205 const std::vector<VkBufferImageCopy> &
Regions)
231 const std::vector<VkImageCopy> &
Regions)
257 const std::vector<VkBufferImageCopy> &
Regions)
287 :
Command(
DISPATCH), PC(PC), BaseGroup(BaseGroup), NumGroups(NumGroups)
323 const std::shared_ptr<RenderPassInstance>
RPI,
326 :
Command(Ty), PC(PC), RPI(RPI), NumVertices(NumVertices),
327 VertexOffset(VertexOffset), NumInstances(NumInstances),
328 InstanceOffset(InstanceOffset)
362 std::shared_ptr<RenderPassInstance>
RPI;
383 const std::shared_ptr<RenderPassInstance>
RPI,
410 const std::shared_ptr<RenderPassInstance>
RPI,
416 NumInstances, InstanceOffset),
417 IndexOffset(IndexOffset), IndexBaseAddress(IndexBaseAddress),
418 IndexType(IndexType){};
454 std::shared_ptr<RenderPassInstance>
RPI;
496 std::shared_ptr<RenderPassInstance>
RPI;
void run(Device &Dev) const
Run this command on Dev.
virtual void runImpl(Device &Dev) const override
Command execution handler.
Dim3 BaseGroup
The base workgroup offset.
std::vector< VkClearAttachment > ClearAttachments
The attachments to clear.
std::shared_ptr< RenderPassInstance > RPI
The render pass instance.
This class encapsulates information about a copy buffer to image command.
uint8_t * Data
The data to update the buffer with.
const Image & SrcImage
The source image.
const Image & SrcImage
The source image.
This class encapsulates information about a begin render pass command.
This class represents an image object.
uint64_t DstAddr
The memory address of the destination buffer.
void setRenderPassInstance(const std::shared_ptr< RenderPassInstance > RPI)
Set the render pass instance used by this command.
virtual void runImpl(Device &Dev) const override
Command execution handler.
std::shared_ptr< RenderPassInstance > RPI
The render pass instance.
uint64_t NumBytes
The number of bytes to fill.
This class encapsulates information about an indexed draw command.
SetEventCommand(volatile bool *Event)
Create a new SetEventCommand.
This class encapsulates information about a copy buffer command.
BeginRenderPassCommand(std::shared_ptr< RenderPassInstance > RPI)
Create a new BeginRenderPassCommand for a RenderPassInstance.
Type getType() const
Returns the type of this command.
This class encapsulates information about an update buffer command.
NextSubpassCommand(std::shared_ptr< RenderPassInstance > RPI)
Create a new NextSubpassCommand for a RenderPassInstance.
const RenderPassInstance & RPI
The render pass instance this command is operating inside.
virtual void runImpl(Device &Dev) const override
Command execution handler.
virtual void runImpl(Device &Dev) const override
Command execution handler.
This class encapsulates information about a next subpass command.
virtual void runImpl(Device &Dev) const override
Command execution handler.
uint32_t VertexOffset
Offset of first vertex.
DrawIndexedCommand(const PipelineContext &PC, const std::shared_ptr< RenderPassInstance > RPI, uint32_t NumVertices, uint32_t IndexOffset, uint32_t VertexOffset, uint32_t NumInstances, uint32_t InstanceOffset, uint64_t IndexBaseAddress, VkIndexType IndexType)
Create a new DrawIndexedCommand.
std::vector< VkImageBlit > Regions
The regions to copy.
std::vector< VkBufferCopy > Regions
The regions to copy.
EndRenderPassCommand(std::shared_ptr< RenderPassInstance > RPI)
Create a new EndRenderPassCommand for a RenderPassInstance.
virtual void runImpl(Device &Dev) const override
Command execution handler.
uint32_t getIndexOffset() const
Returns the offset of the first index.
WaitEventsCommand(std::vector< volatile bool * > Events)
Create a new WaitEventsCommand.
This class encapsulates information about a compute kernel launch.
VkFilter Filter
The filter to use when scaling.
std::vector< VkBufferImageCopy > Regions
The regions to copy.
std::vector< VkBufferImageCopy > Regions
The regions to copy.
uint32_t Data
The data to fill the buffer with.
uint64_t getIndexBaseAddress() const
Returns the address in memory of the indices.
std::vector< VkClearRect > ClearRects
The regions to clear.
const RenderPassInstance & getRenderPassInstance() const
Returns the render pass instance used by this command.
std::vector< volatile bool * > Events
The events to wait for.
uint64_t Base
The memory address to begin updating from.
This class is a base class for all commands.
This class represents an instance of a render pass being used for drawing.
This class encapsulates pipeline state and bound resources.
Dim3 getNumGroups() const
Returns the number of workgroups this command launches.
ResetEventCommand(volatile bool *Event)
Create a new ResetEventCommand.
std::vector< VkImageSubresourceRange > Ranges
The image subranges to clear.
const PipelineContext & getPipelineContext() const
Returns the pipeline context.
virtual void runImpl(Device &Dev) const override
Command execution handler.
FillBufferCommand(uint64_t Base, uint64_t NumBytes, uint32_t Data)
Create a new FillBufferCommand.
const Image & DstImage
The destination image.
DispatchCommand(const PipelineContext &PC, Dim3 BaseGroup, Dim3 NumGroups)
Create a new DispatchCommand.
This class encapsulates information about a fill buffer command.
Class representing a 3-dimensional size or ID.
const Image & DstImage
The image to clear.
uint32_t IndexOffset
Offset of the first index.
This is an abstract base class for draw commands.
uint64_t Base
The memory address to begin filling from.
PipelineContext PC
The pipeline context.
VkIndexType getIndexType() const
Returns the type of the indices.
std::shared_ptr< RenderPassInstance > RPI
The render pass instance.
volatile bool * Event
The flag to reset when this command executes.
const Image & SrcImage
The source image.
const Image & DstImage
The destination image.
uint32_t getInstanceOffset() const
Returns the offset of the first instance.
virtual void runImpl(Device &Dev) const override
Command execution handler.
uint64_t SrcAddr
The memory address of the source buffer.
CopyImageToBufferCommand(const Image &SrcImage, uint64_t DstAddr, const std::vector< VkBufferImageCopy > &Regions)
Create a new CopyImageToBufferCommand.
volatile bool * Event
The flag to set when this command executes.
This file declares the Dim3 class.
This class encapsulates information about a set event command.
CopyBufferToImageCommand(uint64_t SrcAddr, const Image &DstImage, const std::vector< VkBufferImageCopy > &Regions)
Create a new CopyBufferToImageCommand.
uint64_t IndexBaseAddress
Address of the indices.
uint64_t DstAddr
The memory address of the destination buffer.
const PipelineContext & getPipelineContext() const
Returns the pipeline context.
This class encapsulates information about a wait events command.
virtual void runImpl(Device &Dev) const override
Command execution handler.
DrawCommandBase(Type Ty, const PipelineContext &PC, const std::shared_ptr< RenderPassInstance > RPI, uint32_t NumVertices, uint32_t VertexOffset, uint32_t NumInstances, uint32_t InstanceOffset)
Create a new DrawCommandBase.
DrawCommand(const PipelineContext &PC, const std::shared_ptr< RenderPassInstance > RPI, uint32_t NumVertices, uint32_t VertexOffset, uint32_t NumInstances, uint32_t InstanceOffset)
Create a new DrawCommand.
std::vector< VkImageCopy > Regions
The regions to copy.
This class encapsulates information about a blit image command.
VkClearColorValue Color
The clear color to use.
virtual void runImpl(Device &Dev) const =0
Command execution method for subclasses.
A Device instance encapsulates properties and state for the virtual device.
uint64_t NumBytes
The number of bytes to update.
BlitImageCommand(const Image &SrcImage, const Image &DstImage, const std::vector< VkImageBlit > &Regions, VkFilter Filter)
Create a new BlitImageCommand.
This class encapsulates information about a copy image command.
Type Ty
The type of this command.
This class encapsulates information about an end render pass command.
This class encapsulates information about a copy image to buffer command.
virtual void runImpl(Device &Dev) const override
Command execution handler.
ClearColorImageCommand(const Image &DstImage, VkClearColorValue Color, const std::vector< VkImageSubresourceRange > &Ranges)
Create a new ClearColorImageCommand.
This file declares the PipelineContext class and related typedefs.
std::shared_ptr< RenderPassInstance > RPI
The render pass instance.
uint64_t SrcAddr
The memory address of the source buffer.
virtual void runImpl(Device &Dev) const override
Command execution handler.
This class encapsulates information about a clear attachment command.
This class encapsulates information about a reset event command.
virtual void runImpl(Device &Dev) const override=0
Command execution handler.
uint32_t getNumInstances() const
Returns the number of instances.
const Image & DstImage
The destination image.
virtual void runImpl(Device &Dev) const override
Command execution handler.
This class represents a SPIR-V type.
CopyImageCommand(const Image &SrcImage, const Image &DstImage, const std::vector< VkImageCopy > &Regions)
Create a new CopyImageCommand.
Type
Identifies different Command subclasses.
uint32_t InstanceOffset
Offset of first instance.
Command(Type Ty)
Used by subclasses to initialize the command type.
This class encapsulates information about a draw command.
virtual void runImpl(Device &Dev) const override
Command execution handler.
ClearAttachmentCommand(const RenderPassInstance &RPI, const std::vector< VkClearAttachment > &ClearAttachments, const std::vector< VkClearRect > &ClearRects)
Create a new ClearAttachmentCommand.
virtual void runImpl(Device &Dev) const override
Command execution handler.
VkIndexType IndexType
Type of the indices;.
UpdateBufferCommand(uint64_t Base, uint64_t NumBytes, const void *Data)
Create a new UpdateBufferCommand.
uint32_t getNumVertices() const
Returns the number of vertices.
uint32_t NumVertices
Number of vertices.
virtual void runImpl(Device &Dev) const override
Command execution handler.
This class encapsulates information about a clear color image command.
uint32_t NumInstances
Number of instances.
virtual void runImpl(Device &Dev) const override
Command execution handler.
virtual void runImpl(Device &Dev) const override
Command execution handler.
CopyBufferCommand(uint64_t SrcAddr, uint64_t DstAddr, const std::vector< VkBufferCopy > &Regions)
Create a new CopyBufferCommand.
virtual void runImpl(Device &Dev) const override
Command execution handler.
Dim3 getBaseGroup() const
Returns the base workgroup offset used by this command.
PipelineContext PC
The pipeline context.
uint32_t getVertexOffset() const
Returns the offset of the first vertex.
Dim3 NumGroups
The number of workgroups to launch.