vkd3d-shader/glsl: Implement VKD3DSIH_LTO.

This commit is contained in:
Henri Verbeet 2024-05-03 01:29:23 +02:00
parent 44e96ad4d6
commit 466c8bfbb7
Notes: Henri Verbeet 2024-09-26 17:49:23 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1117
5 changed files with 17 additions and 14 deletions

View File

@ -740,6 +740,9 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_GEO:
shader_glsl_relop(gen, ins, ">=", "greaterThanEqual");
break;
case VKD3DSIH_LTO:
shader_glsl_relop(gen, ins, "<", "lessThan");
break;
case VKD3DSIH_INE:
case VKD3DSIH_NEU:
shader_glsl_relop(gen, ins, "!=", "notEqual");

View File

@ -12,41 +12,41 @@ float4 main() : sv_target
uniform 0 float4 10.0 20.0 30.0 40.0
uniform 4 float4 1.0 0.0 0.0 0.0
uniform 8 float4 1.0 0.2 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (-10.0, -20.0, -30.0, -40.0)
uniform 0 float4 10.0 20.0 30.0 40.0
uniform 4 float4 1.0 0.0 0.0 0.0
uniform 8 float4 1.0 -0.2 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (-10.0, -20.0, -30.0, -40.0)
uniform 0 float4 10.0 20.0 30.0 40.0
uniform 4 float4 1.0 0.0 0.0 0.0
uniform 8 float4 -1.0 0.0 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (10.0, 20.0, 30.0, 40.0)
uniform 0 float4 10.0 20.0 30.0 40.0
uniform 4 float4 0.0 -1.0 0.0 0.0
uniform 8 float4 0.0 1.0 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (10.0, 20.0, 30.0, 40.0)
uniform 0 float4 10.0 20.0 30.0 40.0
uniform 4 float4 1.0 0.0 0.0 0.0
uniform 8 float4 0.0 1.0 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (-10.0, -20.0, -30.0, -40.0)
uniform 0 float4 10.0 20.0 30.0 40.0
uniform 4 float4 0.0 0.0 0.0 0.0
uniform 8 float4 0.0 1.0 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (-10.0, -20.0, -30.0, -40.0)
uniform 0 float4 10.0 20.0 30.0 40.0
uniform 4 float4 0.0 0.0 0.0 0.0
uniform 8 float4 0.0 0.0 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (-10.0, -20.0, -30.0, -40.0)

View File

@ -9,7 +9,7 @@ float4 main() : sv_target
[test]
uniform 0 float 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)

View File

@ -13,23 +13,23 @@ float4 main() : sv_target
[test]
uniform 0 float4 -1.0 0.0 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (3.14159274, 0.0, 0.0, 0.0) 128
uniform 0 float4 -0.5 0.0 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (2.094441441, 0.0, 0.0, 0.0) 256
uniform 0 float4 0.0 0.0 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (1.57072878, 0.0, 0.0, 0.0) 1024
uniform 0 float4 0.5 0.0 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (1.04715133, 0.0, 0.0, 0.0) 512
uniform 0 float4 1.0 0.0 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) 128
[pixel shader]

View File

@ -28,7 +28,7 @@ void main(out float4 res : COLOR1, in float4 pos : position, out float4 out_pos
[test]
if(sm<4) uniform 0 float 0.0
if(sm>=4) uniform 0 float4 0.0 0.0 0.0 0.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)