Module: vkd3d Branch: master Commit: 514d179b70462945f41220a3028318d8f30dfeaf URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/514d179b70462945f41220a3028318...
Author: Zebediah Figura zfigura@codeweavers.com Date: Fri Sep 8 16:40:22 2023 -0500
vkd3d-shader/hlsl: Do not consider scalars and 1-dimensional vectors to be equivalent in function parameters.
---
libs/vkd3d-shader/hlsl.c | 6 +----- tests/hlsl/function-overload.shader_test | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 108f1a75..7893497d 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -2053,11 +2053,7 @@ static int compare_param_hlsl_types(const struct hlsl_type *t1, const struct hls int r;
if ((r = vkd3d_u32_compare(t1->class, t2->class))) - { - if (!((t1->class == HLSL_CLASS_SCALAR && t2->class == HLSL_CLASS_VECTOR) - || (t1->class == HLSL_CLASS_VECTOR && t2->class == HLSL_CLASS_SCALAR))) - return r; - } + return r; if ((r = vkd3d_u32_compare(t1->base_type, t2->base_type))) return r; if (t1->base_type == HLSL_TYPE_SAMPLER || t1->base_type == HLSL_TYPE_TEXTURE) diff --git a/tests/hlsl/function-overload.shader_test b/tests/hlsl/function-overload.shader_test index e9a8a8b9..ae35c483 100644 --- a/tests/hlsl/function-overload.shader_test +++ b/tests/hlsl/function-overload.shader_test @@ -43,7 +43,7 @@ probe all rgba (0.1, 0.2, 0.1, 0.2)
% float and float1 can be defined separately...
-[pixel shader todo] +[pixel shader] void func(float arg) {} void func(float1 arg) {}
@@ -55,7 +55,7 @@ float4 main() : sv_target
% ...but invoking them is considered ambiguous and fails.
-[pixel shader fail] +[pixel shader fail todo]
void func(float arg) {} void func(float1 arg) {} @@ -67,7 +67,7 @@ float4 main() : sv_target return 1.0; }
-[pixel shader fail] +[pixel shader fail todo]
void func(float arg) {} void func(float1 arg) {}