vkd3d-shader/glsl: Implement VKD3DSIH_ROUND_NI.

This commit is contained in:
Henri Verbeet 2024-05-03 13:33:28 +02:00
parent 5c2b057b56
commit e911433e0c
Notes: Henri Verbeet 2024-09-30 21:06:22 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1124
2 changed files with 6 additions and 3 deletions

View File

@ -766,6 +766,9 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_RET:
shader_glsl_ret(gen, ins);
break;
case VKD3DSIH_ROUND_NI:
shader_glsl_intrinsic(gen, ins, "floor");
break;
case VKD3DSIH_ROUND_PI:
shader_glsl_intrinsic(gen, ins, "ceil");
break;

View File

@ -18,7 +18,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 7.5 3.4
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (-1.0, 6.0, 7.0, 3.0) 4
[pixel shader]
@ -34,7 +34,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.5 6.5 7.5 3.4
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (6.0, 7.0, -1.0, 3.0) 4
@ -52,5 +52,5 @@ float4 main() : sv_target
[test]
if(sm<4) uniform 0 float4 -1 6 7 3
if(sm>=4) uniform 0 int4 -1 6 7 3
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (6.0, 7.0, -1.0, 3.0) 4