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;
break;
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);
libCall = spv::GLSLstd450InterpolateAtCentroid;
break;
@ -6097,10 +6101,18 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
libCall = spv::GLSLstd450Refract;
break;
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);
libCall = spv::GLSLstd450InterpolateAtSample;
break;
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);
libCall = spv::GLSLstd450InterpolateAtOffset;
break;
@ -6251,6 +6263,8 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
break;
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);
libCall = spv::InterpolateAtVertexAMD;
break;