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

◆ ensure_kernel()

bool MayaFlux::Portal::Graphics::PrimitiveMill::ensure_kernel ( )
private

Compiles the kernel and creates its pipeline with a push descriptor set, once.

Definition at line 535 of file PrimitiveMill.cpp.

536{
538 return true;
539 }
540
541 const auto spec = build_mill_spec();
542 m_push_constant_size = spec.push_constant_bytes;
543
544 if (m_push_constant_size != sizeof(MillPC)) {
546 "PrimitiveMill: kernel expects {} push constant bytes but MillPC is {}",
547 m_push_constant_size, sizeof(MillPC));
548 return false;
549 }
550
551 auto& foundry = get_shader_foundry();
552 m_shader = foundry.load_shader(spec);
553 if (m_shader == INVALID_SHADER) {
555 "PrimitiveMill: kernel failed to compile");
556 return false;
557 }
558
559 auto& press = get_compute_press();
560 m_pipeline = press.create_pipeline_auto(m_shader, m_push_constant_size, 0);
563 "PrimitiveMill: pipeline creation failed");
564 return false;
565 }
566
567 return true;
568}
#define MF_ERROR(comp, ctx,...)
const MillSpec & spec() const
The current shaping parameters.
@ Rendering
GPU rendering operations (graphics pipeline, frame rendering).
@ Portal
High-level user-facing API layer.
constexpr ShaderID INVALID_SHADER
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.
constexpr ComputePipelineID INVALID_COMPUTE_PIPELINE
MAYAFLUX_API ComputePress & get_compute_press()
std::shared_ptr< Buffers::TextBuffer > press(std::string_view text, const PressParams &params)
Composite a UTF-8 string into a new TextBuffer.
Definition InkPress.cpp:344

References MayaFlux::Portal::Graphics::get_compute_press(), MayaFlux::Portal::Graphics::get_shader_foundry(), MayaFlux::Portal::Graphics::INVALID_COMPUTE_PIPELINE, MayaFlux::Portal::Graphics::INVALID_SHADER, m_pipeline, m_push_constant_size, m_shader, MF_ERROR, MayaFlux::Journal::Portal, MayaFlux::Journal::Rendering, and spec().

Referenced by mill().

Here is the call graph for this function:
Here is the caller graph for this function: