Lluvia
|
Class for command buffer. More...
#include <CommandBuffer.h>
Public Member Functions | |
CommandBuffer ()=delete | |
CommandBuffer (const CommandBuffer &cmdBuffer)=delete | |
CommandBuffer (CommandBuffer &&cmdBuffer)=delete | |
CommandBuffer (const std::shared_ptr< ll::vulkan::Device > &device) | |
~CommandBuffer () | |
CommandBuffer & | operator= (const CommandBuffer &cmdBuffer)=delete |
CommandBuffer & | operator= (CommandBuffer &&cmdBuffer)=delete |
const vk::CommandBuffer & | getVkCommandBuffer () const noexcept |
void | begin () |
begins recording. More... | |
void | end () |
ends recording. More... | |
void | run (const ll::ComputeNode &node) |
Records running a ll::ComputeNode. More... | |
void | run (const ll::ContainerNode &node) |
Records running a ll::ContainerNode. More... | |
void | copyBuffer (const ll::Buffer &src, const ll::Buffer &dst) |
Copies src buffer into dst . More... | |
void | copyBufferToImage (const ll::Buffer &src, const ll::Image &dst) |
Copies the content of src buffer into dst image. More... | |
void | copyImageToBuffer (const ll::Image &src, const ll::Buffer &dst) |
Copies the content of src image into dst buffer. More... | |
void | copyImageToImage (const ll::Image &src, const ll::Image &dst) |
Copies the content of src image into dst image. More... | |
void | changeImageLayout (ll::Image &image, const ll::ImageLayout newLayout) |
Change image layout. More... | |
void | changeImageLayout (ll::ImageView &imageView, const ll::ImageLayout newLayout) |
Change imageView underlying image layout. More... | |
void | memoryBarrier () |
Adds a memory barrier. More... | |
void | clearImage (ll::Image &image) |
Clears the pixels of an image to zero. More... | |
void | clearImage (ll::ImageView &imageVide) |
Clears the pixels of an image to zero. More... | |
void | durationStart (ll::Duration &duration) |
Starts recording the elapsed time between two points. More... | |
void | durationEnd (ll::Duration &duration) |
Stops recording the elapsed time between two points. More... | |
Class for command buffer.
A command buffer object records operations to be submitted to the Vulkan device. Such operations include running a ll::ComputeNode, copying ll::Buffer objects, changing layout of ll::Image objects or creating memory barriers.
ll::CommandBuffers are created through ll::Session objects.
|
delete |
|
delete |
|
delete |
ll::CommandBuffer::CommandBuffer | ( | const std::shared_ptr< ll::vulkan::Device > & | device | ) |
ll::CommandBuffer::~CommandBuffer | ( | ) |
void ll::CommandBuffer::begin | ( | ) |
begins recording.
This method should be called before any record operation. Otherwise the behaviour is undefined.
void ll::CommandBuffer::changeImageLayout | ( | ll::Image & | image, |
const ll::ImageLayout | newLayout | ||
) |
Change image
layout.
The actual change in image layout is performed when this command buffer is submitted to execution. However, calling image.getLayout()
right after this call will return the new layout value.
This is necessary to keep track of the current image layout of image
parameter after this call.
image | The image | |
[in] | newLayout | The new layout |
void ll::CommandBuffer::changeImageLayout | ( | ll::ImageView & | imageView, |
const ll::ImageLayout | newLayout | ||
) |
Change imageView
underlying image layout.
The actual change in image layout is performed when this command buffer is submitted to execution. However, calling imageView.getImage()->getLayout()
right after this call will return the new layout value.
This is necessary to keep track of the current image layout of image
parameter after this call.
imageView | The image view. | |
[in] | newLayout | The new layout |
void ll::CommandBuffer::clearImage | ( | ll::Image & | image | ) |
Clears the pixels of an image to zero.
void ll::CommandBuffer::clearImage | ( | ll::ImageView & | imageVide | ) |
Clears the pixels of an image to zero.
void ll::CommandBuffer::copyBuffer | ( | const ll::Buffer & | src, |
const ll::Buffer & | dst | ||
) |
Copies src
buffer into dst
.
The parameters must satisfy dst.getSize() >= src.getSize()
.
[in] | src | The source buffer. |
[in] | dst | The destination buffer. |
std::system_erro | with error code ll::ErrorCode::BufferCopyError if dst.getSize() < src.getSize() . |
void ll::CommandBuffer::copyBufferToImage | ( | const ll::Buffer & | src, |
const ll::Image & | dst | ||
) |
Copies the content of src
buffer into dst
image.
TODO:** assert image size.
[in] | src | The source |
[in] | dst | The destination |
void ll::CommandBuffer::copyImageToBuffer | ( | const ll::Image & | src, |
const ll::Buffer & | dst | ||
) |
Copies the content of src
image into dst
buffer.
TODO:* assert buffer size.
[in] | src | The source |
[in] | dst | The destination |
Copies the content of src
image into dst
image.
[in] | src | The source |
[in] | dst | The destination |
void ll::CommandBuffer::durationEnd | ( | ll::Duration & | duration | ) |
Stops recording the elapsed time between two points.
duration | The duration object. |
void ll::CommandBuffer::durationStart | ( | ll::Duration & | duration | ) |
Starts recording the elapsed time between two points.
duration | The duration object. |
void ll::CommandBuffer::end | ( | ) |
ends recording.
Any following call to recording methods after this call have undefined behavior.
|
noexcept |
void ll::CommandBuffer::memoryBarrier | ( | ) |
Adds a memory barrier.
TODO:* details.
|
delete |
|
delete |
void ll::CommandBuffer::run | ( | const ll::ComputeNode & | node | ) |
Records running a ll::ComputeNode.
[in] | node | The node |
void ll::CommandBuffer::run | ( | const ll::ContainerNode & | node | ) |
Records running a ll::ContainerNode.
[in] | node | The node |