mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 05:01:24 +00:00
[qfcc] Use OpBitcast for alias exprs in spirv
Really, just implementing it properly.
This commit is contained in:
parent
54231b21ed
commit
133156fdc7
1 changed files with 10 additions and 5 deletions
|
@ -1398,11 +1398,16 @@ spirv_alias (const expr_t *e, spirvctx_t *ctx)
|
|||
if (e->alias.offset) {
|
||||
internal_error (e, "offset alias in spir-v");
|
||||
}
|
||||
if (!is_integral (e->alias.type)
|
||||
|| !is_integral (get_type (e->alias.expr))) {
|
||||
internal_error (e, "non-integral alias in spir-v");
|
||||
}
|
||||
return spirv_emit_expr (e->alias.expr, ctx);
|
||||
auto type = e->alias.type;
|
||||
auto expr = e->alias.expr;
|
||||
unsigned eid = spirv_emit_expr (expr, ctx);
|
||||
int tid = type_id (type, ctx);
|
||||
int id = spirv_id (ctx);
|
||||
auto insn = spirv_new_insn (SpvOpBitcast, 4, ctx->code_space);
|
||||
INSN (insn, 1) = tid;
|
||||
INSN (insn, 2) = id;
|
||||
INSN (insn, 3) = eid;
|
||||
return id;
|
||||
}
|
||||
|
||||
static unsigned
|
||||
|
|
Loading…
Reference in a new issue