From 1c778116484d22b57b34fd8baac10e5238a11294 Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Thu, 20 Oct 2022 10:42:31 -0300 Subject: [PATCH] vkd3d-shader/hlsl: Remove incorrect criteria for accepting implicit casts. --- libs/vkd3d-shader/hlsl.y | 16 ---------------- tests/cast-componentwise-equal.shader_test | 10 +++++----- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 184a8613..d0bbee9e 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -222,22 +222,6 @@ static bool implicit_compatible_data_types(struct hlsl_type *src, struct hlsl_ty return true; } - if (src->type == HLSL_CLASS_ARRAY && dst->type == HLSL_CLASS_ARRAY) - { - return hlsl_type_component_count(src) == hlsl_type_component_count(dst); - } - - if ((src->type == HLSL_CLASS_ARRAY && dst->type <= HLSL_CLASS_LAST_NUMERIC) - || (src->type <= HLSL_CLASS_LAST_NUMERIC && dst->type == HLSL_CLASS_ARRAY)) - { - /* e.g. float4[3] to float4 is allowed */ - if (src->type == HLSL_CLASS_ARRAY && hlsl_types_are_equal(src->e.array.type, dst)) - return true; - if (hlsl_type_component_count(src) == hlsl_type_component_count(dst)) - return true; - return false; - } - if (src->type <= HLSL_CLASS_VECTOR && dst->type <= HLSL_CLASS_VECTOR) { if (src->dimx >= dst->dimx) diff --git a/tests/cast-componentwise-equal.shader_test b/tests/cast-componentwise-equal.shader_test index 8a98b45c..30c26c63 100644 --- a/tests/cast-componentwise-equal.shader_test +++ b/tests/cast-componentwise-equal.shader_test @@ -226,7 +226,7 @@ float4 main() : sv_target } -[pixel shader fail todo] +[pixel shader fail] float main() : SV_TARGET { float arr[3] = {1, 2, 3}; @@ -237,7 +237,7 @@ float main() : SV_TARGET } -[pixel shader fail todo] +[pixel shader fail] float main() : SV_TARGET { float2 arr[3] = {1, 2, 3, 4, 5, 6}; @@ -248,7 +248,7 @@ float main() : SV_TARGET } -[pixel shader fail todo] +[pixel shader fail] float4 main() : SV_TARGET { int arr1[4] = {1, 2, 3, 4}; @@ -270,7 +270,7 @@ float4 main() : SV_TARGET } -[pixel shader fail todo] +[pixel shader fail] float4 main() : SV_TARGET { float4 f = {1, 2, 3, 4}; @@ -281,7 +281,7 @@ float4 main() : SV_TARGET } -[pixel shader fail todo] +[pixel shader fail] float4 main() : SV_TARGET { float arr[4] = {1, 2, 3, 4};