mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
[qfcc] Correct swizzle expressions
It turned out they were always using floats for the source type (meaning doubles were broken), and not shifting the component in the final sizzle code meaning all swizzles were ?xxx (neglecting minus or 0). I'd make tests, but I plan on modifying the instruction set a little bit.
This commit is contained in:
parent
fb6d3f2f86
commit
e66ae0aad6
2 changed files with 2 additions and 2 deletions
|
@ -699,7 +699,7 @@ new_swizzle_expr (expr_t *src, const char *swizzle)
|
|||
}
|
||||
}
|
||||
swiz.zero |= (0xf << comp_count) & 0xf;
|
||||
swiz.src = new_alias_expr (vector_type (&type_float, src_width), src);
|
||||
swiz.src = new_alias_expr (vector_type (base_type (src_type), src_width), src);
|
||||
swiz.type = vector_type (base_type (src_type), 4);
|
||||
|
||||
expr_t *expr = new_expr ();
|
||||
|
|
|
@ -1810,7 +1810,7 @@ expr_swizzle (sblock_t *sblock, expr_t *e, operand_t **op)
|
|||
type_t *res_type = e->e.swizzle.type;
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
swiz |= e->e.swizzle.source[i] & 3;
|
||||
swiz |= (e->e.swizzle.source[i] & 3) << (2 * i);
|
||||
}
|
||||
swiz |= (e->e.swizzle.neg & 0xf) << 8;
|
||||
swiz |= (e->e.swizzle.zero & 0xf) << 12;
|
||||
|
|
Loading…
Reference in a new issue