vkd3d-shader/hlsl: Fold constant division.

This commit includes work by Francisco Casas.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Giovanni Mascellani
2022-04-14 12:52:39 +02:00
committed by Alexandre Julliard
parent aefadb87b6
commit 40b299c727
5 changed files with 104 additions and 1 deletions

View File

@@ -23,3 +23,19 @@ float4 main() : SV_TARGET
[test]
todo draw quad
probe all rgba (5.0, 5.0, -5.0, 3.0)
[require]
shader model >= 4.0
[pixel shader]
float4 main() : SV_TARGET
{
float x = 1;
float y = 0;
return x / y;
}
[test]
draw quad
probe all rgba (1e99, 1e99, 1e99, 1e99)

View File

@@ -8,7 +8,7 @@ float4 main() : SV_TARGET
}
[test]
todo draw quad
draw quad
probe all rgba (20.0, -10.0, 75.0, 0.0)
[pixel shader]
@@ -23,3 +23,12 @@ float4 main() : SV_TARGET
[test]
todo draw quad
probe all rgba (5.0, 5.0, -5.0, 3.0)
[pixel shader fail]
float4 main() : SV_TARGET
{
int x = 1;
int y = 0;
return x / y;
}

View File

@@ -26,3 +26,12 @@ float4 main() : SV_TARGET
[test]
draw quad
probe all rgba (5.0, 5.0, 4294967296.0, 3.0)
[pixel shader fail]
float4 main() : SV_TARGET
{
uint x = 1;
uint y = 0;
return x / y;
}