mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
pan/bi: Lower ubo table in indices for Valhall
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27846>
This commit is contained in:
parent
652e1c2e13
commit
4a4698733b
2 changed files with 17 additions and 2 deletions
|
|
@ -95,6 +95,19 @@ lower_input_intrin(nir_builder *b, nir_intrinsic_instr *intrin,
|
|||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
lower_load_ubo_intrin(nir_builder *b, nir_intrinsic_instr *intrin)
|
||||
{
|
||||
b->cursor = nir_before_instr(&intrin->instr);
|
||||
|
||||
nir_def *new_offset =
|
||||
nir_ior_imm(b, intrin->src[0].ssa, pan_res_handle(PAN_TABLE_UBO, 0));
|
||||
|
||||
nir_src_rewrite(&intrin->src[0], new_offset);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
lower_intrinsic(nir_builder *b, nir_intrinsic_instr *intrin,
|
||||
const struct panfrost_compile_inputs *inputs)
|
||||
|
|
@ -106,6 +119,8 @@ lower_intrinsic(nir_builder *b, nir_intrinsic_instr *intrin,
|
|||
return lower_image_intrin(b, intrin);
|
||||
case nir_intrinsic_load_input:
|
||||
return lower_input_intrin(b, intrin, inputs);
|
||||
case nir_intrinsic_load_ubo:
|
||||
return lower_load_ubo_intrin(b, intrin);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ bi_analyze_ranges(bi_context *ctx)
|
|||
if (!bi_is_direct_aligned_ubo(ins))
|
||||
continue;
|
||||
|
||||
unsigned ubo = ins->src[1].value;
|
||||
unsigned ubo = pan_res_handle_get_index(ins->src[1].value);
|
||||
unsigned word = ins->src[0].value / 4;
|
||||
unsigned channels = bi_opcode_props[ins->op].sr_count;
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ bi_opt_push_ubo(bi_context *ctx)
|
|||
if (!bi_is_ubo(ins))
|
||||
continue;
|
||||
|
||||
unsigned ubo = ins->src[1].value;
|
||||
unsigned ubo = pan_res_handle_get_index(ins->src[1].value);
|
||||
unsigned offset = ins->src[0].value;
|
||||
|
||||
if (!bi_is_direct_aligned_ubo(ins)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue