mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-30 14:50:44 +02:00
nir: remove unused shader_info param in nir_create_shader
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37258>
This commit is contained in:
parent
1eb4a2f5cd
commit
95c2a65662
18 changed files with 25 additions and 42 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue