mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 16:30:43 +00:00
[qfcc] Build multi-vector expressions correctly
Losing the other components and getting the offset wrong doesn't make for a correct multi-vector expression when pulling apart a multi-vector def.
This commit is contained in:
parent
d75bf346f3
commit
0d491ce68c
1 changed files with 3 additions and 1 deletions
|
@ -64,13 +64,15 @@ mvec_expr (expr_t *expr, algebra_t *algebra)
|
||||||
.algebra = algebra,
|
.algebra = algebra,
|
||||||
};
|
};
|
||||||
expr_t **c = &mvec->e.multivec.components;
|
expr_t **c = &mvec->e.multivec.components;
|
||||||
|
int comp_offset = 0;
|
||||||
for (int i = 0; i < layout->count; i++) {
|
for (int i = 0; i < layout->count; i++) {
|
||||||
pr_uint_t mask = 1u << i;
|
pr_uint_t mask = 1u << i;
|
||||||
if (mask & group_mask) {
|
if (mask & group_mask) {
|
||||||
auto comp_type = algebra_mvec_type (algebra, mask);
|
auto comp_type = algebra_mvec_type (algebra, mask);
|
||||||
int comp_offset = algebra->layout.group_map[i][1];
|
|
||||||
*c = new_offset_alias_expr (comp_type, expr, comp_offset);
|
*c = new_offset_alias_expr (comp_type, expr, comp_offset);
|
||||||
|
c = &(*c)->next;
|
||||||
mvec->e.multivec.count++;
|
mvec->e.multivec.count++;
|
||||||
|
comp_offset += algebra->layout.groups[i].count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue