tests: Add some tests for HLSL storage qualifiers.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-05-10 23:36:06 -05:00 committed by Alexandre Julliard
parent 07fb4ea1ae
commit 4d4aeb9bb4
3 changed files with 82 additions and 0 deletions

View File

@ -64,6 +64,7 @@ vkd3d_shader_tests = \
tests/hlsl-return-implicit-conversion.shader_test \
tests/hlsl-return-void.shader_test \
tests/hlsl-static-initializer.shader_test \
tests/hlsl-storage-qualifiers.shader_test \
tests/hlsl-struct-assignment.shader_test \
tests/hlsl-struct-semantics.shader_test \
tests/hlsl-vector-indexing.shader_test \
@ -261,6 +262,7 @@ XFAIL_TESTS = \
tests/hlsl-return-implicit-conversion.shader_test \
tests/hlsl-return-void.shader_test \
tests/hlsl-static-initializer.shader_test \
tests/hlsl-storage-qualifiers.shader_test \
tests/hlsl-struct-assignment.shader_test \
tests/hlsl-struct-semantics.shader_test \
tests/hlsl-vector-indexing.shader_test \

View File

@ -121,6 +121,12 @@ float4 main(in float4 i) : sv_target
return 0;
}
[pixel shader fail]
float4 main(float4 i) : sv_target
{
return 0;
}
[pixel shader fail]
struct {float4 a;};
@ -159,3 +165,57 @@ void main(out struct output o)
o.t = float4(0, 0, 0, 0);
o.a = 0;
}
[pixel shader fail]
uniform in float4 f;
float4 main() : sv_target { return 0; }
[pixel shader fail]
in float4 f;
float4 main() : sv_target { return 0; }
[pixel shader fail]
static uniform float4 f;
float4 main() : sv_target { return 0; }
[pixel shader fail]
void main(out uniform float4 o : sv_target)
{
o = 0;
}
[pixel shader fail]
void sub(out uniform float4 o)
{
o = 0;
}
void main(out float4 o : sv_target)
{
sub(o);
}
[pixel shader fail]
void sub(in out uniform float4 o)
{
}
void main(out float4 o : sv_target)
{
o = 0;
sub(o);
}
[pixel shader fail]
float4 main(void) : sv_target
{
uniform float f;
return 0;
}
[pixel shader fail]
float4 main(void) : sv_target
{
in float f;
return 0;
}

View File

@ -0,0 +1,20 @@
[pixel shader]
void sub2(in uniform float4 i, out float4 o)
{
o = i;
}
void sub(float a, uniform float b, in float c, uniform in float d, out float4 o)
{
sub2(float4(a, b, c, d), o);
}
void main(in uniform float a, uniform float b, out float4 o : sv_target)
{
sub(a, b, 0.3, 0.4, o);
}
[test]
uniform 0 float4 0.1 0.2 0.0 0.0
draw quad
probe all rgba (0.1, 0.2, 0.3, 0.4)