vkd3d-shader/msl: Implement VKD3DSIH_ROUND_NE.

This commit is contained in:
Feifan He 2024-12-03 00:09:01 +08:00 committed by Henri Verbeet
parent 610a11ddf8
commit 568296c88f
Notes: Henri Verbeet 2024-12-04 14:44:01 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1294
3 changed files with 11 additions and 8 deletions

View File

@ -624,6 +624,9 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
case VKD3DSIH_RET: case VKD3DSIH_RET:
msl_ret(gen, ins); msl_ret(gen, ins);
break; break;
case VKD3DSIH_ROUND_NE:
msl_intrinsic(gen, ins, "rint");
break;
case VKD3DSIH_ROUND_NI: case VKD3DSIH_ROUND_NI:
msl_intrinsic(gen, ins, "floor"); msl_intrinsic(gen, ins, "floor");
break; break;

View File

@ -44,7 +44,7 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 -1.0 0.0 0.0 0.0 uniform 0 float4 -1.0 0.0 0.0 0.0
todo(msl) draw quad draw quad
probe (0, 0) rgba (-31416.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (-31416.0, 0.0, 0.0, 0.0)
[require] [require]
@ -52,15 +52,15 @@ shader model < 6.0
[test] [test]
uniform 0 float4 -0.5 0.0 0.0 0.0 uniform 0 float4 -0.5 0.0 0.0 0.0
todo(msl) draw quad draw quad
probe (0, 0) rgba (-10473.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (-10473.0, 0.0, 0.0, 0.0)
uniform 0 float4 0.0 0.0 0.0 0.0 uniform 0 float4 0.0 0.0 0.0 0.0
todo(msl) draw quad draw quad
probe (0, 0) rgba (1.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (1.0, 0.0, 0.0, 0.0)
uniform 0 float4 0.5 0.0 0.0 0.0 uniform 0 float4 0.5 0.0 0.0 0.0
todo(msl) draw quad draw quad
probe (0, 0) rgba (10473.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (10473.0, 0.0, 0.0, 0.0)
[require] [require]
@ -88,7 +88,7 @@ probe (0, 0) rgba (10472.0, 0.0, 0.0, 0.0) 4096
[test] [test]
uniform 0 float4 1.0 0.0 0.0 0.0 uniform 0 float4 1.0 0.0 0.0 0.0
todo(msl) draw quad draw quad
probe (0, 0) rgba (31416.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (31416.0, 0.0, 0.0, 0.0)

View File

@ -8,7 +8,7 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 -0.4 -6.6 7.6 3.4 uniform 0 float4 -0.4 -6.6 7.6 3.4
todo(msl) draw quad draw quad
probe (0, 0) rgba (0.0, -7.0, 8.0, 3.0) 4 probe (0, 0) rgba (0.0, -7.0, 8.0, 3.0) 4
@ -26,7 +26,7 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 -0.4 -6.6 7.6 3.4 uniform 0 float4 -0.4 -6.6 7.6 3.4
todo(msl) draw quad draw quad
probe (0, 0) rgba (-7.0, 8.0, 0.0, 3.0) 4 probe (0, 0) rgba (-7.0, 8.0, 0.0, 3.0) 4
@ -42,5 +42,5 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 -1 0 2 10 uniform 0 float4 -1 0 2 10
todo(msl) draw quad draw quad
probe (0, 0) rgba (-1.0, 0.0, 2.0, 10.0) 4 probe (0, 0) rgba (-1.0, 0.0, 2.0, 10.0) 4