vkd3d-shader/msl: Implement VKD3DSIH_OR.

This commit is contained in:
Feifan He 2024-11-22 15:45:54 +08:00 committed by Henri Verbeet
parent f2a32589ea
commit b7605f1c34
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
2 changed files with 16 additions and 13 deletions

View File

@ -455,6 +455,9 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
case VKD3DSIH_MUL:
msl_binop(gen, ins, "*");
break;
case VKD3DSIH_OR:
msl_binop(gen, ins, "|");
break;
case VKD3DSIH_RET:
msl_ret(gen, ins);
break;

View File

@ -8,25 +8,25 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 1.0 1.0 1.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 1.0 0.0 0.0 0.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 1.0 0.0 0.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 0.0 1.0 0.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 0.0 0.0 1.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 0.0 0.0 0.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
uniform 0 float4 -1.0 -1.0 -1.0 -1.0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader]
@ -60,27 +60,27 @@ float4 main() : sv_target
[test]
if(sm<4) uniform 0 float4 1 1 1 1
if(sm>=4) uniform 0 uint4 1 1 1 1
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
if(sm<4) uniform 0 float4 1 0 0 0
if(sm>=4) uniform 0 uint4 1 0 0 0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
if(sm<4) uniform 0 float4 0 1 0 0
if(sm>=4) uniform 0 uint4 0 1 0 0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
if(sm<4) uniform 0 float4 0 0 1 0
if(sm>=4) uniform 0 uint4 0 0 1 0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
if(sm<4) uniform 0 float4 0 0 0 1
if(sm>=4) uniform 0 uint4 0 0 0 1
todo(msl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
if(sm<4) uniform 0 float4 0 0 0 0
if(sm>=4) uniform 0 uint4 0 0 0 0
todo(msl) draw quad
draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]