[qfcc] Implement swizzle and arrays for spir-v

Arrays done via the field code since they use the same opcode and logic.
For now swizzles are just swizzles and don't support zeroing or negating
(but doing one or the other (not both) should be easy).
This commit is contained in:
Bill Currie 2024-11-18 12:29:25 +09:00
parent 34277b2050
commit 39514e4f3d
6 changed files with 80 additions and 26 deletions

View file

@ -51,7 +51,9 @@ get_value (const expr_t *e, int i, int j)
}
if (type_rows (t) > 1) {
auto ind = new_int_expr (j, false);
e = array_expr (e, ind);
auto a = new_array_expr (e, ind);
a->array.type = base_type (t);
e = a;
}
return e;
}