From 7c88aff1a9317920eab412d2a11dd8fb3e13783b Mon Sep 17 00:00:00 2001 From: Rex Xu Date: Wed, 11 Apr 2018 16:56:50 +0800 Subject: [PATCH] Specify SPV_AMD_gpu_shader_int16 extension string when frexp() takes 16-bit exp operand --- SPIRV/GlslangToSpv.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 95b507b1..d2b2dee9 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -6126,6 +6126,11 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: assert(builder.isPointerType(typeId1)); typeId1 = builder.getContainedTypeId(typeId1); int width = builder.getScalarTypeWidth(typeId1); +#ifdef AMD_EXTENSIONS + if (width == 16) + // Using 16-bit exp operand, enable extension SPV_AMD_gpu_shader_int16 + builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); +#endif if (builder.getNumComponents(operands[0]) == 1) frexpIntType = builder.makeIntegerType(width, true); else