vkd3d-shader/msl: Implement support for VKD3DSPSM_NEG modifiers.

This commit is contained in:
Feifan He 2024-11-22 15:45:54 +08:00 committed by Henri Verbeet
parent 64ea19b7f7
commit 38d7f8415d
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
7 changed files with 10 additions and 7 deletions

View File

@ -294,6 +294,9 @@ static void msl_src_init(struct msl_src *msl_src, struct msl_generator *gen,
{
case VKD3DSPSM_NONE:
break;
case VKD3DSPSM_NEG:
vkd3d_string_buffer_printf(msl_src->str, "-%s", str->buffer);
break;
case VKD3DSPSM_ABS:
vkd3d_string_buffer_printf(msl_src->str, "abs(%s)", str->buffer);
break;

View File

@ -10,7 +10,7 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 5.0 15.0 0.0 0.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (20.0, -10.0, 75.0, 0.33333333) 1
[pixel shader]

View File

@ -12,7 +12,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 1 -2 3 4
uniform 4 float4 10 100 1000 10000
todo(msl) draw quad
draw quad
probe (0, 0) rgba (-2300, -970, 120, 0)
@ -29,5 +29,5 @@ float4 main() : sv_target
[test]
uniform 0 float4 1 -2 3 4
todo(msl) draw quad
draw quad
probe (0, 0) rgba (-20, 8, 12, 3.5)

View File

@ -35,7 +35,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
uniform 4 float4 5.0 6.0 7.0 8.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (-4.0, -4.0, -4.0, -4.0)
[pixel shader]

View File

@ -12,7 +12,7 @@ float4 main() : SV_TARGET
uniform 0 float4 2.0 3.0 4.0 5.0
uniform 4 float4 0.0 -10.0 10.0 100.0
uniform 8 float4 0.0 1.0 -1.0 0.75
todo(msl) draw quad
draw quad
probe (0, 0) rgba (2.0, -10.0, -2.0, 76.25)

View File

@ -14,5 +14,5 @@ float4 main() : SV_TARGET
[test]
uniform 0 float4 2.5 0.3 0.2 0.7
uniform 4 float4 0.1 1.5 0.0 0.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (-12.43, 9.833333, 1.6, 35.0) 1

View File

@ -62,7 +62,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.5 0.0 0.0 0.0
uniform 4 float4 0.6 0.0 0.0 0.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (0.14, 0.14, 0.14, 0.14) 4
[pixel shader]