diff --git a/tools/clang/lib/SPIRV/DeclResultIdMapper.h b/tools/clang/lib/SPIRV/DeclResultIdMapper.h index 3d9b8450c8..e1a1554124 100644 --- a/tools/clang/lib/SPIRV/DeclResultIdMapper.h +++ b/tools/clang/lib/SPIRV/DeclResultIdMapper.h @@ -1146,8 +1146,7 @@ bool DeclResultIdMapper::decorateStageIOLocations() { } bool DeclResultIdMapper::isInputStorageClass(const StageVar &v) { - return getStorageClassForSigPoint(v.getSigPoint()) == - spv::StorageClass::Input; + return v.getStorageClass() == spv::StorageClass::Input; } void DeclResultIdMapper::createFnParamCounterVar(const VarDecl *param) { diff --git a/tools/clang/test/CodeGenSPIRV/ext_builtin_input.lib.hlsl b/tools/clang/test/CodeGenSPIRV/ext_builtin_input.lib.hlsl new file mode 100644 index 0000000000..ce467a0941 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/ext_builtin_input.lib.hlsl @@ -0,0 +1,16 @@ +// RUN: %dxc -spirv -enable-16bit-types -T lib_6_7 -HV 202x %s | FileCheck %s + +// CHECK: OpEntryPoint Fragment %psmain "psmain" %gl_HelperInvocation %out_var_SV_Target0 +// CHECK: OpDecorate %gl_HelperInvocation BuiltIn HelperInvocation +// CHECK: %gl_HelperInvocation = OpVariable %_ptr_Input_bool Input + +[[vk::ext_builtin_input(23 /* BuiltInHelperInvocation */)]] +static const bool HelperInvocation; + +[shader("pixel")] +float4 psmain() : SV_Target0 { + + if (HelperInvocation) + return 0; + return 1; +}