SPIRV-Cross/reference/shaders/asm/frag/out-of-bounds-access-opspecconstant.asm.frag
Sebastián Aedo 905b8244e7 Clamp vector element access to vector size.
In cases where we know the size of the vector and the index at compile
time, we can check if it's accessing in bounds and rely in undefined
behavior otherwise.

Signed-off-by: Sebastián Aedo <saedo@codeweavers.com>
2021-12-07 16:00:06 -03:00

16 lines
174 B
GLSL

#version 320 es
precision mediump float;
precision highp int;
const uint _15 = 3u;
void main()
{
vec3 v = vec3(0.0);
if (false)
{
v[0] = 99.0;
}
}