vkd3d-shader/msl: Implement VKD3DSIH_ROUND_Z.

This commit is contained in:
Feifan He 2024-11-22 15:45:54 +08:00 committed by Henri Verbeet
parent 778382cd94
commit 9619582d1b
Notes: Henri Verbeet 2024-11-27 14:12:36 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1283
4 changed files with 11 additions and 8 deletions

View File

@ -548,6 +548,9 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
case VKD3DSIH_ROUND_PI:
msl_intrinsic(gen, ins, "ceil");
break;
case VKD3DSIH_ROUND_Z:
msl_intrinsic(gen, ins, "trunc");
break;
default:
msl_unhandled(gen, ins);
break;

View File

@ -11,7 +11,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 7.5 3.4
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1912.0, 1657.0, -127.0, 867.0) 1
[pixel shader]
@ -24,5 +24,5 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 7.5 3.4
todo(msl) draw quad
draw quad
probe (0, 0) rgba (-127.0, -127.0, -127.0, -127.0) 1

View File

@ -9,7 +9,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.2 1.7 -1.2 -1.7
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (0.2, 0.7, -0.2, -0.7) 4
[pixel shader todo(sm<4)]
@ -24,5 +24,5 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.2 2.7 -1.2 -2.7
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (1.0, 2.0, -1.0, -2.0)

View File

@ -8,10 +8,10 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 7.5 3.4
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (0.0, 6.0, 7.0, 3.0)
uniform 0 float4 -1.5 6.5 7.5 3.4
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (-1.0, 6.0, 7.0, 3.0)
[pixel shader todo(sm<4)]
@ -27,7 +27,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 7.5 3.4
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (6.0, 7.0, 0.0, 3.0)
@ -45,5 +45,5 @@ float4 main() : sv_target
[test]
if(sm<4) uniform 0 float4 -1 6 7 3
if(sm>=4) uniform 0 int4 -1 6 7 3
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (6.0, 7.0, -1.0, 3.0)