mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 08:30:10 +01:00
ir3: correctly count vectorized instructions for tex prefetch
The tex prefetch heuristic simply counts the number of NIR instructions. Since a vectorized NIR instruction expands to an ir3 instruction per component, we have to take this into account while counting them. Signed-off-by: Job Noorman <jnoorman@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28341>
This commit is contained in:
parent
fe09ea29b9
commit
ef162f9a6f
1 changed files with 9 additions and 1 deletions
|
|
@ -155,7 +155,15 @@ ir3_context_init(struct ir3_compiler *compiler, struct ir3_shader *shader,
|
|||
|
||||
unsigned instruction_count = 0;
|
||||
nir_foreach_block (block, fxn) {
|
||||
instruction_count += exec_list_length(&block->instr_list);
|
||||
nir_foreach_instr (instr, block) {
|
||||
/* Vectorized ALU instructions expand to one scalar instruction per
|
||||
* component.
|
||||
*/
|
||||
if (instr->type == nir_instr_type_alu)
|
||||
instruction_count += nir_instr_as_alu(instr)->def.num_components;
|
||||
else
|
||||
instruction_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (instruction_count < 50) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue