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
float4x4 M;
float4 PSMain() : SV_TARGET
{
return float4(M[8]);
}
Actual Behavior
I was expecting a compilation error on the out of bounds access M[8]. If I remove the redundant float4() type constructor, it yields a compilation error as expected.
Description
I noticed that there seems to be no bounds check on matrix access when it is wrapped in a type constructor.
Steps to Reproduce
https://shader-playground.timjones.io/0aaa9f3162e186ce4ce9da1926b93a40
float4x4 M;
float4 PSMain() : SV_TARGET
{
return float4(M[8]);
}
Actual Behavior
I was expecting a compilation error on the out of bounds access M[8]. If I remove the redundant float4() type constructor, it yields a compilation error as expected.
Environment
Shader playground. Trunk (2024-04-29).
The text was updated successfully, but these errors were encountered: