tests: Use the vulkan runner to run SM1 compilation tests.

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.
This commit is contained in:
Francisco Casas 2023-11-15 17:41:33 -03:00 committed by Alexandre Julliard
parent b92f6c448a
commit 1c73513425
Notes: Alexandre Julliard 2024-01-24 22:53:52 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/514
47 changed files with 313 additions and 307 deletions

View File

@ -8,8 +8,8 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.1 0.7 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.1, 0.7, 0.4, 0.4)
uniform 0 float4 -0.7 0.1 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.7, 0.1, 1.2, 0.4)

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 f;
float4 main() : sv_target
@ -8,28 +8,28 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 1.0 1.0 1.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 1.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 1.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 0.0 1.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 0.0 0.0 1.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)
uniform 0 float4 -1.0 -1.0 -1.0 -1.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float f;
float4 main() : sv_target
@ -39,13 +39,13 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)
uniform 0 float4 -1.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
[require]

View File

@ -13,7 +13,7 @@ uniform 0 float4 5.0 15.0 0.0 0.0
draw quad
probe all rgba (20.0, -10.0, 75.0, 0.33333333) 1
[pixel shader]
[pixel shader todo(sm<4)]
uniform float2 a;
float4 main() : SV_TARGET
@ -25,10 +25,10 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 5.0 15.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (5.0, 5.0, -5.0, 3.0) 1
[pixel shader]
[pixel shader todo(sm<4)]
uniform float2 a;
float4 main() : SV_TARGET
@ -40,10 +40,10 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 42.0 5.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (2.0, -2.0, 2.0, -2.0) 16
[pixel shader]
[pixel shader todo(sm<4)]
uniform float2 a;
float4 main() : SV_TARGET
@ -55,10 +55,10 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 45.0 5.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]
[pixel shader todo(sm<4)]
float4 x, y;
float4 main() : sv_target
@ -69,7 +69,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 5.0 -42.1 4.0 45.0
uniform 4 float4 15.0 -5.0 4.1 5.0
draw quad
todo(sm<4) draw quad
probe all rgba (5.0, -2.1, 4.0, 0.0) 6
[require]

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
uniform float2 a;
float4 main() : SV_TARGET
@ -10,10 +10,10 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 5.0 16.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (21.0, -11.0, 80.0, 0.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float2 a;
float4 main() : SV_TARGET
@ -25,10 +25,10 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 5.0 16.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (5.0, 5.0, -5.0, 3.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float2 a;
float4 main() : SV_TARGET
@ -40,10 +40,10 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 42.0 5.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (8.0, -8.0, -8.0, 8.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float2 a;
float4 main() : SV_TARGET
@ -55,10 +55,10 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 42.0 5.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (2.0, -2.0, 2.0, -2.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float2 a;
float4 main() : SV_TARGET
@ -70,10 +70,10 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 45.0 5.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (9.0, -9.0, -9.0, 9.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float2 a;
float4 main() : SV_TARGET
@ -85,10 +85,10 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 45.0 5.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 a;
float4 main() : SV_TARGET
@ -98,10 +98,10 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 5.0 -7.0 0.0 -10.0
draw quad
todo(sm<4) draw quad
probe all rgba (5.0, 7.0, 0.0, 10.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 a;
uniform float4 b;
@ -117,7 +117,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 45.0 5.0 50.0 10.0
uniform 4 float4 3.0 8.0 2.0 5.0
draw quad
todo(sm<4) draw quad
probe all rgba (9.0, 5.0, 1.0, 3.0)
[require]

View File

@ -77,6 +77,7 @@ draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader fail(sm<6)]
// On SM1 this gives hr 0x88760b59.
float4 main() : SV_TARGET
{
int x = 1;
@ -90,6 +91,7 @@ draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader fail(sm<6)]
// On SM1 this gives hr 0x88760b59.
float4 main() : SV_TARGET
{
int x = 1;

View File

@ -21,7 +21,7 @@ uniform 0 float4 -0.5 6.5 7.5 3.4
draw quad
probe all rgba (0.0, 7.0, 8.0, 4.0) 4
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -34,7 +34,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 7.5 3.4
draw quad
todo(sm<4) draw quad
probe all rgba (7.0, 8.0, 0.0, 4.0) 4
[require]

View File

@ -113,7 +113,7 @@ float4 main() : sv_target
return 0;
}
[pixel shader]
[pixel shader todo(sm<4)]
uniform float1 f;
float4 main() : sv_target
{
@ -124,8 +124,8 @@ float4 main() : sv_target
[test]
uniform 0 float4 -2.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 -0.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)

View File

@ -64,7 +64,7 @@ draw quad
probe all rgba (10, 10, 10, 11)
[pixel shader]
[pixel shader todo(sm<4)]
Texture2D tex;
sampler sam[2];
@ -111,7 +111,7 @@ probe all rgba (104, 104, 104, 111)
% Sampler arrays with components that have different usage dimensions are only forbidden in SM4 upwards.
% However, tex2D and tex1D are considered the same dimension for these purposes.
[pixel shader fail]
[pixel shader fail(sm>=4)]
sampler sam[2];
float4 main() : sv_target

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -11,13 +11,13 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.9, 0.8, 0.7, 0.6)
uniform 0 float4 0.1 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.1, 0.2, 0.3, 0.4)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -29,7 +29,7 @@ float4 main() : sv_target
return float4(0.9, 0.8, 0.7, 0.6);
}
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -43,7 +43,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.9, 0.8, 0.7, 0.6)
[pixel shader fail(sm<6)]
@ -74,7 +74,7 @@ float main() : sv_target
[require]
shader model >= 3.0
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -88,7 +88,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.0 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.9, 0.8, 0.7, 0.6)
[pixel shader]

