MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ set_push_constants() [2/2]

void MayaFlux::Buffers::TextureArrayBuffer::set_push_constants ( const void *  data,
size_t  size 
)

Replace the default push constants with the shader's own.

After this call the layer count, mode and weights are no longer sent. The data is resent unchanged every frame until it is replaced.

Parameters
dataBytes of the push constant block.
sizeSize of the block in bytes.

Definition at line 282 of file TextureArrayBuffer.cpp.

283{
284 if (!data || size == 0) {
285 m_custom_push.clear();
286 } else {
287 const auto* bytes = static_cast<const uint8_t*>(data);
288 m_custom_push.assign(bytes, bytes + size);
289 }
290
291 if (const auto processor = get_render_processor()) {
292 processor->set_push_constant_size(m_custom_push.empty() ? sizeof(Push) : m_custom_push.size());
293 }
294 flush_push();
295}
bool size
virtual std::shared_ptr< RenderProcessor > get_render_processor() const
Get a RenderProcessor suitable for rendering this buffer.
Definition VKBuffer.hpp:605

References flush_push(), MayaFlux::Buffers::VKBuffer::get_render_processor(), m_custom_push, and size.

+ Here is the call graph for this function: