On 10/19/22 22:36, Francisco Casas wrote:
- 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;
- }
This patch removes the "broken" cases I mentioned, which is great, except that it's different from the main and stated purpose of the patch. Ideally that's something we should pull into a separate patch (earlier, or maybe later, whichever makes more sense). We also would ideally have tests for those illegal casts.