View File

@ -9,7 +9,7 @@ float4 main(float4 pos : sv_position) : sv_target
[test]
draw quad
probe all rgba (1.0, 1.0, 0.0, 0.0)
todo(sm<4) probe all rgba (1.0, 1.0, 0.0, 0.0)
[pixel shader]
@ -30,13 +30,13 @@ float4 main(float4 pos : sv_position) : sv_target
[test]
draw quad
probe (10, 10) rgba (-16.0, -5.0, 3.0, 0.0)
probe (11, 10) rgba (-21.0, -5.0, 3.0, 0.0)
probe (10, 11) rgba (-13.0, -5.0, 3.0, 0.0)
probe (11, 11) rgba (-17.0, -5.0, 3.0, 0.0)
probe (12, 10) rgba (-26.0, -6.0, 4.0, 0.0)
probe (16, 16) rgba (-25.0, -7.0, 5.0, 0.0)
probe (150, 150) rgba (-226.0, -47.0, 45.0, 0.0)
todo(sm<4) probe (10, 10) rgba (-16.0, -5.0, 3.0, 0.0)
todo(sm<4) probe (11, 10) rgba (-21.0, -5.0, 3.0, 0.0)
todo(sm<4) probe (10, 11) rgba (-13.0, -5.0, 3.0, 0.0)
todo(sm<4) probe (11, 11) rgba (-17.0, -5.0, 3.0, 0.0)
todo(sm<4) probe (12, 10) rgba (-26.0, -6.0, 4.0, 0.0)
todo(sm<4) probe (16, 16) rgba (-25.0, -7.0, 5.0, 0.0)
todo(sm<4) probe (150, 150) rgba (-226.0, -47.0, 45.0, 0.0)
[require]

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 x;
float4 main() : sv_target
@ -9,8 +9,8 @@ float4 main() : sv_target
[test]
uniform 0 float4 1 2 3 4
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (1, 2, 3, 4)
uniform 0 float4 9 8 7 6
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (1, 2, 3, 4)

View File

@ -13,7 +13,7 @@ uniform 4 float4 2.0 -1.0 4.0 5.0
draw quad
probe all rgba (7.483983, 7.483983, 7.483983, 7.483983) 1
[pixel shader]
[pixel shader todo(sm<4)]
uniform int4 x;
uniform int4 y;

View File

@ -25,7 +25,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 3.0 0.0 0.0
uniform 4 float4 10.0 11.0 12.0 13.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (53.0, 53.0, 53.0, 53.0)
[pixel shader]
@ -56,7 +56,7 @@ float4 main() : SV_TARGET
uniform 0 float4 10.0 11.0 12.0 13.0
uniform 4 float4 2.0 0.0 0.0 0.0
todo(sm>=6) draw quad
probe all rgba (92.0, 92.0, 92.0, 92.0)
probe all rgba (92.0, 92.0, 92.0, 92.0)
[pixel shader]
uniform float x;

View File

@ -127,7 +127,7 @@ float4 main(in apple aps[2][2]) : sv_target
[test]
draw quad
todo(sm>=6) probe (0, 0) rgba (10.0, 10.0, 20.0, 20.0)
probe (0, 0) rgba (10.0, 10.0, 20.0, 20.0)
[pixel shader]
@ -275,8 +275,8 @@ float4 main(in float4 t1 : TEXCOORD0, in float4 t2 : TEXCOORD0) : sv_target
}
[test]
todo(sm>=6) draw quad
probe (0, 0) rgba (99.0, 99.0, 10.0, 11.0)
draw quad
todo(sm>=6) probe (0, 0) rgba (99.0, 99.0, 10.0, 11.0)
% Different indexes of the same semantic can have different types.

View File

@ -13,7 +13,7 @@ draw quad
probe all rgba (8.0, 8.0, 8.0, 8.0)
[pixel shader]
[pixel shader todo(sm<4)]
float4 a, b;
float i;
@ -26,7 +26,7 @@ float4 main() : sv_target
uniform 0 float4 1.0 2.0 3.0 4.0
uniform 4 float4 5.0 6.0 7.0 8.0
uniform 8 float 2
draw quad
todo(sm<4) draw quad
probe all rgba (10.0, 10.0, 10.0, 10.0)
@ -44,7 +44,7 @@ draw quad
probe all rgba (3.0, 3.0, 3.0, 3.0)
[pixel shader]
[pixel shader todo(sm<4)]
float4 a;
float i;
@ -56,10 +56,10 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
uniform 4 float 0
draw quad
todo(sm<4) draw quad
probe all rgba (4.0, 4.0, 4.0, 4.0)
uniform 4 float 2
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
@ -82,7 +82,7 @@ draw quad
probe all rgba (4.0, 4.0, 4.0, 4.0)
[pixel shader]
[pixel shader todo(sm<4)]
float4 a;
float i;
@ -99,5 +99,5 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
uniform 4 float 1
draw quad
todo(sm<4) draw quad
probe all rgba (2.0, 2.0, 2.0, 2.0)

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 f;
float4 main() : sv_target
@ -44,7 +44,7 @@ shader model < 4.0
[test]
uniform 0 float4 0.0 1.5 1.5 0.0
draw quad
todo(sm<4) draw quad
todo probe all rgba (1010101.0, 11001100.0, 1101001.0, 0.0)
% SM4-5 optimises away the 'not' by inverting the condition, even though this is invalid for NaN.

View File

