From 376f8f2c0939190184cfba3f4505b4941e8f354c Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 14 Jan 2025 13:20:12 +0900 Subject: [PATCH] [qfcc] Check rows/columns for type promotion There's no automatic type promotion between scalars, vectors or matrices of different component counts. --- tools/qfcc/source/type.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/qfcc/source/type.c b/tools/qfcc/source/type.c index d3d065bac..3b792fd82 100644 --- a/tools/qfcc/source/type.c +++ b/tools/qfcc/source/type.c @@ -1779,6 +1779,10 @@ type_promotes (const type_t *dst, const type_t *src) if (!is_math (dst) || !is_math (src)) { return false; } + if (type_cols (dst) != type_cols (src) + || type_rows (dst) != type_rows (src)) { + return false; + } if (is_bool (src)) { return !is_short (dst) && !is_ushort (dst);