SPARK
0.1.0
A general purpose game engine written in C++.
|
Describes the layout of the pipelines push constant ranges. More...
#include <PushConstantsLayout.h>
Public Types | |
using | PushConstantsRange = PushConstantsRangeType |
Public Member Functions | |
const PushConstantsRangeType & | range (ShaderStage stage) const override=0 |
Get the push constants range associated with the shader stage provided. | |
virtual std::vector< const PushConstantsRangeType * > | ranges () const noexcept=0 |
Get all push constants ranges . | |
![]() | |
virtual unsigned int | size () const noexcept=0 |
Get the size (in bytes) of the push constants backing memory. | |
std::vector< const IPushConstantsRange * > | ranges () const noexcept |
Get all push constants ranges . | |
Describes the layout of the pipelines push constant ranges.
PushConstantsRangeType | The type of the push constant ranges (inherits from IPushConstantsRange). |
Push constants are very efficient, yet quite limited ways of passing per-draw data to shaders. They are mapped directly, so no buffer must be created or transitioned in order to use them. Conceptually a push constant is a single piece of memory that gets transferred to a command buffer directly. Each shader stage has a view into this piece of memory, described by an offset and a size. Since the memory is directly dumped in the command buffer, the backing memory can be incrementally updated and there is no need to store an array of buffers, as long as updates happen sequentially from the same thread.
However, there are certain restrictions when using push constants:
Push constants can be updated by calling ICommandBuffer::pushConstants() and are visible to subsequent draw calls immediately, until another update is performed or the command buffer is ended.
|
nodiscardoverridepure virtual |
Get the push constants range associated with the shader stage
provided.
stage
provided.spark::base::ArgumentOutOfRangeException | if no range is mapped to the provided shader stage. |
spark::base::BadArgumentException | if stage contains multiple shader stages. |
Implements spark::render::IPushConstantsLayout.
Implemented in spark::render::vk::VulkanPushConstantsLayout.
|
nodiscardpure virtualnoexcept |
Get all push constants ranges .
Implemented in spark::render::vk::VulkanPushConstantsLayout.