@ -21,7 +21,7 @@ uniform 0 float4 -0.5 6.5 7.5 3.4
draw quad
probe all rgba (-1.0, 6.0, 7.0, 3.0) 4
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -34,7 +34,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 7.5 3.4
draw quad
todo(sm<4) draw quad
probe all rgba (6.0, 7.0, -1.0, 3.0) 4
[require]

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -8,13 +8,13 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (-0.5, 0.0, 0.0, 0.0) 4
uniform 0 float4 1.1 0.3 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.2, 0.0, 0.0, 0.0) 4
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -24,8 +24,8 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 2.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (-0.5, 0.5, 0.0, 0.0) 4
uniform 0 float4 1.1 0.3 3.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (1.1, 0.3, 0.0, 0.0) 4

View File

@ -5,7 +5,7 @@ void main(float4 pos : position, out float tex : texcoord, out float4 out_pos :
out_pos = pos;
}
[pixel shader]
[pixel shader todo(sm<4)]
float4 main(float tex : texcoord) : sv_target
{
int i;
@ -23,7 +23,7 @@ float4 main(float tex : texcoord) : sv_target
}
[test]
draw quad
todo(sm<4) draw quad
probe ( 0, 0, 159, 480) rgba (10.0, 35.0, 0.0, 0.0)
probe (161, 0, 479, 480) rgba (10.0, 38.0, 0.0, 0.0)
probe (481, 0, 640, 480) rgba ( 5.0, 10.0, 0.0, 0.0)
@ -59,10 +59,11 @@ probe ( 0, 0, 159, 480) rgba (10.0, 35.0, 0.0, 0.0)
probe (161, 0, 479, 480) rgba (10.0, 38.0, 0.0, 0.0)
probe (481, 0, 640, 480) rgba ( 5.0, 10.0, 0.0, 0.0)
[require]
% Reset requirements
[pixel shader]
[pixel shader todo(sm<4)]
float4 main(float tex : texcoord) : sv_target
{
int i;
@ -75,7 +76,7 @@ float4 main(float tex : texcoord) : sv_target
}
[test]
draw quad
todo(sm<4) draw quad
probe all rgba (10.0, 45.0, 0.0, 0.0)
[pixel shader fail(sm<6)]

View File

@ -32,8 +32,7 @@ float4 main() : sv_target
draw quad
probe all rgba (0.2, 0.1, 0.8, 0.5);
[pixel shader]
[pixel shader todo(sm<4)]
uniform float f;
float func(out float o)
@ -80,20 +79,19 @@ float4 main() : sv_target
[test]
uniform 0 float 0.1
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.3, 0.2, 0.6, 0.3) 1
uniform 0 float 0.4
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.6, 0.5, 0.6, 0.3) 1
uniform 0 float 0.6
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.6, 0.5, 0.4, 0.5) 1
uniform 0 float 0.8
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.8, 0.7, 0.4, 0.5) 1
[pixel shader]
[pixel shader todo(sm<4)]
uniform float f;
float func(out float o)
@ -136,17 +134,16 @@ float4 main() : sv_target
[test]
uniform 0 float 0.1
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.2, 0.1, 0.2, 0.1) 1
uniform 0 float 0.5
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.5, 0.4, 1.0, 0.9) 1
uniform 0 float 0.9
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (1.0, 0.9, 1.0, 0.6) 1
[pixel shader]
[pixel shader todo(sm<4)]
float func(out float o)
{
o = 0.1;
@ -184,11 +181,10 @@ float4 main() : sv_target
}
[test]
draw quad
todo(sm<4) draw quad
probe all rgba (0.4, 0.3, 0.3, 0.9) 1
[pixel shader]
[pixel shader todo(sm<4)]
uniform float f;
float func(out float o)
@ -239,26 +235,26 @@ float4 main() : sv_target
[test]
uniform 0 float 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.3, 0.2, 0.3, 0.3) 1
uniform 0 float 0.1
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.3, 0.3, 0.3, 0.3) 1
uniform 0 float 0.3
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.3, 0.5, 0.3, 0.3) 1
uniform 0 float 0.7
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.3, 0.9, 0.7, 0.6) 1
uniform 0 float 0.9
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.4, 0.1, 0.7, 0.6) 1
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 f[3];
@ -295,21 +291,21 @@ float4 main() : sv_target
uniform 0 float4 0.3 0.0 0.0 0.0
uniform 4 float4 0.0 0.0 0.0 0.0
uniform 8 float4 0.1 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
todo(sm>=6) probe all rgba (0.3, 0.2, 0.6, 0.6) 1
uniform 4 float4 0.35 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
todo(sm>=6) probe all rgba (0.3, 0.3, 0.6, 0.6) 1
uniform 8 float4 0.5 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
todo(sm>=6) probe all rgba (0.3, 0.5, 0.6, 0.6) 1
uniform 0 float4 1.0 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
todo(sm>=6) probe all rgba (0.3, 0.5, 0.6, 0.6) 1
uniform 4 float4 2.0 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
todo(sm>=6) probe all rgba (0.4, 0.1, 0.6, 0.6) 1

View File

@ -18,7 +18,7 @@ float4 main(float4 pos : sv_position) : sv_target
}
[test]
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe (10, 10) rgba (8.0, 8.0, 8.0, 8.0)
probe (11, 10) rgba (8.0, 8.0, 8.0, 8.0)
probe (12, 10) rgba (10.0, 10.0, 10.0, 10.0)

View File

