vkd3d-shader/glsl: Implement VKD3DSIH_SQRT.

This commit is contained in:
Henri Verbeet 2024-05-02 01:39:25 +02:00
parent 5ad83a05ff
commit f0c8b4a3c5
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 24 additions and 21 deletions

View File

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

View File

@ -10,7 +10,7 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 -2.0 3.0 4.0 0.1 uniform 0 float4 -2.0 3.0 4.0 0.1
uniform 4 float4 2.0 -1.0 4.0 5.0 uniform 4 float4 2.0 -1.0 4.0 5.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (7.483983, 7.483983, 7.483983, 7.483983) 1 probe (0, 0) rgba (7.483983, 7.483983, 7.483983, 7.483983) 1
[pixel shader] [pixel shader]

View File

@ -8,7 +8,7 @@ float4 main() : SV_TARGET
[test] [test]
uniform 0 float4 2.0 3.0 4.0 5.0 uniform 0 float4 2.0 3.0 4.0 5.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (7.34846926, 7.34846926, 7.34846926, 7.34846926) 1 probe (0, 0) rgba (7.34846926, 7.34846926, 7.34846926, 7.34846926) 1
[pixel shader] [pixel shader]
@ -21,7 +21,7 @@ float4 main() : SV_TARGET
[test] [test]
uniform 0 float4 2.0 3.0 4.0 0.0 uniform 0 float4 2.0 3.0 4.0 0.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (5.38516474, 5.38516474, 5.38516474, 5.38516474) 1 probe (0, 0) rgba (5.38516474, 5.38516474, 5.38516474, 5.38516474) 1
[pixel shader] [pixel shader]
@ -34,7 +34,7 @@ float4 main() : SV_TARGET
[test] [test]
uniform 0 float4 2.0 3.0 0.0 0.0 uniform 0 float4 2.0 3.0 0.0 0.0
todo(sm<4 | glsl) draw quad todo(sm<4) draw quad
probe (0, 0) rgba (3.60555124, 3.60555124, 3.60555124, 3.60555124) 1 probe (0, 0) rgba (3.60555124, 3.60555124, 3.60555124, 3.60555124) 1
[pixel shader] [pixel shader]
@ -47,7 +47,7 @@ float4 main() : SV_TARGET
[test] [test]
uniform 0 float4 2.0 0.0 0.0 0.0 uniform 0 float4 2.0 0.0 0.0 0.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (2.0, 2.0, 2.0, 2.0) probe (0, 0) rgba (2.0, 2.0, 2.0, 2.0)
[pixel shader] [pixel shader]
@ -60,7 +60,7 @@ float4 main() : SV_TARGET
[test] [test]
uniform 0 float4 2.0 0.0 0.0 0.0 uniform 0 float4 2.0 0.0 0.0 0.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (2.0, 2.0, 2.0, 2.0) probe (0, 0) rgba (2.0, 2.0, 2.0, 2.0)
[pixel shader fail] [pixel shader fail]

View File

@ -12,10 +12,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2 uniform 8 float 0.2
todo(glsl) draw quad draw quad
probe (0, 0) rgba (-0.550931, -0.453954, 0.3654653, -1.0248856) 32 probe (0, 0) rgba (-0.550931, -0.453954, 0.3654653, -1.0248856) 32
uniform 8 float 100.0 uniform 8 float 100.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] [pixel shader]
@ -34,10 +34,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2 uniform 8 float 0.2
todo(sm<4 | glsl) draw quad todo(sm<4) draw quad
probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32 probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32
uniform 8 float 100.0 uniform 8 float 100.0
todo(sm<4 | glsl) draw quad todo(sm<4) draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] [pixel shader]
@ -55,10 +55,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2 uniform 8 float 0.2
todo(sm<4 | glsl) draw quad todo(sm<4) draw quad
probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32 probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32
uniform 8 float 100.0 uniform 8 float 100.0
todo(sm<4 | glsl) draw quad todo(sm<4) draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] [pixel shader]
@ -76,10 +76,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2 uniform 8 float 0.2
todo(sm<4 | glsl) draw quad todo(sm<4) draw quad
probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32 probe (0, 0) rgba (-0.519904912, -0.4332699, 0.0, 0.0) 32
uniform 8 float 100.0 uniform 8 float 100.0
todo(sm<4 | glsl) draw quad todo(sm<4) draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] [pixel shader]
@ -98,10 +98,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2 uniform 8 float 0.2
todo(glsl) draw quad draw quad
probe (0, 0) rgba (-0.524978, 0.0, 0.0, 0.0) 32 probe (0, 0) rgba (-0.524978, 0.0, 0.0, 0.0) 32
uniform 8 float 100.0 uniform 8 float 100.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] [pixel shader]
@ -118,10 +118,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float 0.2 uniform 8 float 0.2
todo(glsl) draw quad draw quad
probe (0, 0) rgba (-0.5562381, -0.6762381, -0.6162381, -0.5962381) 32 probe (0, 0) rgba (-0.5562381, -0.6762381, -0.6162381, -0.5962381) 32
uniform 8 float 100.0 uniform 8 float 100.0
todo(glsl) draw quad draw quad
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0) probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader fail(sm>=6)] [pixel shader fail(sm>=6)]
@ -138,10 +138,10 @@ float4 main() : sv_target
uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 0 float4 0.5 -0.1 0.2 0.3
uniform 4 float4 0.6 0.4 -0.3 1.0 uniform 4 float4 0.6 0.4 -0.3 1.0
uniform 8 float4 0.2 0.3 0.4 0.5 uniform 8 float4 0.2 0.3 0.4 0.5
if(sm<6) todo(glsl) draw quad if(sm<6) draw quad
if(sm<6) probe (0,0) rgba (-0.550931, -0.453954, 0.3654653, -1.0248856) 32 if(sm<6) probe (0,0) rgba (-0.550931, -0.453954, 0.3654653, -1.0248856) 32
uniform 8 float 100.0 uniform 8 float 100.0
if(sm<6) todo(glsl) draw quad if(sm<6) draw quad
if(sm<6) probe (0,0) rgba (0.0, 0.0, 0.0, 0.0) if(sm<6) probe (0,0) rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader fail] [pixel shader fail]

View File

@ -8,7 +8,7 @@ float4 main() : sv_target
[test] [test]
uniform 0 float4 1.0 9.0 32.3 46.5 uniform 0 float4 1.0 9.0 32.3 46.5
todo(glsl) draw quad draw quad
probe (0, 0) rgba (1.0, 3.0, 5.683309, 6.819091) 1 probe (0, 0) rgba (1.0, 3.0, 5.683309, 6.819091) 1
[pixel shader] [pixel shader]