diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index dfbace6df5a..632b74aec87 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -177,8 +177,7 @@ glsl_to_nir(struct gl_shader *gl_shader, { MESA_TRACE_FUNC(); - nir_shader *shader = - nir_shader_create(NULL, gl_shader->Stage, options, NULL); + nir_shader *shader = nir_shader_create(NULL, gl_shader->Stage, options); nir_visitor v1(shader, src_blake3); nir_function_visitor v2(&v1); diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 6920eccce91..b5a3f9e9d36 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -196,8 +196,7 @@ nir_component_mask_reinterpret(nir_component_mask_t mask, nir_shader * nir_shader_create(void *mem_ctx, mesa_shader_stage stage, - const nir_shader_compiler_options *options, - shader_info *si) + const nir_shader_compiler_options *options) { nir_shader *shader = rzalloc(mem_ctx, nir_shader); @@ -211,18 +210,13 @@ nir_shader_create(void *mem_ctx, shader->options = options; - if (si) { - assert(si->stage == stage); - shader->info = *si; - } else { - shader->info.stage = stage; + shader->info.stage = stage; - /* Assume there is no known prev/next stage, this is the case for - * nir_builder_init_simple_shader for example. - */ - shader->info.prev_stage = MESA_SHADER_NONE; - shader->info.next_stage = MESA_SHADER_NONE; - } + /* Assume there is no known prev/next stage, this is the case for + * nir_builder_init_simple_shader for example. + */ + shader->info.prev_stage = MESA_SHADER_NONE; + shader->info.next_stage = MESA_SHADER_NONE; exec_list_make_empty(&shader->functions); diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 0239906fbd5..8618e9db622 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -3972,8 +3972,7 @@ void nir_fixup_is_exported(nir_shader *shader); nir_shader *nir_shader_create(void *mem_ctx, mesa_shader_stage stage, - const nir_shader_compiler_options *options, - shader_info *si); + const nir_shader_compiler_options *options); /** Adds a variable to the appropriate list in nir_shader */ void nir_shader_add_variable(nir_shader *shader, nir_variable *var); diff --git a/src/compiler/nir/nir_builder.c b/src/compiler/nir/nir_builder.c index ab76587ee46..2b89343ec88 100644 --- a/src/compiler/nir/nir_builder.c +++ b/src/compiler/nir/nir_builder.c @@ -38,7 +38,7 @@ nir_builder MUST_CHECK PRINTFLIKE(3, 4) nir_builder b; memset(&b, 0, sizeof(b)); - b.shader = nir_shader_create(NULL, stage, options, NULL); + b.shader = nir_shader_create(NULL, stage, options); if (name) { va_list args; diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c index 9e1819c8ec3..2ad4867a21e 100644 --- a/src/compiler/nir/nir_clone.c +++ b/src/compiler/nir/nir_clone.c @@ -809,7 +809,7 @@ nir_shader_clone(void *mem_ctx, const nir_shader *s) clone_state state; init_clone_state(&state, NULL, true, false); - nir_shader *ns = nir_shader_create(mem_ctx, s->info.stage, s->options, NULL); + nir_shader *ns = nir_shader_create(mem_ctx, s->info.stage, s->options); state.ns = ns; ns->has_debug_info = s->has_debug_info; diff --git a/src/compiler/nir/nir_serialize.c b/src/compiler/nir/nir_serialize.c index 544537d45b1..3f15a4c445b 100644 --- a/src/compiler/nir/nir_serialize.c +++ b/src/compiler/nir/nir_serialize.c @@ -2232,7 +2232,7 @@ nir_deserialize(void *mem_ctx, struct shader_info info; blob_copy_bytes(blob, (uint8_t *)&info, sizeof(info)); - ctx.nir = nir_shader_create(mem_ctx, info.stage, options, NULL); + ctx.nir = nir_shader_create(mem_ctx, info.stage, options); ctx.nir->has_debug_info = !!(flags & NIR_SERIALIZE_DEBUG_INFO); if (ctx.nir->has_debug_info) @@ -2294,7 +2294,7 @@ nir_deserialize_function(void *mem_ctx, ctx.idx_table_len = blob_read_uint32(blob); ctx.idx_table = calloc(ctx.idx_table_len, sizeof(uintptr_t)); - ctx.nir = nir_shader_create(mem_ctx, 0 /* stage */, options, NULL); + ctx.nir = nir_shader_create(mem_ctx, 0 /* stage */, options); nir_function *fxn = read_function(&ctx); nir_function_set_impl(fxn, read_function_impl(&ctx)); diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index eccd9d977c8..2377c410c82 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -7214,7 +7214,7 @@ spirv_to_nir(const uint32_t *words, size_t word_count, if (dump_path) vtn_dump_shader(b, dump_path, "spirv"); - b->shader = nir_shader_create(b, stage, nir_options, NULL); + b->shader = nir_shader_create(b, stage, nir_options); b->shader->info.subgroup_size = options->subgroup_size; b->shader->info.float_controls_execution_mode = options->float_controls_execution_mode; b->shader->info.cs.shader_index = options->shader_index; diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index 04d0be7d700..5db63cecb93 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -6602,7 +6602,7 @@ zink_shader_tcs_create(struct zink_screen *screen, unsigned vertices_per_patch) zs->programs = _mesa_pointer_set_create(NULL); simple_mtx_init(&zs->lock, mtx_plain); - nir_shader *nir = nir_shader_create(NULL, MESA_SHADER_TESS_CTRL, &screen->nir_options, NULL); + nir_shader *nir = nir_shader_create(NULL, MESA_SHADER_TESS_CTRL, &screen->nir_options); nir_function *fn = nir_function_create(nir, "main"); fn->is_entrypoint = true; nir_function_impl_create(fn); diff --git a/src/intel/compiler/elk/elk_test_fs_cmod_propagation.cpp b/src/intel/compiler/elk/elk_test_fs_cmod_propagation.cpp index 7d09320c8ff..fc1bc24ee25 100644 --- a/src/intel/compiler/elk/elk_test_fs_cmod_propagation.cpp +++ b/src/intel/compiler/elk/elk_test_fs_cmod_propagation.cpp @@ -78,8 +78,7 @@ cmod_propagation_test::cmod_propagation_test() params.mem_ctx = ctx; prog_data = ralloc(ctx, struct elk_wm_prog_data); - nir_shader *shader = - nir_shader_create(ctx, MESA_SHADER_FRAGMENT, NULL, NULL); + nir_shader *shader = nir_shader_create(ctx, MESA_SHADER_FRAGMENT, NULL); v = new cmod_propagation_fs_visitor(compiler, ¶ms, prog_data, shader); diff --git a/src/intel/compiler/elk/elk_test_fs_combine_constants.cpp b/src/intel/compiler/elk/elk_test_fs_combine_constants.cpp index f657723632a..8b6ce625812 100644 --- a/src/intel/compiler/elk/elk_test_fs_combine_constants.cpp +++ b/src/intel/compiler/elk/elk_test_fs_combine_constants.cpp @@ -26,8 +26,7 @@ struct FSCombineConstantsTest : public ::testing::Test { params.mem_ctx = mem_ctx; prog_data = {}; - nir_shader *nir = - nir_shader_create(mem_ctx, MESA_SHADER_COMPUTE, NULL, NULL); + nir_shader *nir = nir_shader_create(mem_ctx, MESA_SHADER_COMPUTE, NULL); shader = new elk_fs_visitor(&compiler, ¶ms, NULL, &prog_data.base, nir, 8, false, false); diff --git a/src/intel/compiler/elk/elk_test_fs_copy_propagation.cpp b/src/intel/compiler/elk/elk_test_fs_copy_propagation.cpp index 7854998629f..cd2429882a3 100644 --- a/src/intel/compiler/elk/elk_test_fs_copy_propagation.cpp +++ b/src/intel/compiler/elk/elk_test_fs_copy_propagation.cpp @@ -67,8 +67,7 @@ copy_propagation_test::copy_propagation_test() params.mem_ctx = ctx; prog_data = ralloc(ctx, struct elk_wm_prog_data); - nir_shader *shader = - nir_shader_create(ctx, MESA_SHADER_FRAGMENT, NULL, NULL); + nir_shader *shader = nir_shader_create(ctx, MESA_SHADER_FRAGMENT, NULL); v = new copy_propagation_fs_visitor(compiler, ¶ms, prog_data, shader); diff --git a/src/intel/compiler/elk/elk_test_fs_saturate_propagation.cpp b/src/intel/compiler/elk/elk_test_fs_saturate_propagation.cpp index 2428458fb83..80f3d8512f1 100644 --- a/src/intel/compiler/elk/elk_test_fs_saturate_propagation.cpp +++ b/src/intel/compiler/elk/elk_test_fs_saturate_propagation.cpp @@ -67,8 +67,7 @@ saturate_propagation_test::saturate_propagation_test() params.mem_ctx = ctx; prog_data = ralloc(ctx, struct elk_wm_prog_data); - nir_shader *shader = - nir_shader_create(ctx, MESA_SHADER_FRAGMENT, NULL, NULL); + nir_shader *shader = nir_shader_create(ctx, MESA_SHADER_FRAGMENT, NULL); v = new saturate_propagation_fs_visitor(compiler, ¶ms, prog_data, shader); diff --git a/src/intel/compiler/elk/elk_test_predicated_break.cpp b/src/intel/compiler/elk/elk_test_predicated_break.cpp index 48305c1c5c4..5d038999c81 100644 --- a/src/intel/compiler/elk/elk_test_predicated_break.cpp +++ b/src/intel/compiler/elk/elk_test_predicated_break.cpp @@ -48,8 +48,7 @@ PredicatedBreakTest::SetUp() params.mem_ctx = mem_ctx; prog_data = {}; - nir_shader *nir = - nir_shader_create(mem_ctx, MESA_SHADER_FRAGMENT, NULL, NULL); + nir_shader *nir = nir_shader_create(mem_ctx, MESA_SHADER_FRAGMENT, NULL); shader_a = new elk_fs_visitor(&compiler, ¶ms, NULL, &prog_data.base, nir, 8, false, false); diff --git a/src/intel/compiler/elk/elk_test_vec4_cmod_propagation.cpp b/src/intel/compiler/elk/elk_test_vec4_cmod_propagation.cpp index d4b0bca175e..7d555ea74eb 100644 --- a/src/intel/compiler/elk/elk_test_vec4_cmod_propagation.cpp +++ b/src/intel/compiler/elk/elk_test_vec4_cmod_propagation.cpp @@ -107,8 +107,7 @@ void cmod_propagation_vec4_test::SetUp() params.mem_ctx = ctx; prog_data = ralloc(ctx, struct elk_vue_prog_data); - nir_shader *shader = - nir_shader_create(ctx, MESA_SHADER_VERTEX, NULL, NULL); + nir_shader *shader = nir_shader_create(ctx, MESA_SHADER_VERTEX, NULL); v = new cmod_propagation_vec4_visitor(compiler, ¶ms, shader, prog_data); diff --git a/src/intel/compiler/elk/elk_test_vec4_copy_propagation.cpp b/src/intel/compiler/elk/elk_test_vec4_copy_propagation.cpp index fc5e993a892..2fa3e12282f 100644 --- a/src/intel/compiler/elk/elk_test_vec4_copy_propagation.cpp +++ b/src/intel/compiler/elk/elk_test_vec4_copy_propagation.cpp @@ -97,8 +97,7 @@ void copy_propagation_vec4_test::SetUp() params.mem_ctx = ctx; prog_data = ralloc(ctx, struct elk_vue_prog_data); - nir_shader *shader = - nir_shader_create(ctx, MESA_SHADER_VERTEX, NULL, NULL); + nir_shader *shader = nir_shader_create(ctx, MESA_SHADER_VERTEX, NULL); v = new copy_propagation_vec4_visitor(compiler, ¶ms, shader, prog_data); diff --git a/src/intel/compiler/elk/elk_test_vec4_dead_code_eliminate.cpp b/src/intel/compiler/elk/elk_test_vec4_dead_code_eliminate.cpp index 7b6f9607024..7f07e1aca09 100644 --- a/src/intel/compiler/elk/elk_test_vec4_dead_code_eliminate.cpp +++ b/src/intel/compiler/elk/elk_test_vec4_dead_code_eliminate.cpp @@ -97,8 +97,7 @@ void dead_code_eliminate_vec4_test::SetUp() params.mem_ctx = ctx; prog_data = ralloc(ctx, struct elk_vue_prog_data); - nir_shader *shader = - nir_shader_create(ctx, MESA_SHADER_VERTEX, NULL, NULL); + nir_shader *shader = nir_shader_create(ctx, MESA_SHADER_VERTEX, NULL); v = new dead_code_eliminate_vec4_visitor(compiler, ¶ms, shader, prog_data); diff --git a/src/intel/compiler/elk/elk_test_vec4_register_coalesce.cpp b/src/intel/compiler/elk/elk_test_vec4_register_coalesce.cpp index 0f91f9e4195..25f03683e55 100644 --- a/src/intel/compiler/elk/elk_test_vec4_register_coalesce.cpp +++ b/src/intel/compiler/elk/elk_test_vec4_register_coalesce.cpp @@ -101,8 +101,7 @@ void register_coalesce_vec4_test::SetUp() params = {}; params.mem_ctx = ctx; - nir_shader *shader = - nir_shader_create(ctx, MESA_SHADER_VERTEX, NULL, NULL); + nir_shader *shader = nir_shader_create(ctx, MESA_SHADER_VERTEX, NULL); v = new register_coalesce_vec4_visitor(compiler, ¶ms, shader, prog_data); diff --git a/src/intel/compiler/test_helpers.h b/src/intel/compiler/test_helpers.h index 4fdcbdcd11b..c1e4beaaa54 100644 --- a/src/intel/compiler/test_helpers.h +++ b/src/intel/compiler/test_helpers.h @@ -135,7 +135,7 @@ protected: if (dispatch_width == 0) dispatch_width = devinfo->ver >= 20 ? 16 : 8; - nir_shader *nir = nir_shader_create(mem_ctx, stage, NULL, NULL); + nir_shader *nir = nir_shader_create(mem_ctx, stage, NULL); brw_stage_prog_data *pd = (struct brw_stage_prog_data *)rzalloc(mem_ctx, brw_any_prog_data);