@ -9,7 +9,7 @@ float4 main() : sv_target
[require]
options: backcompat
[pixel shader]
[pixel shader todo(sm<4)]
uniform half h;
float4 main() : sv_target
@ -19,5 +19,5 @@ float4 main() : sv_target
[test]
uniform 0 float 10.0
draw quad
todo(sm<4) draw quad
probe all rgba (10.0, 10.0, 10.0, 10.0)

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
float cond;
float4 main() : sv_target
@ -17,14 +17,14 @@ float4 main() : sv_target
[test]
uniform 0 float 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (2.0, 2.0, 2.0, 2.0)
uniform 0 float 1.0
draw quad
todo(sm<4) draw quad
probe all rgba (-2.0, -2.0, -2.0, -2.0)
[pixel shader]
[pixel shader todo(sm<4)]
float cond;
float4 main() : sv_target
@ -43,14 +43,14 @@ float4 main() : sv_target
[test]
uniform 0 float 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (2.0, 2.0, 2.0, 2.0)
uniform 0 float 1.0
draw quad
todo(sm<4) draw quad
probe all rgba (20.0, 20.0, 20.0, 20.0)
[pixel shader]
[pixel shader todo(sm<4)]
float cond;
float4 main() : sv_target
@ -66,10 +66,11 @@ float4 main() : sv_target
return float4(r, 0, 0);
}
[test]
uniform 0 float 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 4.0, 0.0, 0.0)
uniform 0 float 1.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 40.0, 0.0, 0.0)

View File

@ -26,7 +26,7 @@ float4 main() : sv_target
[test]
draw quad
todo(sm>=6) probe all rgba (5.0, 6.0, 7.0, 8.0)
probe all rgba (5.0, 6.0, 7.0, 8.0)
[require]
% reset requirements

View File

@ -34,7 +34,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 3.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (3.60555124, 3.60555124, 3.60555124, 3.60555124) 1
[pixel shader]

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -8,20 +8,20 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.1 10.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 0.0, 0.0, 1.0)
[test]
uniform 0 float4 1.2 -0.1 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.2, 0.0, 1.0)
[test]
uniform 0 float4 1.2 2.0 3.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.2, 8.0, 1.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -31,7 +31,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.2 2.0 3.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (2.0, 2.4, 16.0, 2.0)
[pixel shader fail]

View File

@ -1,6 +1,6 @@
% TODO: dxcompiler emits no loops for any of these test shaders.
[pixel shader]
[pixel shader todo(sm<4)]
float a;
float4 main() : sv_target
@ -18,11 +18,11 @@ float4 main() : sv_target
[test]
uniform 0 float 5.0
draw quad
todo(sm<4) draw quad
probe all rgba (50.0, 50.0, 50.0, 50.0)
[pixel shader]
[pixel shader todo(sm<4)]
float a;
float4 main() : sv_target
@ -41,10 +41,10 @@ float4 main() : sv_target
[test]
uniform 0 float 4.0
draw quad
todo(sm<4) draw quad
probe all rgba (20.0, 20.0, 20.0, 20.0)
[pixel shader]
[pixel shader todo(sm<4)]
float a;
float4 main() : sv_target
@ -70,10 +70,10 @@ float4 main() : sv_target
[test]
uniform 0 float 4.0
draw quad
todo(sm<4) draw quad
probe all rgba (409.1, 409.1, 409.1, 409.1)
[pixel shader]
[pixel shader todo(sm<4)]
float a;
float4 main() : sv_target
@ -100,11 +100,11 @@ float4 main() : sv_target
[test]
uniform 0 float 4.0
draw quad
todo(sm<4) draw quad
probe all rgba (410.1, 410.1, 410.1, 410.1)
% loop attribute by itself
[pixel shader]
[pixel shader todo(sm<4)]
float4 main() : sv_target
{
float ret = 0.0;
@ -118,10 +118,10 @@ float4 main() : sv_target
}
[test]
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (10.0, 10.0, 10.0, 10.0)
[pixel shader]
[pixel shader todo(sm<4)]
float4 main() : sv_target
{
float ret = 0.0;
@ -137,10 +137,10 @@ float4 main() : sv_target
}
[test]
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (10.0, 10.0, 10.0, 10.0)
[pixel shader]
[pixel shader todo(sm<4)]
float4 main() : sv_target
{
float ret = 0.0;
@ -156,7 +156,7 @@ float4 main() : sv_target
}
[test]
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (10.0, 10.0, 10.0, 10.0)
% unroll can't be used with fastopt or loop

View File

