SPV: Fix #1487: Only declare AMD int16/half_float extensions when needed.

This commit is contained in:
John Kessenich
2018-09-10 18:10:51 -06:00
parent 546b78854a
commit afe0c66f65
9 changed files with 19 additions and 21 deletions

12
SPIRV/GlslangToSpv.cpp Normal file → Executable file
View File

@@ -2729,10 +2729,6 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
spvType = builder.makeFloatType(64);
break;
case glslang::EbtFloat16:
#if AMD_EXTENSIONS
if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3)
builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float);
#endif
spvType = builder.makeFloatType(16);
break;
case glslang::EbtBool:
@@ -2750,17 +2746,9 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
spvType = builder.makeUintType(8);
break;
case glslang::EbtInt16:
#ifdef AMD_EXTENSIONS
if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3)
builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16);
#endif
spvType = builder.makeIntType(16);
break;
case glslang::EbtUint16:
#ifdef AMD_EXTENSIONS
if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3)
builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16);
#endif
spvType = builder.makeUintType(16);
break;
case glslang::EbtInt: