Debian Codegraph @

third_party/spirv-cross/shaders/vert/read-from-row-major-array.vert

raw
1 #version 310 es
2 layout(location = 0) in highp vec4 a_position;
3 layout(location = 0) out mediump float v_vtxResult;
4
5 layout(set = 0, binding = 0, std140, row_major) uniform Block
6 {
7 highp mat2x3 var[3][4];
8 };
9
10 mediump float compare_float (highp float a, highp float b) { return abs(a - b) < 0.05 ? 1.0 : 0.0; }
11 mediump float compare_vec3 (highp vec3 a, highp vec3 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z); }
12 mediump float compare_mat2x3 (highp mat2x3 a, highp mat2x3 b){ return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1]); }
13
14 void main (void)
15 {
16 gl_Position = a_position;
17 mediump float result = 1.0;
18 result *= compare_mat2x3(var[0][0], mat2x3(2.0, 6.0, -6.0, 0.0, 5.0, 5.0));
19 v_vtxResult = result;
20 }