nir: remove unnecessary (nir_shader *) typecasts

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34489>
This commit is contained in:
Marek Olšák 2025-04-10 17:24:24 -04:00 committed by Marge Bot
parent 4502254cd2
commit 81bdf1ace6
6 changed files with 7 additions and 7 deletions

View file

@ -94,7 +94,7 @@ draw_create_vs_llvm(struct draw_context *draw,
if (state->type == PIPE_SHADER_IR_NIR) {
vs->base.state.ir.nir = state->ir.nir;
nir_shader *nir = (nir_shader *)state->ir.nir;
nir_shader *nir = state->ir.nir;
if (!nir->options->lower_uniforms_to_ubo)
NIR_PASS_V(state->ir.nir, nir_lower_uniforms_to_ubo, false, false);
nir_tgsi_scan_shader(state->ir.nir, &vs->base.info, true);

View file

@ -4106,7 +4106,7 @@ pipe_shader_state_to_tgsi_tokens(struct pipe_screen *screen,
const struct pipe_shader_state *cso)
{
if (cso->type == PIPE_SHADER_IR_NIR) {
return nir_to_tgsi((nir_shader *)cso->ir.nir, screen);
return nir_to_tgsi(cso->ir.nir, screen);
} else {
assert(cso->type == PIPE_SHADER_IR_TGSI);
/* we need to keep a local copy of the tokens */

View file

@ -91,7 +91,7 @@ util_live_shader_cache_get(struct pipe_context *ctx,
nir_serialize(&blob, state->ir.nir, true);
ir_binary = blob.data;
ir_size = blob.size;
stage = pipe_shader_type_from_mesa(((nir_shader*)state->ir.nir)->info.stage);
stage = pipe_shader_type_from_mesa(state->ir.nir->info.stage);
} else {
assert(0);
return NULL;

View file

@ -604,7 +604,7 @@ void si_nir_scan_shader(struct si_screen *sscreen, struct nir_shader *nir,
info->writes_position = nir->info.outputs_written & VARYING_BIT_POS;
}
nir_function_impl *impl = nir_shader_get_entrypoint((nir_shader*)nir);
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
nir_foreach_block (block, impl) {
nir_foreach_instr (instr, block)
scan_instruction(nir, info, instr, colors_lowered);
@ -666,7 +666,7 @@ void si_nir_scan_shader(struct si_screen *sscreen, struct nir_shader *nir,
}
info->uses_vmem_load_other |= info->uses_indirect_descriptor;
info->has_divergent_loop = nir_has_divergent_loop((nir_shader*)nir);
info->has_divergent_loop = nir_has_divergent_loop(nir);
if (nir->info.stage == MESA_SHADER_VERTEX) {
info->num_vs_inputs =

View file

@ -3614,7 +3614,7 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
sel->nir = tgsi_to_nir(state->tokens, ctx->screen, true);
} else {
assert(state->type == PIPE_SHADER_IR_NIR);
sel->nir = (nir_shader*)state->ir.nir;
sel->nir = state->ir.nir;
}
si_nir_scan_shader(sscreen, sel->nir, &sel->info, false);

View file

@ -783,7 +783,7 @@ st_create_common_variant(struct st_context *st,
state.type = PIPE_SHADER_IR_NIR;
state.report_compile_error = report_compile_error;
state.ir.nir = get_nir_shader(st, prog, key->is_draw_shader);
const nir_shader_compiler_options *options = ((nir_shader *)state.ir.nir)->options;
const nir_shader_compiler_options *options = state.ir.nir->options;
if (key->clamp_color) {
NIR_PASS(_, state.ir.nir, nir_lower_clamp_color_outputs);