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

◆ validate_shader()

void MayaFlux::Buffers::AudioComputeProcessor::validate_shader ( )
private

Definition at line 91 of file AudioComputeProcessor.cpp.

92{
93 if (!is_shader_loaded()) {
94 return;
95 }
96
98
99 const auto block_binding = std::ranges::find_if(
100 reflection.descriptor_bindings,
101 [](const auto& binding) { return binding.set == 0 && binding.binding == 0; });
102
103 if (block_binding == reflection.descriptor_bindings.end()) {
105 "AudioComputeProcessor shader declares no binding at set 0, binding 0 for 'block'");
106 } else if (block_binding->type != vk::DescriptorType::eStorageBuffer) {
108 "AudioComputeProcessor shader binding set 0, binding 0 is not a storage buffer");
109 }
110
111 if (reflection.workgroup_size) {
112 const auto& size = *reflection.workgroup_size;
113 const auto& dispatch = get_dispatch_config();
114 if (size[0] != dispatch.workgroup_x || size[1] != dispatch.workgroup_y || size[2] != dispatch.workgroup_z) {
116 "AudioComputeProcessor shader workgroup {}x{}x{} does not match dispatch workgroup {}x{}x{}",
117 size[0], size[1], size[2], dispatch.workgroup_x, dispatch.workgroup_y, dispatch.workgroup_z);
118 }
119 }
120}
#define MF_ERROR(comp, ctx,...)
const ShaderDispatchConfig & get_dispatch_config() const
Get current dispatch configuration.
Portal::Graphics::ShaderID m_shader_id
bool is_shader_loaded() const
Check if shader is loaded.
ShaderReflectionInfo get_shader_reflection(ShaderID shader_id)
Get reflection info for compiled shader.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains).
@ Buffers
Buffers, Managers, processors and processing chains.
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Buffers::ComputeProcessor::get_dispatch_config(), MayaFlux::Portal::Graphics::get_shader_foundry(), MayaFlux::Portal::Graphics::ShaderFoundry::get_shader_reflection(), MayaFlux::Buffers::ShaderProcessor::is_shader_loaded(), MayaFlux::Buffers::ShaderProcessor::m_shader_id, and MF_ERROR.

Referenced by on_attach().

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