X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=tests%2Fglsl%2Fmatrix_from_elements.glsl;fp=tests%2Fglsl%2Fmatrix_from_elements.glsl;h=42b1655640c9dbcb2ca6a68f1d980fe818c5ca3c;hb=e1dacd64ec555d7344d32a9c11e785f1dc3d0929;hp=0000000000000000000000000000000000000000;hpb=b125c684e2c2feb86845f051285fe666d8ebfc76;p=libs%2Fgl.git diff --git a/tests/glsl/matrix_from_elements.glsl b/tests/glsl/matrix_from_elements.glsl new file mode 100644 index 00000000..42b16556 --- /dev/null +++ b/tests/glsl/matrix_from_elements.glsl @@ -0,0 +1,31 @@ +uniform Transform +{ + vec3 translation; + float rotation; +}; + +#pragma MSP stage(vertex) +layout(location=0) in vec2 position; +void main() +{ + float c = cos(rotation); + float s = sin(rotation); + mat3 m = mat3(c, s, 0.0, -s, c, 0.0, translation); + gl_Position = vec4((m*vec3(position, 1.0)).xy, 0.0, 1.0); +} + +/* Expected output: vertex +layout(binding=48) uniform Transform +{ + vec3 translation; + float rotation; +}; +layout(location=0) in vec2 position; +void main() +{ + float c = cos(rotation); + float s = sin(rotation); + + gl_Position = vec4((mat3(vec3(c, s, 0.0), vec3(-s, c, 0.0), translation)*vec3(position, 1.0)).xy, 0.0, 1.0); +} +*/