vkd3d-shader/glsl: Implement VKD3DSIH_ROUND_NE.

This commit is contained in:
Henri Verbeet 2024-05-03 14:32:31 +02:00
parent 308121ba04
commit 0cc0b68fb4
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
3 changed files with 11 additions and 8 deletions

View File

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

View File

@ -44,7 +44,7 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 -1.0 0.0 0.0 0.0 uniform 0 float4 -1.0 0.0 0.0 0.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (-31416.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (-31416.0, 0.0, 0.0, 0.0)
[require] [require]
@ -52,15 +52,15 @@ shader model < 6.0
[test] [test]
uniform 0 float4 -0.5 0.0 0.0 0.0 uniform 0 float4 -0.5 0.0 0.0 0.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (-10473.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (-10473.0, 0.0, 0.0, 0.0)
uniform 0 float4 0.0 0.0 0.0 0.0 uniform 0 float4 0.0 0.0 0.0 0.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (1.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (1.0, 0.0, 0.0, 0.0)
uniform 0 float4 0.5 0.0 0.0 0.0 uniform 0 float4 0.5 0.0 0.0 0.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (10473.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (10473.0, 0.0, 0.0, 0.0)
[require] [require]
@ -88,7 +88,7 @@ probe (0, 0) rgba (10472.0, 0.0, 0.0, 0.0) 4096
[test] [test]
uniform 0 float4 1.0 0.0 0.0 0.0 uniform 0 float4 1.0 0.0 0.0 0.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (31416.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (31416.0, 0.0, 0.0, 0.0)

View File

@ -8,7 +8,7 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 -0.4 -6.6 7.6 3.4 uniform 0 float4 -0.4 -6.6 7.6 3.4
todo(glsl) draw quad draw quad
probe (0, 0) rgba (0.0, -7.0, 8.0, 3.0) 4 probe (0, 0) rgba (0.0, -7.0, 8.0, 3.0) 4
@ -26,7 +26,7 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 -0.4 -6.6 7.6 3.4 uniform 0 float4 -0.4 -6.6 7.6 3.4
todo(glsl) draw quad draw quad
probe (0, 0) rgba (-7.0, 8.0, 0.0, 3.0) 4 probe (0, 0) rgba (-7.0, 8.0, 0.0, 3.0) 4
@ -42,5 +42,5 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 -1 0 2 10 uniform 0 float4 -1 0 2 10
todo(glsl) draw quad draw quad
probe (0, 0) rgba (-1.0, 0.0, 2.0, 10.0) 4 probe (0, 0) rgba (-1.0, 0.0, 2.0, 10.0) 4