diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 95c1c0fa..76b0eae7 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -1638,7 +1638,7 @@ static struct hlsl_ir_node *add_binary_dot_expr(struct hlsl_ctx *ctx, struct lis if (arg1->data_type->type == HLSL_CLASS_SCALAR) dim = arg2->data_type->dimx; - else if (arg1->data_type->type == HLSL_CLASS_SCALAR) + else if (arg2->data_type->type == HLSL_CLASS_SCALAR) dim = arg1->data_type->dimx; else dim = min(arg1->data_type->dimx, arg2->data_type->dimx); diff --git a/tests/hlsl-dot.shader_test b/tests/hlsl-dot.shader_test index a83c2488..e51d7cb8 100644 --- a/tests/hlsl-dot.shader_test +++ b/tests/hlsl-dot.shader_test @@ -43,6 +43,21 @@ uniform 4 float4 10.0 11.0 12.0 13.0 draw quad probe all rgba (92.0, 92.0, 92.0, 92.0) +[pixel shader] +uniform float4 x; +uniform float y; + +float4 main() : SV_TARGET +{ + return dot(x, y); +} + +[test] +uniform 0 float4 10.0 11.0 12.0 13.0 +uniform 4 float4 2.0 0.0 0.0 0.0 +draw quad +probe all rgba (92.0, 92.0, 92.0, 92.0) + [pixel shader] uniform float x; uniform float y;