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] Silent compiler crash when using GetAttributeAtVertex #2955
Also, tried to figure out the actual usages, and turns out the SPIR-V backend generated invalid code in a few cases instead of showing an error, or generating valid code.
Chow (@ShchchowAMD) could you take a look? Seems like you implemented those features IIRC?
Another example which yields a validation error:
struct S {
float4 a : COLOR;
};
floatcompute(float4 a) {
returnGetAttributeAtVertex(a, 0)[0];
}
float4main(nointerpolation S s) : SV_TARGET
{
returnfloat4(0, 0, 0, compute(s.a));
}
dxc -E main -T ps_6_0 repro.hlsl -fcgl -spirv
fatal error: generated SPIR-V is invalid: Expected Constituent type to be equal to the corresponding member type of Result Type struct
%22 = OpCompositeConstruct %S %21
note: please file a bug report on https://github.com/Microsoft/DirectXShaderCompiler/issues with source code if possible
Activity
kuhar commentedon Jun 8, 2020
Thanks for the detailed bug report, Lukas Taparauskas (@Dredhog)! Looping in spir-v folks: Ehsan (@ehsannas) Jaebaek Seo (@jaebaek).
sudonatalie commentedon Sep 2, 2021
Closing this issue as the crash is resolved, and opened #3930 to track an actual implementation of the intrinsic in future.
Keenuts commentedon Nov 15, 2023
Seems like this issue is now present again.
Started https://github.com/microsoft/DirectXShaderCompiler/pull/6018/files but unsure about the result.
Also, tried to figure out the actual usages, and turns out the SPIR-V backend generated invalid code in a few cases instead of showing an error, or generating valid code.
Chow (@ShchchowAMD) could you take a look? Seems like you implemented those features IIRC?
Another example which yields a validation error:
ShchchowAMD commentedon Nov 16, 2023
Just to double check I understand correct as I'm not familiar with this case:
a[0]is accessing first float channel ofa, which meansa[0]is eqaul toa.x.I'll try to make a fix for this case if above explanation is expected.
Seems like previous implementation missed such case that using array-like bracket indexing to access a channel in vector.
s-perron commentedon Nov 16, 2023
I believe that is correct. You can see compare
v.xandv[0]at https://godbolt.org/z/no8nvnaPz. They both have essentially the same access chain.s-perron commentedon Nov 16, 2023
Chow (@ShchchowAMD) Thanks for looking into this.
[SPIR-V] Fix for an issue when noninterpolation is decorated on struc…
[SPIR-V] Fix crash in GetAttributeAtVertex impl.
[SPIR-V] Fix crash in GetAttributeAtVertex impl.
[SPIR-V] Fix crash in GetAttributeAtVertex impl. (#6459)