From 0363a4d18c655697cfb0d958add2c7bf4b156874 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 11 Jul 2023 03:05:15 +0800 Subject: Do not fail when emitting GLSL using unorm/snorm textures (#2973) * Do not fail when emitting GLSL using unorm/snorm textures Ignored in glslang https://github.com/KhronosGroup/glslang/blob/main/glslang/HLSL/hlslGrammar.cpp\#L1476 * Add test for unorm modifier on glsl --- source/slang/slang-emit-glsl.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/slang-emit-glsl.cpp') diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp index 64afb7ff1..853ef69ae 100644 --- a/source/slang/slang-emit-glsl.cpp +++ b/source/slang/slang-emit-glsl.cpp @@ -4,6 +4,7 @@ #include "../core/slang-writer.h" #include "slang-emit-source-writer.h" +#include "slang-ir-util.h" #include "slang-mangled-lexer.h" #include "slang-legalize-types.h" @@ -691,6 +692,8 @@ void GLSLSourceEmitter::_emitGLSLTextureOrTextureSamplerType(IRTextureTypeBase* void GLSLSourceEmitter::_emitGLSLTypePrefix(IRType* type, bool promoteHalfToFloat) { + type = dropNormAttributes(type); + switch (type->getOp()) { case kIROp_FloatType: -- cgit v1.2.3