From 9bce0f8e4fe8e309a7e2b3e0e316c00eabb409b7 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 30 Aug 2023 14:58:22 +0900 Subject: [PATCH] [qfcc] Calculate multi-vector size correctly The struct for multi-group multi-vectors cleans up that code and makes the "calculation" much easier (since it's handled by the struct building code). --- tools/qfcc/source/algebra.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tools/qfcc/source/algebra.c b/tools/qfcc/source/algebra.c index 5b762a798..28ea0af84 100644 --- a/tools/qfcc/source/algebra.c +++ b/tools/qfcc/source/algebra.c @@ -699,16 +699,12 @@ algebra_type_size (const type_t *type) return a->num_components * type_size (a->type); } else if (type->type == ev_float || type->type == ev_double) { auto m = type->t.multivec; - auto a = m->algebra; - auto layout = &a->layout; int size = 0; if (m->group_mask & (m->group_mask - 1)) { - for (int i = 0; i < layout->count; i++) { - if (m->group_mask & (1u << i)) { - auto t = algebra_mvec_type (a, m->group_mask & (1u << i)); - size += type_aligned_size (t); - } + if (!m->mvec_sym) { + internal_error (0, "multi group multivec missing struct"); } + size = type_size (m->mvec_sym->type); } else { size = m->num_components * type_size (m->algebra->type); }