mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
tests: Adjust arithmetic-float-uniform.shader_test to pass with 1.x.
Pixel shader 1.x constants must be between -1 and 1, or they will be clamped, even constants defined in the shader. Also mark 1.x-specific features if any.
This commit is contained in:
parent
8b4f0f348a
commit
fb75c0530a
Notes:
Henri Verbeet
2025-01-22 15:03:30 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1324
@ -1,34 +1,37 @@
|
|||||||
[pixel shader]
|
[pixel shader]
|
||||||
uniform float2 a;
|
uniform float2 a;
|
||||||
|
|
||||||
|
float4 main() : SV_TARGET
|
||||||
|
{
|
||||||
|
float x = +a.x;
|
||||||
|
float y = a.y;
|
||||||
|
return float4(x + y, x - y, x * y, -y);
|
||||||
|
}
|
||||||
|
|
||||||
|
[test]
|
||||||
|
uniform 0 float4 0.05 0.15 0.0 0.0
|
||||||
|
draw quad
|
||||||
|
probe (0, 0) rgba (0.20, -0.10, 0.0075, -0.15) 1
|
||||||
|
|
||||||
|
|
||||||
|
% 1.x has no division or modulo.
|
||||||
|
[pixel shader notimpl(sm<2)]
|
||||||
|
uniform float2 a;
|
||||||
|
|
||||||
float4 main() : SV_TARGET
|
float4 main() : SV_TARGET
|
||||||
{
|
{
|
||||||
float x = a.x;
|
float x = a.x;
|
||||||
float y = a.y;
|
float y = a.y;
|
||||||
return float4(x + y, x - y, x * y, x / y);
|
return float4(x / y, -x / y, x / -y, -x / -y);
|
||||||
}
|
}
|
||||||
|
|
||||||
[test]
|
[test]
|
||||||
uniform 0 float4 5.0 15.0 0.0 0.0
|
uniform 0 float4 42.0 5.0 0.0 0.0
|
||||||
draw quad
|
draw quad
|
||||||
probe (0, 0) rgba (20.0, -10.0, 75.0, 0.33333333) 1
|
probe (0, 0) rgba (8.4, -8.4, -8.4, 8.4) 16
|
||||||
|
|
||||||
[pixel shader]
|
|
||||||
uniform float2 a;
|
|
||||||
|
|
||||||
float4 main() : SV_TARGET
|
[pixel shader fail(sm<2)]
|
||||||
{
|
|
||||||
float x = a.x;
|
|
||||||
float y = a.y;
|
|
||||||
return float4(x % y, +x, -x, y / x);
|
|
||||||
}
|
|
||||||
|
|
||||||
[test]
|
|
||||||
uniform 0 float4 5.0 15.0 0.0 0.0
|
|
||||||
draw quad
|
|
||||||
probe (0, 0) rgba (5.0, 5.0, -5.0, 3.0) 1
|
|
||||||
|
|
||||||
[pixel shader]
|
|
||||||
uniform float2 a;
|
uniform float2 a;
|
||||||
|
|
||||||
float4 main() : SV_TARGET
|
float4 main() : SV_TARGET
|
||||||
@ -43,7 +46,8 @@ uniform 0 float4 42.0 5.0 0.0 0.0
|
|||||||
draw quad
|
draw quad
|
||||||
probe (0, 0) rgba (2.0, -2.0, 2.0, -2.0) 16
|
probe (0, 0) rgba (2.0, -2.0, 2.0, -2.0) 16
|
||||||
|
|
||||||
[pixel shader]
|
|
||||||
|
[pixel shader fail(sm<2)]
|
||||||
uniform float2 a;
|
uniform float2 a;
|
||||||
|
|
||||||
float4 main() : SV_TARGET
|
float4 main() : SV_TARGET
|
||||||
@ -58,7 +62,8 @@ uniform 0 float4 45.0 5.0 0.0 0.0
|
|||||||
draw quad
|
draw quad
|
||||||
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
|
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
|
||||||
|
|
||||||
[pixel shader]
|
|
||||||
|
[pixel shader fail(sm<2)]
|
||||||
float4 x, y;
|
float4 x, y;
|
||||||
|
|
||||||
float4 main() : sv_target
|
float4 main() : sv_target
|
||||||
@ -72,11 +77,8 @@ uniform 4 float4 15.0 -5.0 4.1 5.0
|
|||||||
draw quad
|
draw quad
|
||||||
probe (0, 0) rgba (5.0, -2.1, 4.0, 0.0) 6
|
probe (0, 0) rgba (5.0, -2.1, 4.0, 0.0) 6
|
||||||
|
|
||||||
[require]
|
|
||||||
% Infinities are not allowed in SM1
|
|
||||||
shader model >= 4.0
|
|
||||||
|
|
||||||
[pixel shader]
|
[pixel shader notimpl(sm<2)]
|
||||||
uniform float2 a;
|
uniform float2 a;
|
||||||
|
|
||||||
float4 main() : SV_TARGET
|
float4 main() : SV_TARGET
|
||||||
@ -91,7 +93,9 @@ uniform 0 float4 1.0 0.0 0.0 0.0
|
|||||||
draw quad
|
draw quad
|
||||||
probe (0, 0) rgba (1e99, 1e99, 1e99, 1e99)
|
probe (0, 0) rgba (1e99, 1e99, 1e99, 1e99)
|
||||||
|
|
||||||
[pixel shader]
|
|
||||||
|
% d3dx9/d3dcompiler < 41 does not have mad().
|
||||||
|
[pixel shader fail(sm<2)]
|
||||||
uniform float4 a, b, c;
|
uniform float4 a, b, c;
|
||||||
|
|
||||||
float4 main() : sv_target
|
float4 main() : sv_target
|
||||||
@ -107,7 +111,7 @@ draw quad
|
|||||||
probe (0, 0) rgba (2.62500024, 209.5, 17.0, 224.5) 1
|
probe (0, 0) rgba (2.62500024, 209.5, 17.0, 224.5) 1
|
||||||
|
|
||||||
% precise mad() is not allowed to fuse, even though unfused is less precise.
|
% precise mad() is not allowed to fuse, even though unfused is less precise.
|
||||||
[pixel shader]
|
[pixel shader fail(sm<2)]
|
||||||
uniform float4 a, b, c;
|
uniform float4 a, b, c;
|
||||||
|
|
||||||
float4 main() : sv_target
|
float4 main() : sv_target
|
||||||
|
Loading…
x
Reference in New Issue
Block a user