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

◆ push_constants() [2/2]

void MayaFlux::Portal::Graphics::ComputePress::push_constants ( CommandBufferID  cmd_id,
ComputePipelineID  pipeline_id,
const void *  data,
size_t  size,
uint32_t  offset 
)

Push part of the push constant block, starting at a byte offset.

Parameters
offsetByte offset into the block

The range [offset, offset + size) must lie inside the push constant size the pipeline was created with; otherwise nothing is recorded.

Definition at line 318 of file ComputePress.cpp.

324{
325 auto pipeline_it = m_pipelines.find(pipeline_id);
326 if (pipeline_it == m_pipelines.end()) {
328 "Invalid pipeline ID: {}", pipeline_id);
329 return;
330 }
331
332 if (static_cast<size_t>(offset) + size > pipeline_it->second.push_constant_size) {
334 "Push constant range [{}, {}) exceeds the {} bytes declared for pipeline {}",
335 offset, static_cast<size_t>(offset) + size,
336 pipeline_it->second.push_constant_size, pipeline_id);
337 return;
338 }
339
341 if (!cmd) {
343 "Invalid command buffer ID: {}", cmd_id);
344 return;
345 }
346
347 pipeline_it->second.pipeline->push_constants(
348 cmd,
349 vk::ShaderStageFlagBits::eCompute,
350 offset,
351 static_cast<uint32_t>(size),
352 data);
353}
#define MF_ERROR(comp, ctx,...)
vk::CommandBuffer cmd
uint64_t offset
Definition Composite.cpp:10
bool size
std::unordered_map< ComputePipelineID, PipelineState > m_pipelines
vk::CommandBuffer get_command_buffer(CommandBufferID cmd_id)
Get Vulkan command buffer handle from CommandBufferID.
@ GPUCompute
GPU compute operations (shaders, GPGPU tasks)
@ Portal
High-level user-facing API layer.

References cmd, MayaFlux::Portal::Graphics::ShaderFoundry::get_command_buffer(), MayaFlux::Journal::GPUCompute, m_pipelines, m_shader_foundry, MF_ERROR, offset, MayaFlux::Journal::Portal, and size.

+ Here is the call graph for this function: