vkd3d-shader/glsl: Implement VKD3DSIH_ILT.

This commit is contained in:
Henri Verbeet 2024-09-29 22:47:21 +02:00
parent 68492e704f
commit 4dec4e9959
Notes: Henri Verbeet 2024-10-03 19:35:31 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1143
4 changed files with 11 additions and 10 deletions

View File

@ -1073,6 +1073,10 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_MAD:
shader_glsl_intrinsic(gen, ins, "fma");
break;
case VKD3DSIH_ILT:
case VKD3DSIH_LTO:
shader_glsl_relop(gen, ins, "<", "lessThan");
break;
case VKD3DSIH_ISHL:
shader_glsl_binop(gen, ins, "<<");
break;
@ -1080,9 +1084,6 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_USHR:
shader_glsl_binop(gen, ins, ">>");
break;
case VKD3DSIH_LTO:
shader_glsl_relop(gen, ins, "<", "lessThan");
break;
case VKD3DSIH_MAX:
shader_glsl_intrinsic(gen, ins, "max");
break;

View File

@ -145,19 +145,19 @@ if(sm<4) uniform 0 float 8
if(sm<4) uniform 4 float 9
if(sm>=4) uniform 0 int 8
if(sm>=4) uniform 1 int 9
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (-1.0, -1.0, -1.0, -1.0)
if(sm<4) uniform 0 float -3
if(sm<4) uniform 4 float -4
if(sm>=4) uniform 0 int -3
if(sm>=4) uniform 1 int -4
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
if(sm<4) uniform 0 float 7
if(sm<4) uniform 4 float 7
if(sm>=4) uniform 0 int 7
if(sm>=4) uniform 1 int 7
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)

View File

@ -171,11 +171,11 @@ if(sm<4) uniform 0 float 5
if(sm<4) uniform 4 float 0
if(sm>=4) uniform 0 int 5
if(sm>=4) uniform 1 int 0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (1.0, 1.0, 0.0, 1.0)
if(sm<4) uniform 0 float -1
if(sm<4) uniform 4 float 3
if(sm>=4) uniform 0 int -1
if(sm>=4) uniform 1 int 3
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (0.0, 1.0, 0.0, 0.0)

View File

@ -49,12 +49,12 @@ void main(out float4 res : COLOR1, in float4 pos : position, out float4 out_pos
if(sm<4) uniform 0 float 3
if(sm<4) uniform 4 float 4
if(sm>=4) uniform 0 int4 3 4 0 0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (0.0, 1.0, 0.0, 1.0)
if(sm<4) uniform 0 float -2
if(sm<4) uniform 4 float -2
if(sm>=4) uniform 0 int4 -2 -2 0 0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (1.0, 0.0, 0.0, 1.0)