Merge pull request #1383 from amdrexu/bugfix

Fix issue #1376: SPV_AMD_gpu_shader_half_float is not emitted under vulkan1.1
This commit is contained in:
John Kessenich 2018-05-17 10:19:56 -06:00 committed by GitHub
commit 98e1d7f64b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4630,6 +4630,10 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe
unaryOp = spv::OpFwidthCoarse; unaryOp = spv::OpFwidthCoarse;
break; break;
case glslang::EOpInterpolateAtCentroid: case glslang::EOpInterpolateAtCentroid:
#ifdef AMD_EXTENSIONS
if (typeProxy == glslang::EbtFloat16)
builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float);
#endif
builder.addCapability(spv::CapabilityInterpolationFunction); builder.addCapability(spv::CapabilityInterpolationFunction);
libCall = spv::GLSLstd450InterpolateAtCentroid; libCall = spv::GLSLstd450InterpolateAtCentroid;
break; break;
@ -6097,10 +6101,18 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
libCall = spv::GLSLstd450Refract; libCall = spv::GLSLstd450Refract;
break; break;
case glslang::EOpInterpolateAtSample: case glslang::EOpInterpolateAtSample:
#ifdef AMD_EXTENSIONS
if (typeProxy == glslang::EbtFloat16)
builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float);
#endif
builder.addCapability(spv::CapabilityInterpolationFunction); builder.addCapability(spv::CapabilityInterpolationFunction);
libCall = spv::GLSLstd450InterpolateAtSample; libCall = spv::GLSLstd450InterpolateAtSample;
break; break;
case glslang::EOpInterpolateAtOffset: case glslang::EOpInterpolateAtOffset:
#ifdef AMD_EXTENSIONS
if (typeProxy == glslang::EbtFloat16)
builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float);
#endif
builder.addCapability(spv::CapabilityInterpolationFunction); builder.addCapability(spv::CapabilityInterpolationFunction);
libCall = spv::GLSLstd450InterpolateAtOffset; libCall = spv::GLSLstd450InterpolateAtOffset;
break; break;
@ -6251,6 +6263,8 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
break; break;
case glslang::EOpInterpolateAtVertex: case glslang::EOpInterpolateAtVertex:
if (typeProxy == glslang::EbtFloat16)
builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float);
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_explicit_vertex_parameter); extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_explicit_vertex_parameter);
libCall = spv::InterpolateAtVertexAMD; libCall = spv::InterpolateAtVertexAMD;
break; break;