From b9d8b84b06d47be275ada0d107b2f9d845f836c4 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 2 May 2024 01:20:45 +0200 Subject: [PATCH] vkd3d-shader/glsl: Implement VKD3DSIH_DP4. --- libs/vkd3d-shader/glsl.c | 3 +++ tests/hlsl/determinant.shader_test | 2 +- tests/hlsl/dot.shader_test | 6 +++--- tests/hlsl/reflect.shader_test | 6 +++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/libs/vkd3d-shader/glsl.c b/libs/vkd3d-shader/glsl.c index 905e019d..c5ecaee7 100644 --- a/libs/vkd3d-shader/glsl.c +++ b/libs/vkd3d-shader/glsl.c @@ -715,6 +715,9 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen, case VKD3DSIH_DP3: shader_glsl_dot(gen, ins, vkd3d_write_mask_from_component_count(3)); break; + case VKD3DSIH_DP4: + shader_glsl_dot(gen, ins, VKD3DSP_WRITEMASK_ALL); + break; case VKD3DSIH_FRC: shader_glsl_intrinsic(gen, ins, "fract"); break; diff --git a/tests/hlsl/determinant.shader_test b/tests/hlsl/determinant.shader_test index 6adfd09d..800525b4 100644 --- a/tests/hlsl/determinant.shader_test +++ b/tests/hlsl/determinant.shader_test @@ -80,7 +80,7 @@ uniform 0 float4 1.0 -2.0 3.0 4.0 uniform 4 float4 5.0 6.0 -7.0 8.0 uniform 8 float4 9.0 10.0 11.0 12.0 uniform 12 float4 13.0 14.0 15.0 16.0 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (-672.0, -672.0, -672.0, -672.0) [pixel shader] diff --git a/tests/hlsl/dot.shader_test b/tests/hlsl/dot.shader_test index 42039f15..31318482 100644 --- a/tests/hlsl/dot.shader_test +++ b/tests/hlsl/dot.shader_test @@ -10,7 +10,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 2.0 3.0 4.0 5.0 uniform 4 float4 10.0 11.0 12.0 13.0 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (166.0, 166.0, 166.0, 166.0) [pixel shader] @@ -40,7 +40,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 2.0 0.0 0.0 0.0 uniform 4 float4 10.0 11.0 12.0 13.0 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (92.0, 92.0, 92.0, 92.0) [pixel shader] @@ -55,7 +55,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 10.0 11.0 12.0 13.0 uniform 4 float4 2.0 0.0 0.0 0.0 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (92.0, 92.0, 92.0, 92.0) [pixel shader] diff --git a/tests/hlsl/reflect.shader_test b/tests/hlsl/reflect.shader_test index 9fd82931..37cedfd4 100644 --- a/tests/hlsl/reflect.shader_test +++ b/tests/hlsl/reflect.shader_test @@ -10,7 +10,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.4 -0.3 1.0 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (-0.1, -0.5, 0.5, -0.7) 4 [pixel shader] @@ -27,7 +27,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 0.0 0.0 0.0 uniform 4 float4 0.6 0.4 -0.3 1.0 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (-0.52, -0.18, 1.01, -1.2) 4 [pixel shader] @@ -44,7 +44,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.0 0.0 0.0 -todo(glsl) draw quad +draw quad probe (0, 0) rgba (-0.148, -0.748, -0.448, -0.348) 4 [pixel shader]