@ -108,7 +108,7 @@ draw quad
probe all rgba (3.0, 4.0, 50.0, 60.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float i;
float4 main() : sv_target
@ -120,11 +120,11 @@ float4 main() : sv_target
[test]
uniform 0 float 2
draw quad
todo(sm<4) draw quad
probe all rgba (8, 9, 10, 11)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float i;
float4 main() : sv_target
@ -136,5 +136,5 @@ float4 main() : sv_target
[test]
uniform 0 float 3
draw quad
todo(sm<4) draw quad
probe all rgba (12, 13, 14, 15)

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 f[3];
uniform float2 i;
@ -12,20 +12,20 @@ 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 0 0 0 0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 2.0, 3.0, 4.0)
uniform 12 float4 1 0 0 0
draw quad
todo(sm<4) draw quad
probe all rgba (5.0, 6.0, 7.0, 8.0)
uniform 12 float4 0 1 0 0
draw quad
todo(sm<4) draw quad
probe all rgba (5.0, 6.0, 7.0, 8.0)
uniform 12 float4 1 1 0 0
draw quad
todo(sm<4) draw quad
probe all rgba (9.0, 10.0, 11.0, 12.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float i;
float4 main() : SV_TARGET
@ -36,20 +36,20 @@ float4 main() : SV_TARGET
[test]
uniform 0 float 0
draw quad
todo(sm<4) draw quad
probe all rgba (11.0, 11.0, 11.0, 11.0)
uniform 0 float 1
draw quad
todo(sm<4) draw quad
probe all rgba (12.0, 12.0, 12.0, 12.0)
uniform 0 float 2
draw quad
todo(sm<4) draw quad
probe all rgba (13.0, 13.0, 13.0, 13.0)
uniform 0 float 3
draw quad
todo(sm<4) draw quad
probe all rgba (14.0, 14.0, 14.0, 14.0)
[pixel shader]
[pixel shader todo(sm<4)]
float i;
float4 main() : sv_target
@ -61,11 +61,11 @@ float4 main() : sv_target
[test]
uniform 0 float 2.3
draw quad
todo(sm<4) draw quad
probe all rgba (3, 3, 3, 3)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float i;
float4 main() : SV_TARGET
@ -77,20 +77,20 @@ float4 main() : SV_TARGET
[test]
uniform 0 float 0
draw quad
todo(sm<4) draw quad
probe all rgba (21.0, 1.0, 24.0, 0.0)
uniform 0 float 1
draw quad
todo(sm<4) draw quad
probe all rgba (22.0, 0.0, 23.0, 1.0)
uniform 0 float 2
draw quad
todo(sm<4) draw quad
probe all rgba (23.0, 1.0, 22.0, 0.0)
uniform 0 float 3
draw quad
todo(sm<4) draw quad
probe all rgba (24.0, 0.0, 21.0, 1.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float2 i;
float4 main() : sv_target
@ -102,20 +102,20 @@ float4 main() : sv_target
[test]
uniform 0 float4 0 0 0 0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 2.0, 3.0, 4.0)
uniform 0 float4 1 0 0 0
draw quad
todo(sm<4) draw quad
probe all rgba (5.0, 6.0, 7.0, 8.0)
uniform 0 float4 0 1 0 0
draw quad
todo(sm<4) draw quad
probe all rgba (5.0, 6.0, 7.0, 8.0)
uniform 0 float4 1 1 0 0
draw quad
todo(sm<4) draw quad
probe all rgba (9.0, 10.0, 11.0, 12.0)
[pixel shader]
[pixel shader todo(sm<4)]
float4 a;
float4 main() : sv_target
@ -130,7 +130,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 0 0 2.4 0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 120.0, 90.0, 4.0)
@ -242,8 +242,8 @@ uniform 8 float 3.0
uniform 12 float 4.0
uniform 16 uint4 3 1 0 2
uniform 20 uint4 0 3 1 2
draw quad
todo probe all rgba (1.0, 1.0, 1.0, 1.0)
todo draw quad
todo(sm<4) probe all rgba (1.0, 1.0, 1.0, 1.0)
[require]
shader model >= 4.0

View File

@ -34,7 +34,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 3.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.554700196, 0.832050323, 0.0, 0.0) 1
[pixel shader]

View File

@ -79,7 +79,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.5 -0.1 0.0 0.0
uniform 4 float4 0.6 0.4 -0.3 1.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.188, -0.308, 0.0, 0.0) 4
[pixel shader]
@ -97,5 +97,5 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.5 -0.1 0.2 0.0
uniform 4 float4 0.6 0.4 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.188, -0.308, 0.0, 0.0) 4

View File

@ -25,8 +25,7 @@ void main(out float4 ret : sv_target)
draw quad
probe all rgba (0.1, 0.2, 0.3, 0.4)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float f;
float4 main() : sv_target
@ -38,14 +37,13 @@ float4 main() : sv_target
[test]
uniform 0 float 0.2
draw quad
todo(sm<4) draw quad
probe all rgba (0.1, 0.2, 0.3, 0.4)
uniform 0 float 0.8
draw quad
todo(sm<4) draw quad
probe all rgba (0.5, 0.6, 0.7, 0.8)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float f;
void main(out float4 ret : sv_target)
@ -65,14 +63,13 @@ void main(out float4 ret : sv_target)
[test]
uniform 0 float 0.2
draw quad
todo(sm<4) draw quad
probe all rgba (0.3, 0.4, 0.5, 0.6)
uniform 0 float 0.8
draw quad
todo(sm<4) draw quad
probe all rgba (0.1, 0.2, 0.3, 0.4)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float f;
void main(out float4 ret : sv_target)
@ -92,17 +89,16 @@ void main(out float4 ret : sv_target)
[test]
uniform 0 float 0.1
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.1, 0.2, 0.3, 0.4) 1
uniform 0 float 0.5
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.2, 0.3, 0.4, 0.5) 1
uniform 0 float 0.9
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.5, 0.6, 0.7, 0.8) 1
[pixel shader]
[pixel shader todo(sm<4)]
uniform float f;
void main(out float4 ret : sv_target)
@ -119,17 +115,16 @@ void main(out float4 ret : sv_target)
[test]
uniform 0 float 0.1
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.1, 0.2, 0.3, 0.4) 1
uniform 0 float 0.5
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.5, 0.6, 0.7, 0.8) 1
uniform 0 float 0.9
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.4, 0.5, 0.6, 0.7) 1
[pixel shader]
[pixel shader todo(sm<4)]
void main(out float4 ret : sv_target)
{
ret = float4(0.1, 0.2, 0.3, 0.4);
@ -143,11 +138,10 @@ void main(out float4 ret : sv_target)
}
[test]
draw quad
todo(sm<4) draw quad
probe all rgba (0.2, 0.4, 0.6, 0.8)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float f;
void main(out float4 ret : sv_target)
@ -166,27 +160,26 @@ void main(out float4 ret : sv_target)
[test]
uniform 0 float 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.1, 0.1, 0.1, 0.1) 1
uniform 0 float 0.1
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.2, 0.2, 0.2, 0.2) 1
uniform 0 float 0.3
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.4, 0.4, 0.4, 0.4) 1
uniform 0 float 0.7
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.8, 0.8, 0.8, 0.8) 1
uniform 0 float 0.9
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.9, 0.9, 0.9, 0.9) 1
[pixel shader]
[pixel shader todo(sm<4)]
uniform float f;
void main(out float4 ret : sv_target)
@ -211,13 +204,13 @@ void main(out float4 ret : sv_target)
[test]
uniform 0 float 0.2
draw quad
todo(sm<4) draw quad
probe all rgba (0.2, 0.2, 0.2, 0.2)
uniform 0 float 0.8
draw quad
todo(sm<4) draw quad
probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 f[3];
@ -243,21 +236,21 @@ void main(out float4 ret : sv_target)
uniform 0 float4 0.3 0.0 0.0 0.0
uniform 4 float4 0.0 0.0 0.0 0.0
uniform 8 float4 0.1 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm>=6) probe all rgba (0.1, 0.1, 0.1, 0.1) 1
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.1, 0.1, 0.1, 0.1) 1
uniform 4 float4 0.35 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm>=6) probe all rgba (0.2, 0.2, 0.2, 0.2) 1
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.2, 0.2, 0.2, 0.2) 1
uniform 8 float4 0.5 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm>=6) probe all rgba (0.4, 0.4, 0.4, 0.4) 1
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.4, 0.4, 0.4, 0.4) 1
uniform 0 float4 1.0 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm>=6) probe all rgba (0.4, 0.4, 0.4, 0.4) 1
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.4, 0.4, 0.4, 0.4) 1
uniform 4 float4 2.0 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm>=6) probe all rgba (0.9, 0.9, 0.9, 0.9) 1
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.9, 0.9, 0.9, 0.9) 1

