mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
tests/hlsl: Test for loss of precision on integer negation in d3dbc target profiles.
This commit is contained in:
committed by
Henri Verbeet
parent
bc382c6835
commit
a3f80061b1
Notes:
Henri Verbeet
2025-03-18 16:03:46 +01:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1427
@@ -137,3 +137,31 @@ float4 main() : sv_target
|
|||||||
[test]
|
[test]
|
||||||
draw quad
|
draw quad
|
||||||
probe (0, 0) rgba (2.0, 3.0, 1.0, 3.0)
|
probe (0, 0) rgba (2.0, 3.0, 1.0, 3.0)
|
||||||
|
|
||||||
|
% On SM1, negation constant folding is performed with float arithmetic.
|
||||||
|
[pixel shader]
|
||||||
|
float4 main() : sv_target
|
||||||
|
{
|
||||||
|
int a = -2147483648;
|
||||||
|
|
||||||
|
return int4(a, -a, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
[test]
|
||||||
|
draw quad
|
||||||
|
todo if(sm<4) probe (0, 0) rgba(-2147483648.0, 2147483648.0, 0, 0)
|
||||||
|
if(sm>=4) probe (0, 0) rgba(-2147483648.0, -2147483648.0, 0, 0)
|
||||||
|
|
||||||
|
% Note that the negation here causes loss of precision on SM1.
|
||||||
|
[pixel shader]
|
||||||
|
float4 main() : sv_target
|
||||||
|
{
|
||||||
|
int a = 16782201; // This rounds down to 16782200 when converted to float.
|
||||||
|
|
||||||
|
return float4(a + 1, (-(-a)) + 1, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
[test]
|
||||||
|
draw quad
|
||||||
|
todo if(sm<4) probe (0, 0) rgba(16782202, 16782200, 0, 0)
|
||||||
|
if(sm>=4) probe (0, 0) rgba(16782202, 16782202, 0, 0)
|
||||||
|
Reference in New Issue
Block a user