From d4032293cebd730be66a4324118a0b4ba88b9fb7 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Fri, 9 Sep 2016 11:43:11 -0600 Subject: [PATCH] HLSL: Report an error if SPIR-V for Vulkan wasn't selected. --- glslang/Include/revision.h | 2 +- glslang/MachineIndependent/ShaderLang.cpp | 5 ++--- hlsl/hlslParseHelper.cpp | 3 +++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index a9c1f10..85fd262 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "Overload400-PrecQual.1474" +#define GLSLANG_REVISION "Overload400-PrecQual.1477" #define GLSLANG_DATE "09-Sep-2016" diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp index 97c3940..c0510c7 100644 --- a/glslang/MachineIndependent/ShaderLang.cpp +++ b/glslang/MachineIndependent/ShaderLang.cpp @@ -695,9 +695,8 @@ bool ProcessDeferred( TParseContextBase* parseContext; if (source == EShSourceHlsl) { parseContext = new HlslParseContext(symbolTable, intermediate, false, version, profile, spvVersion, - compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); - } - else { + compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); + } else { intermediate.setEntryPoint("main"); parseContext = new TParseContext(symbolTable, intermediate, false, version, profile, spvVersion, compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index 282fabd..7c4a83f 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -82,6 +82,9 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int if (language == EShLangGeometry) globalOutputDefaults.layoutStream = 0; + + if (spvVersion.spv == 0 || spvVersion.vulkan == 0) + infoSink.info << "ERROR: HLSL currently only supported when requesting SPIR-V for Vulkan.\n"; } HlslParseContext::~HlslParseContext() -- 2.7.4