nir/opt_offsets: rename max_offset_data to cb_data

We want to add more callbacks and pass the same data.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37114>
This commit is contained in:
Job Noorman 2025-09-01 10:52:27 +02:00 committed by Marge Bot
parent e394244a89
commit bc03086320
3 changed files with 4 additions and 4 deletions

View file

@ -6332,8 +6332,8 @@ typedef struct nir_opt_offsets_options {
*/
uint32_t (*max_offset_cb)(nir_intrinsic_instr *intr, const void *data);
/** Data to pass to max_offset_cb. */
const void *max_offset_data;
/** Data to pass to callbacks. */
const void *cb_data;
/**
* Allow the offset calculation to wrap. If false, constant additions that

View file

@ -184,7 +184,7 @@ get_max(opt_offsets_state *state, nir_intrinsic_instr *intrin, uint32_t default_
if (default_val)
return default_val;
if (state->options->max_offset_cb)
return state->options->max_offset_cb(intrin, state->options->max_offset_data);
return state->options->max_offset_cb(intrin, state->options->cb_data);
return 0;
}

View file

@ -386,7 +386,7 @@ ir3_optimize_loop(struct ir3_compiler *compiler,
.buffer_max = 0,
.max_offset_cb = ir3_nir_max_imm_offset,
.max_offset_data = compiler,
.cb_data = compiler,
.allow_offset_wrap = true,
};
progress |= OPT(s, nir_opt_offsets, &offset_options);