|
virtual | ~ICommandBuffer () noexcept=default |
|
virtual void | begin () const =0 |
| Sets the command buffer into recording state, so that it can receive command that should be submitted to the parent CommandQueue. More...
|
|
virtual void | end () const =0 |
| Ends recording commands on the command buffer. More...
|
|
void | barrier (const IBarrier &barrier, const bool &invert=false) const noexcept |
| Executes the transitions that have been added to barrier . More...
|
|
void | generateMipMaps (IImage &image) noexcept |
| Uses the image at level 0 to generate mip-maps for the remaining levels. More...
|
|
void | transfer (const IBuffer &source, const IBuffer &target, const UInt32 &sourceElement=0, const UInt32 &targetElement=0, const UInt32 &elements=1) const |
| Performs a buffer-to-buffer transfer from source to target . More...
|
|
void | transfer (const IBuffer &source, const IImage &target, const UInt32 &sourceElement=0, const UInt32 &firstSubresource=0, const UInt32 &elements=1) const |
| Performs a buffer-to-image transfer from source to target . More...
|
|
void | transfer (const IImage &source, const IImage &target, const UInt32 &sourceSubresource=0, const UInt32 &targetSubresource=0, const UInt32 &subresources=1) const |
| Performs an image-to-image transfer from source to target . More...
|
|
void | transfer (const IImage &source, const IBuffer &target, const UInt32 &firstSubresource=0, const UInt32 &targetElement=0, const UInt32 &subresources=1) const |
| Performs an image-to-buffer transfer from source to target . More...
|
|
void | use (const IPipeline &pipeline) const noexcept |
| Sets the active pipeline state. More...
|
|
void | bind (const IDescriptorSet &descriptorSet, const IPipeline &pipeline) const noexcept |
| Binds the provided descriptor set to the provided pipeline. More...
|
|
void | bind (const IVertexBuffer &buffer) const noexcept |
| Binds a vertex buffer to the pipeline. More...
|
|
void | bind (const IIndexBuffer &buffer) const noexcept |
| Binds a index buffer to the pipeline. More...
|
|
virtual void | dispatch (const Vector3u &threadCount) const noexcept=0 |
| Executes a compute shader. More...
|
|
virtual void | draw (const UInt32 &vertices, const UInt32 &instances=1, const UInt32 &firstVertex=0, const UInt32 &firstInstance=0) const noexcept=0 |
| Draws a number of vertices from the currently bound vertex buffer. More...
|
|
virtual void | drawIndexed (const UInt32 &indices, const UInt32 &instances=1, const UInt32 &firstIndex=0, const Int32 &vertexOffset=0, const UInt32 &firstInstance=0) const noexcept=0 |
| Draws the currently bound vertex buffer with a set of indices from the currently bound index buffer. More...
|
|
void | pushConstants (const IPushConstantsLayout &layout, const void *const memory) const noexcept |
| Pushes a block of memory into the push constants backing memory. More...
|
|
void | draw (const IVertexBuffer &vertexBuffer, const UInt32 &instances=1, const UInt32 &firstVertex=0, const UInt32 &firstInstance=0) const |
| Draws all vertices from the vertex buffer provided in vertexBuffer . More...
|
|
void | drawIndexed (const IIndexBuffer &indexBuffer, const UInt32 &instances=1, const UInt32 &firstIndex=0, const Int32 &vertexOffset=0, const UInt32 &firstInstance=0) const |
| Draws the currently bound vertex buffer using the index buffer provided in indexBuffer . More...
|
|
void | drawIndexed (const IVertexBuffer &vertexBuffer, const IIndexBuffer &indexBuffer, const UInt32 &instances=1, const UInt32 &firstIndex=0, const Int32 &vertexOffset=0, const UInt32 &firstInstance=0) const |
| Draws the vertex buffer provided by vertexBuffer using the index buffer, provided by indexBuffer . More...
|
|
The interface for a command buffer.
void LiteFX::Rendering::ICommandBuffer::generateMipMaps |
( |
IImage & |
image | ) |
|
|
inlinenoexcept |
Uses the image at level 0 to generate mip-maps for the remaining levels.
It is strongly advised, not to generate mip maps at runtime. Instead, prefer using a format that supports pre-computed mip maps. If you have to, prefer computing mip maps in a pre-process.
Note that not all texture formats and sizes are supported for mip map generation and the result might not be satisfactory. For example, it is not possible to compute proper mip maps for pre-compressed formats. Textures should have power of two sizes in order to not appear under-sampled.
Note that generating mip maps might require the texture to be writable. You can transfer the texture into a non-writable resource afterwards to improve performance.
- Parameters
-
commandBuffer | The command buffer used to issue the transition and transfer operations. |
void LiteFX::Rendering::ICommandBuffer::transfer |
( |
const IBuffer & |
source, |
|
|
const IImage & |
target, |
|
|
const UInt32 & |
sourceElement = 0 , |
|
|
const UInt32 & |
firstSubresource = 0 , |
|
|
const UInt32 & |
elements = 1 |
|
) |
| const |
|
inline |
Performs a buffer-to-image transfer from source to target .
The subresource parameter describes the index of the first sub-resource to copy. Each element gets copied into the subsequent sub-resource, where resources are counted in the following order:
-
Level Contains the mip-map levels.
-
Layer Contains the array slices.
-
Plane Contains planes for multi-planar formats.
E.g., if 6 elements should be copied to an image with 3 mip-map levels and 3 layers, the elements 0-2 contain the mip-map levels of the first layer, while elements 3-5 contain the three mip-map levels of the second layer. The third layer would not receive any data in this example. If the image format has multiple planes, this procedure would be repeated for each plane, however one buffer element only maps to one sub-resource.
- Parameters
-
source | The source buffer to transfer data from. |
target | The target image to transfer data to. |
sourceElement | The index of the first element in the source buffer to copy. |
firstSubresource | The index of the first sub-resource of the target image to receive data. |
elements | The number of elements to copy from the source buffer into the target image sub-resources. |
- Exceptions
-
ArgumentOutOfRangeException | Thrown, if the number of either the source buffer or the target buffer has not enough elements for the specified elements parameter. |
void LiteFX::Rendering::ICommandBuffer::transfer |
( |
const IImage & |
source, |
|
|
const IBuffer & |
target, |
|
|
const UInt32 & |
firstSubresource = 0 , |
|
|
const UInt32 & |
targetElement = 0 , |
|
|
const UInt32 & |
subresources = 1 |
|
) |
| const |
|
inline |
Performs an image-to-buffer transfer from source to target .
The firstSubresource parameter describes the index of the first sub-resource to copy. Each element gets copied into the subsequent sub-resource, where resources are counted in the following order:
-
Level Contains the mip-map levels.
-
Layer Contains the array slices.
-
Plane Contains planes for multi-planar formats.
E.g., if 6 elements should be copied to an image with 3 mip-map levels and 3 layers, the elements 0-2 contain the mip-map levels of the first layer, while elements 3-5 contain the three mip-map levels of the second layer. The third layer would not receive any data in this example. If the image format has multiple planes, this procedure would be repeated for each plane, however one buffer element only maps to one sub-resource.
- Parameters
-
source | The source image to transfer data from. |
target | The target buffer to transfer data to. |
firstSubresource | The index of the first sub-resource to copy from the source image. |
targetElement | The index of the first target element to receive data. |
subresources | The number of sub-resources to copy. |
- Exceptions
-
ArgumentOutOfRangeException | Thrown, if the number of either the source buffer or the target buffer has not enough elements for the specified elements parameter. |