tests/hlsl: Test integer division with big integers.

Similarly to the modulus operator, d3dbc results with constant folding
are different from results when constant folding cannot be applied, and
different from tpf results.
This commit is contained in:
Francisco Casas 2025-02-28 16:26:30 -03:00 committed by Henri Verbeet
parent 080672478d
commit e3923876c0
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
2 changed files with 60 additions and 0 deletions

View File

@ -137,6 +137,39 @@ todo(sm<4 | glsl | msl) draw quad
if(sm<4) probe (0, 0) rgba(6, 6, -6, -6)
if(sm>=4) probe (0, 0) rgba(7, 7, -7, -7)
[pixel shader todo(sm<4)]
float f;
float4 main() : sv_target
{
int a = 16782201; // This rounds down to 16782200 when converted to float.
int b = f;
return float4(a / b, a / (-b), (-a) / b, (-a) / (-b));
}
[test]
uniform 0 float 999.0
todo(sm<4 | glsl | msl) draw quad
if(sm<4) probe (0, 0) rgba(16798, -16798, -16798, 16798)
if(sm>=4) probe (0, 0) rgba(16799, -16799, -16799, 16799)
[pixel shader todo(sm<4)]
float f;
float4 main() : sv_target
{
int a = 16782200;
int b = f;
return float4(a / b, a / (-b), (-a) / b, (-a) / (-b));
}
[test]
uniform 0 float 999.0
todo(sm<4 | glsl | msl) draw quad
probe (0, 0) rgba(16798, -16798, -16798, 16798)
[require]
shader model >= 6.0
int64

View File

@ -179,3 +179,30 @@ float4 main() : sv_target
draw quad
todo if(sm<4) probe (0, 0) rgba(7, 7, -6, -6)
if(sm>=4) probe (0, 0) rgba(7, 7, -7, -7)
[pixel shader]
float4 main() : sv_target
{
int a = 16782201; // This rounds down to 16782200 when converted to float.
int b = 999;
return float4(a / b, a / (-b), (-a) / b, (-a) / (-b));
}
[test]
draw quad
if(sm<4) todo probe (0, 0) rgba(16799, -16799, -16798, 16798)
if(sm>=4) probe (0, 0) rgba(16799, -16799, -16799, 16799)
[pixel shader]
float4 main() : sv_target
{
int a = 16782200;
int b = 999;
return float4(a / b, a / (-b), (-a) / b, (-a) / (-b));
}
[test]
draw quad
probe (0, 0) rgba(16798, -16798, -16798, 16798)