vkd3d-shader/msl: Implement VKD3DSIH_SQRT.

This commit is contained in:
Feifan He 2024-11-22 15:45:54 +08:00 committed by Henri Verbeet
parent 77ed788a60
commit 8ae6a04561
Notes: Henri Verbeet 2024-12-03 14:57:01 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1291
5 changed files with 24 additions and 21 deletions

View File

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

View File

@ -10,7 +10,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 -2.0 3.0 4.0 0.1
uniform 4 float4 2.0 -1.0 4.0 5.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (7.483983, 7.483983, 7.483983, 7.483983) 1
[pixel shader]

View File

@ -8,7 +8,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 3.0 4.0 5.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (7.34846926, 7.34846926, 7.34846926, 7.34846926) 1
[pixel shader]
@ -21,7 +21,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 3.0 4.0 0.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (5.38516474, 5.38516474, 5.38516474, 5.38516474) 1
[pixel shader]
@ -34,7 +34,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 3.0 0.0 0.0
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (3.60555124, 3.60555124, 3.60555124, 3.60555124) 1
[pixel shader]
@ -47,7 +47,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 0.0 0.0 0.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (2.0, 2.0, 2.0, 2.0)
[pixel shader]
@ -60,7 +60,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.0 0.0 0.0 0.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (2.0, 2.0, 2.0, 2.0)
[pixel shader fail]

View File

@ -12,10 +12,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2
todo(msl) draw quad
draw quad
probe (0, 0) rgba (-0.550931, -0.453954, 0.3654653, -1.0248856) 32
uniform 8 float 100.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]
@ -34,10 +34,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32
uniform 8 float 100.0
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]
@ -55,10 +55,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32
uniform 8 float 100.0
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]
@ -76,10 +76,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32
uniform 8 float 100.0
todo(sm<4 | msl) draw quad
todo(sm<4) draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]
@ -98,10 +98,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2
todo(msl) draw quad
draw quad
probe (0, 0) rgba (-0.524978, 0.0, 0.0, 0.0) 32
uniform 8 float 100.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]
@ -118,10 +118,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2
todo(msl) draw quad
draw quad
probe (0, 0) rgba (-0.5562381, -0.6762381, -0.6162381, -0.5962381) 32
uniform 8 float 100.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader fail(sm>=6)]
@ -138,10 +138,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float4 0.2 0.3 0.4 0.5
if(sm<6) todo(msl) draw quad
if(sm<6) draw quad
if(sm<6) probe (0,0) rgba (-0.550931, -0.453954, 0.3654653, -1.0248856) 32
uniform 8 float 100.0
if(sm<6) todo(msl) draw quad
if(sm<6) draw quad
if(sm<6) probe (0,0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader fail]

View File

@ -8,7 +8,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 9.0 32.3 46.5
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 3.0, 5.683309, 6.819091) 1
[pixel shader]