Commit 9841afad authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜 Committed by Marge Bot
Browse files

pan/bi: Implement bi_load_sysval via the builder


Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <mesa/mesa!8135>
parent feecf0a3
......@@ -629,6 +629,24 @@ bi_emit_ld_ubo(bi_context *ctx, nir_intrinsic_instr *instr)
bi_emit(ctx, ld);
}
static void
bi_load_sysval(bi_builder *b, nir_instr *instr,
unsigned nr_components, unsigned offset)
{
nir_dest nir_dest;
/* Figure out which uniform this is */
int sysval = panfrost_sysval_for_instr(instr, &nir_dest);
void *val = _mesa_hash_table_u64_search(b->shader->sysvals.sysval_to_id, sysval);
/* Sysvals are prefix uniforms */
unsigned uniform = ((uintptr_t) val) - 1;
unsigned idx = (uniform * 16) + offset;
bi_load_to(b, nr_components * 32, bi_dest_index(&nir_dest),
bi_imm_u32(idx), bi_zero(), BI_SEG_UBO);
}
static void
bi_emit_sysval(bi_context *ctx, nir_instr *instr,
unsigned nr_components, unsigned offset)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment