summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-12-02 10:07:35 +0100
committerGitHub <noreply@github.com>2021-12-02 10:07:35 +0100
commit1398436ab882416379e785b993c6c7395e218a34 (patch)
tree514dd8246c6023cc0f1e7ff31a284054e1b919fa
parent49d8925713ef630ba451b5099edf7a1f475d07e5 (diff)
parent038be68649ca60d4a2ffb3c05bdd3cc8ec4841f4 (diff)
Merge pull request #53904 from ChristopheClaustre/bugfix_shader_compile_spirv_from_source
-rw-r--r--servers/rendering/rendering_device.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp
index dcbc5f5c8e..5602bb197b 100644
--- a/servers/rendering/rendering_device.cpp
+++ b/servers/rendering/rendering_device.cpp
@@ -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;
}