mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
tests/hlsl: Test shader model 6.2 denormal mode for 16-bit and 64-bit floats.
This commit is contained in:
committed by
Henri Verbeet
parent
69c109786b
commit
b835510010
Notes:
Henri Verbeet
2025-10-30 20:00:32 +01:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1809
@@ -509,3 +509,60 @@ probe (0, 0) u32(0x02081cea, 0x00000000, 0x0554ad2e, 0x00000000) % f32(1.0e-37,
|
|||||||
uniform 0 uint4 0x000ae398 0x3c23d70a 0 0 % f32(1.0e-39, 0.01, 0, 0)
|
uniform 0 uint4 0x000ae398 0x3c23d70a 0 0 % f32(1.0e-39, 0.01, 0, 0)
|
||||||
draw quad
|
draw quad
|
||||||
probe (0, 0) u32(0x000ae398, 0x00000000, 0x00000000, 0x00000000) % f32(1.0e-39, 0.0, 0.0, 0.0)
|
probe (0, 0) u32(0x000ae398, 0x00000000, 0x00000000, 0x00000000) % f32(1.0e-39, 0.0, 0.0, 0.0)
|
||||||
|
|
||||||
|
[rtv 0]
|
||||||
|
format r32g32b32a32-uint
|
||||||
|
size (2d, 640, 480)
|
||||||
|
|
||||||
|
% Per the specification, the dernom mode only applies to f32;
|
||||||
|
% f64 and f16 are always supposed to preserve denormals. Tests agree.
|
||||||
|
|
||||||
|
[require]
|
||||||
|
shader model >= 6.2
|
||||||
|
float64
|
||||||
|
|
||||||
|
[pixel shader]
|
||||||
|
uniform double f;
|
||||||
|
|
||||||
|
uint4 main() : SV_Target
|
||||||
|
{
|
||||||
|
uint4 ret;
|
||||||
|
double2 d = double2(f / 100.0, f * 100.0);
|
||||||
|
asuint(d.x, ret.x, ret.y);
|
||||||
|
asuint(d.y, ret.z, ret.w);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
[test]
|
||||||
|
denorm preserve
|
||||||
|
uniform 0 uint64_t2 0x0031fa182c40c60d 0 % f64(1e-307, 0)
|
||||||
|
draw quad
|
||||||
|
todo(llvmpipe) probe (0, 0) u64(0x0000b8157268fdaf, 0x009c16c5c5253574) % f64(1e-309, 9.999999999999999e-306)
|
||||||
|
|
||||||
|
denorm ftz
|
||||||
|
uniform 0 uint64_t2 0x0031fa182c40c60d 0 % f64(1e-307, 0)
|
||||||
|
draw quad
|
||||||
|
todo(llvmpipe) probe (0, 0) u64(0x0000b8157268fdaf, 0x009c16c5c5253574) % f64(1e-309, 9.999999999999999e-306)
|
||||||
|
|
||||||
|
[require]
|
||||||
|
shader model >= 6.2
|
||||||
|
native-16-bit
|
||||||
|
|
||||||
|
[pixel shader]
|
||||||
|
uniform half2 f;
|
||||||
|
|
||||||
|
float4 main() : SV_Target
|
||||||
|
{
|
||||||
|
return half4(f.x, f.x / 100.0h, f.x * 100.0h, f.x / f.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
[test]
|
||||||
|
denorm preserve
|
||||||
|
uniform 0 uint 0x5640068d % half2 1e-4 100.0
|
||||||
|
draw quad
|
||||||
|
probe (0, 0) f32(9.99569893e-005, 1.01327896e-006, 9.99450684e-003, 1.01327896e-006)
|
||||||
|
|
||||||
|
denorm ftz
|
||||||
|
uniform 0 uint 0x5640068d % half2 1e-4 100.0
|
||||||
|
draw quad
|
||||||
|
probe (0, 0) f32(9.99569893e-005, 1.01327896e-006, 9.99450684e-003, 1.01327896e-006)
|
||||||
|
|||||||
Reference in New Issue
Block a user