Merge pull request #53904 from ChristopheClaustre/bugfix_shader_compile_spirv_from_source

This commit is contained in:
Rémi Verschelde 2021-12-02 10:07:35 +01:00 committed by GitHub
commit 1398436ab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,9 +185,13 @@ Ref<RDShaderSPIRV> RenderingDevice::_shader_compile_spirv_from_source(const Ref<
String error;
ShaderStage stage = ShaderStage(i);
Vector<uint8_t> spirv = shader_compile_spirv_from_source(stage, p_source->get_stage_source(stage), p_source->get_language(), &error, p_allow_cache);
bytecode->set_stage_bytecode(stage, spirv);
bytecode->set_stage_compile_error(stage, error);
String source = p_source->get_stage_source(stage);
if (!source.is_empty()) {
Vector<uint8_t> spirv = shader_compile_spirv_from_source(stage, source, p_source->get_language(), &error, p_allow_cache);
bytecode->set_stage_bytecode(stage, spirv);
bytecode->set_stage_compile_error(stage, error);
}
}
return bytecode;
}