View File

@ -13,7 +13,7 @@ probe all rgba (0.0, -7.0, 8.0, 3.0) 4
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -26,12 +26,12 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.4 -6.6 7.6 3.4
draw quad
todo(sm<4) draw quad
probe all rgba (-7.0, 8.0, 0.0, 3.0) 4
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -42,5 +42,5 @@ float4 main() : sv_target
[test]
uniform 0 float4 -1 0 2 10
draw quad
todo(sm<4) draw quad
probe all rgba (-1.0, 0.0, 2.0, 10.0) 4

View File

@ -18,7 +18,7 @@ void main(float4 pos : position, out float2 tex : texcoord, out float4 out_pos :
out_pos = pos;
}
[pixel shader]
[pixel shader todo(sm<4)]
sampler s;
Texture2D t;
uniform float bias;
@ -32,13 +32,13 @@ float4 main(float2 coord : texcoord) : sv_target
[test]
uniform 0 float4 6.5 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (10.0, 0.0, 10.0, 0.0)
uniform 0 float4 7.5 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (4.0, 0.0, 10.0, 0.0)
uniform 0 float4 8.5 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.0, 0.0, 10.0, 0.0)

View File

@ -14,7 +14,7 @@ levels 2
0.0 0.0 1.0 0.0
[pixel shader]
[pixel shader todo(sm<4)]
sampler s;
Texture2D t;
uniform float level;
@ -26,20 +26,20 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.0 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (1.0, 0.0, 1.0, 0.0)
uniform 0 float4 0.5 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.5, 0.0, 1.0, 0.0)
uniform 0 float4 1.0 0.0 0.0 0.0
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.0, 0.0, 1.0, 0.0)
[require]
shader model >= 3.0
options: backcompat
[pixel shader fail(sm>=6)]
[pixel shader todo(sm<4) fail(sm>=6)]
sampler s;
float level;
@ -50,11 +50,11 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 0.0, 1.0, 0.0)
uniform 0 float4 0.5 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.5, 0.0, 1.0, 0.0)
uniform 0 float4 1.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.0, 0.0, 1.0, 0.0)

View File

@ -7,7 +7,7 @@ size (2, 2)
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0
[pixel shader]
[pixel shader todo(sm<4)]
sampler s;
Texture2D t;
@ -17,10 +17,10 @@ float4 main() : sv_target
}
[test]
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.25, 0, 0.25, 0)
[pixel shader]
[pixel shader todo(sm<4)]
SamplerState s;
Texture2D t;
@ -30,7 +30,7 @@ float4 main() : sv_target
}
[test]
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.25, 0, 0.25, 0)
[pixel shader fail]

View File

