vkd3d-shader/glsl: Implement VKD3DSIH_LOG.

This commit is contained in:
Henri Verbeet 2024-05-03 15:18:16 +02:00
parent 700eba0b01
commit 10559fa17a
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 7 additions and 4 deletions

View File

@ -792,6 +792,9 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_UTOF:
shader_glsl_cast(gen, ins, "float", "vec");
break;
case VKD3DSIH_LOG:
shader_glsl_intrinsic(gen, ins, "log2");
break;
case VKD3DSIH_MOV:
shader_glsl_mov(gen, ins);
break;

View File

@ -8,7 +8,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 2.0 4.0 5.0 0.4
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (1.0, 2.0, 2.32192802, -1.32192802) 1
[pixel shader]
@ -21,7 +21,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 10.0 100.0 1.0 0.1
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (1.0, 2.0, 0.0, -1.0) 1
[pixel shader]
@ -34,5 +34,5 @@ float4 main() : sv_target
[test]
uniform 0 float4 3.0 10.0 1.0 0.1
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (1.0986123, 2.302585, 0.0, -2.302585) 2

View File

@ -8,7 +8,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 0.4 0.8 2.5 2.0
todo(glsl) draw quad
draw quad
probe (0, 0) rgba (0.512, 0.101192884, 0.64, 0.25) 4