mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
1c73513425
At the current moment this is a little odd because for SM1 [test] directives are skipped, and the [shader] directives are not executed by the shader_runner_vulkan.c:compile_shader() but by the general shader_runner.c:compile_shader(). So in principle it is a little weird that we go through the vulkan runner. But fret not, because in the future we plan to make the parser agnostic to the language of the tests, so we will get rid of the general shader_runner.c:compile_shader() function and instead call a runner->compile_shader() function, defined for each runner. Granted, most of these may call a generic implementation that uses native compiler in Windows, and vkd3d-shader on Linux, but it would be more conceptually correct.
141 lines
2.5 KiB
Plaintext
141 lines
2.5 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]
|
|
draw quad
|
|
probe all rgba (1.0, 5.0, 7.0, 12.0)
|
|
|
|
|
|
[pixel shader]
|
|
float4 main() : SV_TARGET
|
|
{
|
|
float3x2 m = {1, 2, 3, 4, 5, 6};
|
|
|
|
m[1] = float2(30, 40);
|
|
|
|
return float4(m[1], m[2]);
|
|
}
|
|
|
|
[test]
|
|
draw quad
|
|
probe all rgba (30.0, 40.0, 5.0, 6.0)
|
|
|
|
|
|
[pixel shader]
|
|
float4 main() : SV_TARGET
|
|
{
|
|
row_major float3x2 m = {1, 2, 3, 4, 5, 6};
|
|
|
|
m[2] = float2(50, 60);
|
|
|
|
return float4(m[1], m[2]);
|
|
}
|
|
|
|
[test]
|
|
draw quad
|
|
probe all rgba (3.0, 4.0, 50.0, 60.0)
|
|
|
|
|
|
[pixel shader todo(sm<4)]
|
|
uniform float i;
|
|
|
|
float4 main() : sv_target
|
|
{
|
|
float4x4 mat = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
|
|
|
|
return mat[i];
|
|
}
|
|
|
|
[test]
|
|
uniform 0 float 2
|
|
todo(sm<4) draw quad
|
|
probe all rgba (8, 9, 10, 11)
|
|
|
|
|
|
[pixel shader todo(sm<4)]
|
|
uniform float i;
|
|
|
|
float4 main() : sv_target
|
|
{
|
|
row_major float4x4 mat = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
|
|
|
|
return mat[i];
|
|
}
|
|
|
|
[test]
|
|
uniform 0 float 3
|
|
todo(sm<4) draw quad
|
|
probe all rgba (12, 13, 14, 15)
|