@ -11,7 +11,7 @@ uniform 0 float4 0.7 -0.1 0.0 0.0
todo(sm>=6) draw quad
probe all rgba (0.7, 0.0, 1.0, 0.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -22,5 +22,5 @@ float4 main() : sv_target
[test]
uniform 0 float4 -2 0 2 -1
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.0, 0.0, 1.0, 0.0)

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
uniform float f;
float4 main() : sv_target
@ -8,16 +8,16 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 -1.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (-1.0, -1.0, -1.0, -1.0)
uniform 0 float4 0.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 f;
float4 main() : sv_target
@ -27,10 +27,10 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float2x2 f;
float4 main() : sv_target
@ -41,14 +41,14 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 0.0 0.0
uniform 4 float4 3.0 4.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
[require]
% SM1-3 doesn't support integral types
shader model >= 4.0
[pixel shader]
[pixel shader todo(sm<4)]
uniform int f;
float4 main() : sv_target
@ -67,7 +67,7 @@ uniform 0 int4 0 0 0 0
draw quad
probe all rgba (0, 0, 0, 0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform int4 f;
float4 main() : sv_target
@ -80,7 +80,7 @@ uniform 0 int4 1 2 3 4
draw quad
probe all rgba (1, 1, 1, 1)
[pixel shader]
[pixel shader todo(sm<4)]
uniform int2x2 f;
float4 main() : sv_target

View File

@ -1,5 +1,3 @@
[pixel shader]
float4 main() : sv_target
{
@ -109,7 +107,7 @@ draw quad
probe all rgba (0.028, 0.104, 0.216, 0.352) 6
[pixel shader]
[pixel shader todo(sm<4)]
// 4 division by zero warnings.
// Only test compilation because result is implementation-dependent.
float4 main() : sv_target

View File

@ -17,6 +17,7 @@ probe all rgba (0.8, 0.0, 0.0, 0.0)
[pixel shader fail(sm<6)]
// On SM1 this gives hr 0x88760b59.
static uint i;
float4 main() : sv_target
@ -135,7 +136,7 @@ float4 main(Texture2D tex2) : sv_target
}
[pixel shader]
[pixel shader todo(sm<4)]
Texture2D real_tex;
static Texture2D tex = real_tex;
sampler sam;
@ -146,11 +147,11 @@ float4 main() : sv_target
}
[test]
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (1, 2, 3, 4)
[pixel shader]
[pixel shader todo(sm<4)]
Texture2D real_tex;
static Texture2D tex;
sampler sam;
@ -162,7 +163,7 @@ float4 main() : sv_target
}
[test]
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (1, 2, 3, 4)

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 f, p;
float4 main() : sv_target
@ -9,7 +9,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 5.0 -2.6 3.0 2.0
uniform 4 float4 1.0 -4.3 3.0 4.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.0, 0.0, 1.0, 1.0)

View File

@ -3,7 +3,7 @@
shader model < 6.0
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 x;
float4 main() : sv_target
@ -13,14 +13,14 @@ float4 main() : sv_target
[test]
uniform 0 float4 2.0 3.0 4.0 5.0
draw quad
todo(sm<4) draw quad
probe all rgba (2.0, 3.0, 4.0, 5.0)
uniform 0 float4 0.0 10.0 11.0 12.0
draw quad
todo(sm<4) draw quad
probe all rgba (-1.0, 9.0, 10.0, 11.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 x;
float4 main() : sv_target
@ -35,11 +35,11 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.1 3.0 4.0 5.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.1, 2.0, 0.0, 0.0)
[pixel shader]
[pixel shader todo(sm<4)]
float4 f;
float4 main() : sv_target
@ -49,10 +49,9 @@ float4 main() : sv_target
return float4(f1, f2, f3, 0.0);
}
[test]
uniform 0 float4 1.0 0.0 0.0 0.0
draw quad
todo(sm<4) draw quad
probe all rgba (0.5, 0.6, 0.7, 0.0)
@ -68,7 +67,7 @@ float4 main() : sv_target
uniform 0 float4 0.0 1.0 0.0 -3.0
uniform 4 float4 1.0 2.0 3.0 4.0
uniform 8 float4 5.0 6.0 7.0 8.0
draw quad
todo(sm<4) draw quad
probe all rgba (5.0, 2.0, 7.0, 4.0)
@ -247,7 +246,7 @@ draw quad
probe all rgba (3.0, 3.0, 3.0, 3.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float cond;
uniform float4 a, b;
@ -261,7 +260,7 @@ float4 main() : sv_target
uniform 0 float4 1.0 0.0 0.0 0.0
uniform 4 float4 1.0 2.0 3.0 4.0
uniform 8 float4 5.0 6.0 7.0 8.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 2.0, 3.0, 4.0)
@ -296,7 +295,7 @@ float4 main() : sv_target
uniform 0 float4 1.0 0.0 1.0 0.0
uniform 4 float4 1.0 2.0 3.0 4.0
uniform 8 float4 5.0 6.0 7.0 8.0
draw quad
todo(sm<4) draw quad
probe all rgba (1.0, 5.0, 1.0, 5.0)

View File

