vkd3d-shader/msl: Implement VKD3DSIH_DIV.

This commit is contained in:
Feifan He 2024-11-22 15:45:54 +08:00 committed by Henri Verbeet
parent b7605f1c34
commit 64ea19b7f7
Notes: Henri Verbeet 2024-11-25 21:02:08 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1277
3 changed files with 14 additions and 11 deletions

View File

@ -445,6 +445,9 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
case VKD3DSIH_DCL_OUTPUT_SIV:
case VKD3DSIH_NOP:
break;
case VKD3DSIH_DIV:
msl_binop(gen, ins, "/");
break;
case VKD3DSIH_INE:
case VKD3DSIH_NEU:
msl_relop(gen, ins, "!=");

View File

@ -88,7 +88,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 1.0 0.0 0.0 0.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1e99, 1e99, 1e99, 1e99)
[pixel shader]

View File

@ -8,24 +8,24 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 0.5, 0.3333333, 0.25) 8
uniform 0 float4 -1.0 -2.0 -3.0 -4.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (-1.0, -0.5, -0.3333333, -0.25) 8
uniform 0 float4 12.34 56.78 -90.12 -34.56
todo(msl) draw quad
draw quad
probe (0, 0) rgba (0.081037275, 0.017611835, -0.011096316, -0.028935184) 8
uniform 0 float4 0.25 0.125 0.0625 0.3333333
todo(msl) draw quad
draw quad
probe (0, 0) rgba (4.0, 8.0, 16.0, 3.0) 8
% Degenerate cases
uniform 0 float4 0.0 -0.0 1.0e39 -1.0e39
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0e39, -1.0e39, 0.0, -0.0) 8
@ -40,15 +40,15 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0) 8
uniform 0 float4 7.604 3.1415 2.72 9.876
todo(msl) draw quad
draw quad
probe (0, 0) rgba (7.604, 3.1415, 2.72, 9.876) 8
uniform 0 float4 0.0 -0.0 1.0e39 -1.0e39
todo(msl) draw quad
draw quad
probe (0, 0) rgba (0.0, -0.0, 1.0e39, -1.0e39)
@ -68,9 +68,9 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 0.5, 0.3333333, 0.25) 8
uniform 0 float4 -1.0 -2.0 -3.0 -4.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (-1.0, -0.5, -0.3333333, -0.25) 8