vkd3d-shader/glsl: Implement VKD3DSIH_ROUND_Z.

This commit is contained in:
Henri Verbeet 2024-05-02 00:33:15 +02:00
parent e8b14d765d
commit 459f141e81
Notes: Henri Verbeet 2024-09-26 01:25:28 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1113
3 changed files with 9 additions and 6 deletions

View File

@ -718,6 +718,9 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_ROUND_PI: case VKD3DSIH_ROUND_PI:
shader_glsl_intrinsic(gen, ins, "ceil"); shader_glsl_intrinsic(gen, ins, "ceil");
break; break;
case VKD3DSIH_ROUND_Z:
shader_glsl_intrinsic(gen, ins, "trunc");
break;
default: default:
shader_glsl_unhandled(gen, ins); shader_glsl_unhandled(gen, ins);
break; break;

View File

@ -11,7 +11,7 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 -0.5 6.5 7.5 3.4 uniform 0 float4 -0.5 6.5 7.5 3.4
todo(glsl) draw quad draw quad
probe (0, 0) rgba (1912.0, 1657.0, -127.0, 867.0) 1 probe (0, 0) rgba (1912.0, 1657.0, -127.0, 867.0) 1
[pixel shader] [pixel shader]
@ -24,5 +24,5 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 -0.5 6.5 7.5 3.4 uniform 0 float4 -0.5 6.5 7.5 3.4
todo(glsl) draw quad draw quad
probe (0, 0) rgba (-127.0, -127.0, -127.0, -127.0) 1 probe (0, 0) rgba (-127.0, -127.0, -127.0, -127.0) 1

View File

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