vkd3d-shader/msl: Implement VKD3DSIH_MAD.

This commit is contained in:
Feifan He 2024-12-03 01:09:44 +08:00 committed by Henri Verbeet
parent 8e0de82c74
commit a425c242a4
Notes: Henri Verbeet 2024-12-05 21:36:59 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1302
2 changed files with 5 additions and 2 deletions

View File

@ -648,6 +648,9 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
case VKD3DSIH_LTO: case VKD3DSIH_LTO:
msl_relop(gen, ins, "<"); msl_relop(gen, ins, "<");
break; break;
case VKD3DSIH_MAD:
msl_intrinsic(gen, ins, "fma");
break;
case VKD3DSIH_MAX: case VKD3DSIH_MAX:
msl_intrinsic(gen, ins, "max"); msl_intrinsic(gen, ins, "max");
break; break;

View File

@ -103,7 +103,7 @@ float4 main() : sv_target
uniform 0 float4 1.00000007 -42.1 4.0 45.0 uniform 0 float4 1.00000007 -42.1 4.0 45.0
uniform 4 float4 1.625 -5.0 4.125 5.0 uniform 4 float4 1.625 -5.0 4.125 5.0
uniform 8 float4 1.00000007 -1.0 0.5 -0.5 uniform 8 float4 1.00000007 -1.0 0.5 -0.5
todo(msl) draw quad draw quad
probe (0, 0) rgba (2.62500024, 209.5, 17.0, 224.5) 1 probe (0, 0) rgba (2.62500024, 209.5, 17.0, 224.5) 1
% precise mad() is not allowed to fuse, even though unfused is less precise. % precise mad() is not allowed to fuse, even though unfused is less precise.
@ -120,7 +120,7 @@ float4 main() : sv_target
uniform 0 float4 1.00000007 -42.1 4.0 45.0 uniform 0 float4 1.00000007 -42.1 4.0 45.0
uniform 4 float4 1.625 -5.0 4.125 5.0 uniform 4 float4 1.625 -5.0 4.125 5.0
uniform 8 float4 1.00000007 -1.0 0.5 -0.5 uniform 8 float4 1.00000007 -1.0 0.5 -0.5
todo(msl) draw quad draw quad
probe (0, 0) rgba (2.62500048, 209.5, 17.0, 224.5) 1 probe (0, 0) rgba (2.62500048, 209.5, 17.0, 224.5) 1
[require] [require]