diff options
Diffstat (limited to 'src/tests/test_shader_compilation.cc')
| -rw-r--r-- | src/tests/test_shader_compilation.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tests/test_shader_compilation.cc b/src/tests/test_shader_compilation.cc index e2c0adc..a322e8a 100644 --- a/src/tests/test_shader_compilation.cc +++ b/src/tests/test_shader_compilation.cc @@ -115,16 +115,19 @@ static bool test_shader_compilation(const char* name, const char* shader_code) { return true; // Not a failure, just skipped } + // Compose shader to resolve #include directives + std::string composed_shader = ShaderComposer::Get().Compose({}, shader_code); + #if defined(DEMO_CROSS_COMPILE_WIN32) WGPUShaderModuleWGSLDescriptor wgsl_desc = {}; wgsl_desc.chain.sType = WGPUSType_ShaderModuleWGSLDescriptor; - wgsl_desc.code = shader_code; + wgsl_desc.code = composed_shader.c_str(); WGPUShaderModuleDescriptor shader_desc = {}; shader_desc.nextInChain = (const WGPUChainedStruct*)&wgsl_desc.chain; #else WGPUShaderSourceWGSL wgsl_desc = {}; wgsl_desc.chain.sType = WGPUSType_ShaderSourceWGSL; - wgsl_desc.code = str_view(shader_code); + wgsl_desc.code = str_view(composed_shader.c_str()); WGPUShaderModuleDescriptor shader_desc = {}; shader_desc.nextInChain = (const WGPUChainedStruct*)&wgsl_desc.chain; #endif |
