|
Blender V5.3
|
#include <vk_push_constants.hh>
Classes | |
| struct | Layout |
Public Types | |
| enum class | StorageType { NONE , PUSH_CONSTANTS , BUFFER } |
Public Member Functions | |
| VKPushConstants () | |
| VKPushConstants (const Layout *layout) | |
| VKPushConstants (VKPushConstants &&other) | |
| virtual | ~VKPushConstants () |
| VKPushConstants & | operator= (VKPushConstants &&other) |
| size_t | offset () const |
| const Layout & | layout_get () const |
| const void * | data () const |
| template<typename T> | |
| void | push_constant_set (int32_t location, int32_t comp_len, int32_t array_size, const T *input_data) |
| VKBufferWithOffset | update_uniform_buffer (VKContext &context) |
Friends | |
| class | VKContext |
Container to store push constants in a buffer.
Can handle buffers with different memory layouts (std140/std430) Which memory layout is used is based on the storage type.
VKPushConstantsLayout only describes the buffer, an instance of this class can handle setting/modifying/duplicating push constants.
It should also keep track of the submissions in order to reuse the allocated data.
Definition at line 47 of file vk_push_constants.hh.
|
strong |
Different methods to store push constants.
| Enumerator | |
|---|---|
| NONE | Push constants aren't in use. |
| PUSH_CONSTANTS | Store push constants as regular vulkan push constants. |
| BUFFER | Fallback when push constants doesn't meet the device requirements. |
Definition at line 52 of file vk_push_constants.hh.
|
default |
References operator=(), and VKPushConstants().
Referenced by blender::gpu::VKShader::finalize(), operator=(), VKPushConstants(), and VKPushConstants().
| blender::gpu::VKPushConstants::VKPushConstants | ( | const Layout * | layout | ) |
Definition at line 120 of file vk_push_constants.cc.
References blender::G, blender::G_DEBUG_GPU, blender::MEM_new_uninitialized(), and blender::gpu::VKPushConstants::Layout::size_in_bytes().
| blender::gpu::VKPushConstants::VKPushConstants | ( | VKPushConstants && | other | ) |
Definition at line 128 of file vk_push_constants.cc.
References VKPushConstants().
|
virtual |
Definition at line 134 of file vk_push_constants.cc.
References blender::MEM_delete_void().
|
inline |
Get the reference to the active data.
Data can get inactive when push constants are modified, after being added to the command queue. We still keep track of the old data for reuse and make sure we don't overwrite data that is still not on the GPU.
Definition at line 185 of file vk_push_constants.hh.
|
inline |
Definition at line 173 of file vk_push_constants.hh.
|
inline |
Definition at line 168 of file vk_push_constants.hh.
| VKPushConstants & blender::gpu::VKPushConstants::operator= | ( | VKPushConstants && | other | ) |
Definition at line 142 of file vk_push_constants.cc.
References VKPushConstants().
Referenced by VKPushConstants().
|
inline |
Modify a push constant.
location: ShaderInput.location of the push constant to update. comp_len: number of components has the data type that is being updated. array_size: number of elements when an array to update. (0=no array) input_data: packed source data to use.
Definition at line 199 of file vk_push_constants.hh.
References blender::gpu::VKPushConstants::Layout::PushConstant::array_size, blender::BLI_assert(), BLI_assert_msg, blender::IndexRange::IndexRange(), blender::gpu::VKPushConstants::Layout::PushConstant::inner_row_padding, blender::max_ii(), blender::gpu::VKPushConstants::Layout::PushConstant::offset, PUSH_CONSTANTS, T, and UNUSED_VARS.
Referenced by blender::gpu::VKShader::uniform_float(), and blender::gpu::VKShader::uniform_int().
| VKBufferWithOffset blender::gpu::VKPushConstants::update_uniform_buffer | ( | VKContext & | context | ) |
When storage type = StorageType::BUFFER use this method to update the buffer.
It must be called just before adding a draw/compute command to the command queue.
Definition at line 152 of file vk_push_constants.cc.
References blender::BLI_assert(), BUFFER, blender::result, and VKContext.
|
friend |
Definition at line 48 of file vk_push_constants.hh.
References VKContext.
Referenced by update_uniform_buffer(), and VKContext.