mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-26 10:00:22 +01:00
pan/midgard: Add mir_ubo_shift helper
Different UBO reads have different shift requirements. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
parent
cf3bb10f51
commit
03350eb8b8
2 changed files with 22 additions and 0 deletions
|
|
@ -441,6 +441,7 @@ bool mir_special_index(compiler_context *ctx, unsigned idx);
|
|||
unsigned mir_use_count(compiler_context *ctx, unsigned value);
|
||||
bool mir_is_written_before(compiler_context *ctx, midgard_instruction *ins, unsigned node);
|
||||
unsigned mir_mask_of_read_components(midgard_instruction *ins, unsigned node);
|
||||
unsigned mir_ubo_shift(midgard_load_store_op op);
|
||||
|
||||
/* MIR printing */
|
||||
|
||||
|
|
|
|||
|
|
@ -425,3 +425,24 @@ mir_mask_of_read_components(midgard_instruction *ins, unsigned node)
|
|||
|
||||
return mask;
|
||||
}
|
||||
|
||||
unsigned
|
||||
mir_ubo_shift(midgard_load_store_op op)
|
||||
{
|
||||
switch (op) {
|
||||
case midgard_op_ld_ubo_char:
|
||||
return 0;
|
||||
case midgard_op_ld_ubo_char2:
|
||||
return 1;
|
||||
case midgard_op_ld_ubo_char4:
|
||||
return 2;
|
||||
case midgard_op_ld_ubo_short4:
|
||||
return 3;
|
||||
case midgard_op_ld_ubo_int4:
|
||||
return 4;
|
||||
default:
|
||||
unreachable("Invalid op");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue