|
MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
|
| ShaderID MayaFlux::Portal::Graphics::ShaderFoundry::load_shader | ( | const ShaderSpec & | spec | ) |
Compile and cache a compute shader from a declarative ShaderSpec.
Emits SPIR-V assembly text from the spec via detail::emit_spirv_asm(), assembles it via VKShaderModule::create_from_spirv_asm() using SPIRV-Tools, and caches the result by content hash. No shaderc or GLSL toolchain is involved.
Subsequent calls with a spec that produces identical assembly are cache hits and return the existing ShaderID at no cost.
The emitted shader is always a compute stage. Entry point is "main". Binding 0 at set 0 is never emitted; it is engine-reserved.
| spec | ShaderSpec produced by ShaderSpec::Assemble::build(). |
Definition at line 378 of file ShaderFoundry.cpp.
References MayaFlux::Portal::Graphics::COMPUTE, MayaFlux::Portal::Graphics::detail::emit_glsl_kernel(), MayaFlux::Portal::Graphics::detail::emit_spirv_asm(), generate_source_cache_key(), MayaFlux::Portal::Graphics::INVALID_SHADER, is_initialized(), MayaFlux::Portal::Graphics::ShaderSpec::kernel, m_next_shader_id, m_shader_filepath_cache, m_shaders, MF_DEBUG, MF_ERROR, MF_INFO, MayaFlux::Journal::Portal, and MayaFlux::Journal::ShaderCompilation.
Here is the call graph for this function: