You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SPIR-V] GetAttributeAtVertex on struct member without nointerpolation fails validation #6384
struct S {
float4 a : COLOR;
};
float compute(nointerpolation float4 a) {
return GetAttributeAtVertex(a, 2)[0];
}
float4 main(S s) : SV_TARGET
{
return float4(0, 0, 0, compute(s.a));
}
Actual Behavior
Once #6041 is merged, the above sample will fail at validation for both DXIL and SPIR-V, but the SPIR-V backend needs better error messaging.
DXIL:
error: validation errors
<source>:6:10: error: Attribute COLOR must have nointerpolation mode in order to use GetAttributeAtVertex function.
note: at '%1 = call float @dx.op.attributeAtVertex.f32(i32 137, i32 0, i32 0, i8 0, i8 2)' in block '#0' of function 'main'.
Validation failed.
SPIR-V:
fatal error: generated SPIR-V is invalid: Result type (OpTypeVector) does not match the type that results from indexing into the composite (OpTypeFloat).
%13 = OpCompositeExtract %v4float %12 2
Gregory Roth (@pow2clk) Thanks for the reference! I'll keep this one open since the issue we wanted to highlight here is that the SPIR-V error messaging specifically is poor, but how we fix that might be dependent on #6220 is decided.
Activity
pow2clk commentedon Mar 5, 2024
I think this is a duplicate of #6220. Natalie Chouinard (@sudonatalie) can you confirm and close if so?
sudonatalie commentedon Mar 5, 2024
Gregory Roth (@pow2clk) Thanks for the reference! I'll keep this one open since the issue we wanted to highlight here is that the SPIR-V error messaging specifically is poor, but how we fix that might be dependent on #6220 is decided.
[Sema] Requires nointerpolation on GetAttributeAtVertex param #0
[Sema] Requires nointerpolation on GetAttributeAtVertex param #0
[Sema] Requires nointerpolation on GetAttributeAtVertex param #0
sudonatalie commentedon Mar 26, 2024
Related: microsoft/hlsl-specs#181
[Sema] Requires nointerpolation on GetAttributeAtVertex param #0
[Sema] Requires nointerpolation on GetAttributeAtVertex param #0
[SPIR-V][Sema] Requires nointerpolation on GetAttributeAtVertex param…