@ -5,7 +5,7 @@ void main(float4 pos : position, out float tex : texcoord, out float4 out_pos :
out_pos = pos;
}
[pixel shader]
[pixel shader todo(sm<4)]
float4 main(float tex : texcoord) : sv_target
{
tex = floor(tex + 0.25);
@ -13,7 +13,7 @@ float4 main(float tex : texcoord) : sv_target
}
[test]
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe ( 0, 0) rgba ( 0.00000000, 1.00000000, 0.00000000, 0.0)
probe ( 1, 0) rgba ( 0.84147098, 0.54030231, 1.55740772, 0.0) 1024
probe ( 2, 0) rgba ( 0.90929743, -0.41614684, -2.18503986, 0.0) 1024
@ -32,7 +32,7 @@ probe (14, 0) rgba ( 0.99060736, 0.13673722, 7.24460662, 0.0) 1024
probe (15, 0) rgba ( 0.65028784, -0.75968791, -0.85599340, 0.0) 1024
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 a;
float4 main() : sv_target
@ -42,11 +42,11 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.0 0.52359877 2.61799387 3.14159265
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0.0, 500.0, 500.0, 0.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 a;
float4 main() : sv_target
@ -56,11 +56,11 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.0 0.78539816 1.57079632 2.35619449
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (1000.0, 707.0, -0.0, -707.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 a;
float4 main() : sv_target
@ -72,5 +72,5 @@ float4 main() : sv_target
% tan(pi/2) is an asymtote and therefore undefined
% so check 0, pi/4, 3pi/4, pi
uniform 0 float4 0.0 0.78539816 2.35619449 3.14159265
todo(sm>=6) draw quad
todo(sm<4 | sm>=6) draw quad
probe all rgba (0, 1000, -1000.0, 0)

View File

@ -1,4 +1,4 @@
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -8,13 +8,13 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 7.5 3.4
draw quad
todo(sm<4) draw quad
probe all rgba (0.0, 6.0, 7.0, 3.0)
uniform 0 float4 -1.5 6.5 7.5 3.4
draw quad
todo(sm<4) draw quad
probe all rgba (-1.0, 6.0, 7.0, 3.0)
[pixel shader]
[pixel shader todo(sm<4)]
uniform float4 u;
float4 main() : sv_target
@ -27,7 +27,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 7.5 3.4
draw quad
todo(sm<4) draw quad
probe all rgba (6.0, 7.0, 0.0, 3.0)
[require]

View File

@ -1,6 +1,6 @@
% Use a uniform to prevent the compiler from optimizing.
[pixel shader]
[pixel shader todo(sm<4)]
uniform float i;
float4 main() : SV_TARGET
{
@ -12,5 +12,5 @@ float4 main() : SV_TARGET
[test]
uniform 0 float 2
draw quad
todo(sm<4) draw quad
probe all rgba (0.5, 0.3, 0.8, 0.2)

View File

@ -968,8 +968,13 @@ unsigned int get_vb_stride(const struct shader_runner *runner, unsigned int slot
return stride;
}
static HRESULT map_unidentified_hrs(HRESULT hr)
static HRESULT map_special_hrs(HRESULT hr)
{
if (hr == 0x88760b59)
{
trace("Mapping hr %#x (D3DXERR_INVALIDDATA) as %#x.\n", hr, E_FAIL);
return E_FAIL;
}
if (hr == 0x80010064)
{
trace("Mapping unidentified hr %#x as %#x.\n", hr, E_FAIL);
@ -1116,8 +1121,8 @@ static void compile_shader(struct shader_runner *runner, IDxcCompiler3 *dxc_comp
static const char *const shader_models[] =
{
[SHADER_MODEL_2_0] = "4_0",
[SHADER_MODEL_3_0] = "4_0",
[SHADER_MODEL_2_0] = "2_0",
[SHADER_MODEL_3_0] = "3_0",
[SHADER_MODEL_4_0] = "4_0",
[SHADER_MODEL_4_1] = "4_1",
[SHADER_MODEL_5_0] = "5_0",
@ -1146,7 +1151,7 @@ static void compile_shader(struct shader_runner *runner, IDxcCompiler3 *dxc_comp
sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->minimum_shader_model]);
hr = D3DCompile(source, len, NULL, NULL, NULL, "main", profile, runner->compile_options, 0, &blob, &errors);
}
hr = map_unidentified_hrs(hr);
hr = map_special_hrs(hr);
ok(hr == expect, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
{

View File

@ -412,8 +412,8 @@ static bool compile_shader(struct vulkan_shader_runner *runner, const char *sour
static const char *const shader_models[] =
{
[SHADER_MODEL_2_0] = "4_0",
[SHADER_MODEL_3_0] = "4_0",
[SHADER_MODEL_2_0] = "2_0",
[SHADER_MODEL_3_0] = "3_0",
[SHADER_MODEL_4_0] = "4_0",
[SHADER_MODEL_4_1] = "4_1",
[SHADER_MODEL_5_0] = "5_0",
@ -424,7 +424,11 @@ static bool compile_shader(struct vulkan_shader_runner *runner, const char *sour
info.source.code = source;
info.source.size = strlen(source);
info.source_type = VKD3D_SHADER_SOURCE_HLSL;
info.target_type = VKD3D_SHADER_TARGET_DXBC_TPF;
if (runner->r.minimum_shader_model < SHADER_MODEL_4_0)
info.target_type = VKD3D_SHADER_TARGET_D3D_BYTECODE;
else
info.target_type = VKD3D_SHADER_TARGET_DXBC_TPF;
info.log_level = VKD3D_SHADER_LOG_WARNING;
info.options = options;
@ -468,7 +472,10 @@ static bool compile_shader(struct vulkan_shader_runner *runner, const char *sour
info.next = &spirv_info;
info.source = *dxbc;
info.source_type = VKD3D_SHADER_SOURCE_DXBC_TPF;
if (runner->r.minimum_shader_model < SHADER_MODEL_4_0)
info.source_type = VKD3D_SHADER_SOURCE_D3D_BYTECODE;
else
info.source_type = VKD3D_SHADER_SOURCE_DXBC_TPF;
info.target_type = VKD3D_SHADER_TARGET_SPIRV_BINARY;
spirv_info.next = &interface_info;
@ -1420,8 +1427,11 @@ void run_shader_tests_vulkan(void)
if (!init_vulkan_runner(&runner))
return;
trace("Compiling SM2-SM5 shaders with vkd3d-shader and executing with Vulkan\n");
run_shader_tests(&runner.r, &vulkan_runner_ops, NULL, SHADER_MODEL_2_0, SHADER_MODEL_5_1);
trace("Compiling SM2-SM3 shaders with vkd3d-shader and executing with Vulkan\n");
run_shader_tests(&runner.r, &vulkan_runner_ops, NULL, SHADER_MODEL_2_0, SHADER_MODEL_3_0);
trace("Compiling SM4-SM5 shaders with vkd3d-shader and executing with Vulkan\n");
run_shader_tests(&runner.r, &vulkan_runner_ops, NULL, SHADER_MODEL_4_0, SHADER_MODEL_5_1);
cleanup_vulkan_runner(&runner);
}