From a5e20cc8554de8564307028e9bec9ebba9f741c4 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 22 Oct 2023 22:26:52 -0700 Subject: [PATCH] BuildGLSLSourceString: throw exception in case of HLSL to GLSL conversion failure --- Graphics/ShaderTools/src/GLSLUtils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Graphics/ShaderTools/src/GLSLUtils.cpp b/Graphics/ShaderTools/src/GLSLUtils.cpp index 623cfe98d..d6fbca0cb 100644 --- a/Graphics/ShaderTools/src/GLSLUtils.cpp +++ b/Graphics/ShaderTools/src/GLSLUtils.cpp @@ -318,7 +318,10 @@ String BuildGLSLSourceString(const ShaderCreateInfo& ShaderCI, // (search for "Input Layout Qualifiers" and "Output Layout Qualifiers"). Attribs.UseInOutLocationQualifiers = DeviceInfo.Features.SeparablePrograms; auto ConvertedSource = Converter.Convert(Attribs); - + if (ConvertedSource.empty()) + { + LOG_ERROR_AND_THROW("Failed to convert HLSL source to GLSL"); + } GLSLSource.append(ConvertedSource); #endif }