Specify SPV_AMD_gpu_shader_int16 extension string when frexp() takes 16-bit

exp operand
This commit is contained in:
Rex Xu 2018-04-11 16:56:50 +08:00
parent 6cf7645c6d
commit 7c88aff1a9

View File

@ -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