vkd3d/tests/hlsl-matrix-indexing.shader_test
Giovanni Mascellani cf7cf05cb7 vkd3d-shader/hlsl: Parse matrix constructors.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-27 21:45:45 +02:00

79 lines
1.6 KiB
Plaintext

[pixel shader]
uniform float4x4 m;
float4 main() : SV_TARGET
{
return float4(m[0][0], m[1][0], m[1][2], m[2][3]);
}
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
uniform 4 float4 5.0 6.0 7.0 8.0
uniform 8 float4 9.0 10.0 11.0 12.0
uniform 12 float4 13.0 14.0 15.0 16.0
draw quad
probe all rgba (1.0, 2.0, 10.0, 15.0)
[pixel shader]
uniform column_major float4x4 m;
float4 main() : SV_TARGET
{
return float4(m[0][0], m[1][0], m[1][2], m[2][3]);
}
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
uniform 4 float4 5.0 6.0 7.0 8.0
uniform 8 float4 9.0 10.0 11.0 12.0
uniform 12 float4 13.0 14.0 15.0 16.0
draw quad
probe all rgba (1.0, 2.0, 10.0, 15.0)
[pixel shader]
uniform row_major float4x4 m;
float4 main() : SV_TARGET
{
return float4(m[0][0], m[1][0], m[1][2], m[2][3]);
}
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
uniform 4 float4 5.0 6.0 7.0 8.0
uniform 8 float4 9.0 10.0 11.0 12.0
uniform 12 float4 13.0 14.0 15.0 16.0
draw quad
probe all rgba (1.0, 5.0, 7.0, 12.0)
[pixel shader]
uniform float3x2 m;
float4 main() : SV_TARGET
{
float3x2 m2 = m;
return float4(m2[0][0], m2[2][0], m2[1][1], m2[2][1]);
}
[test]
uniform 0 float4 1.0 2.0 3.0 0.0
uniform 4 float4 5.0 6.0 7.0 0.0
draw quad
probe all rgba (1.0, 3.0, 6.0, 7.0)
[pixel shader]
float4 main() : SV_TARGET
{
float2x2 a = float2x2(11.0, 12.0, 13.0, 14.0);
float4x4 m = float4x4(1.0, 2.0, 3.0, 4.0,
float3(5.0, 6.0, 7.0), 8.0,
9.0, 10.0,
a,
15.0, 16.0);
return float4(m[0][0], m[1][0], m[1][2], m[2][3]);
}
[test]
todo draw quad
probe all rgba (1.0, 5.0, 7.0, 12.0)