glsl: remove never true do_dead_code() parameter
Since we have now switched all drivers to using NIR and therefore the NIR based uniform linker this param never needs to be set to true so remove it. Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16924>
This commit is contained in:

committed by
Marge Bot

parent
3223f5b63f
commit
d09a37ef54
@@ -2112,8 +2112,7 @@ opt_shader_and_create_symbol_table(const struct gl_constants *consts,
|
||||
*
|
||||
* Run it just once, since NIR will do the real optimization.
|
||||
*/
|
||||
do_common_optimization(shader->ir, false, false, options,
|
||||
consts->NativeIntegers);
|
||||
do_common_optimization(shader->ir, false, options, consts->NativeIntegers);
|
||||
|
||||
validate_ir_tree(shader->ir);
|
||||
|
||||
@@ -2360,7 +2359,6 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
|
||||
*/
|
||||
bool
|
||||
do_common_optimization(exec_list *ir, bool linked,
|
||||
bool uniform_locations_assigned,
|
||||
const struct gl_shader_compiler_options *options,
|
||||
bool native_integers)
|
||||
{
|
||||
@@ -2398,7 +2396,7 @@ do_common_optimization(exec_list *ir, bool linked,
|
||||
OPT(opt_flip_matrices, ir);
|
||||
|
||||
if (linked)
|
||||
OPT(do_dead_code, ir, uniform_locations_assigned);
|
||||
OPT(do_dead_code, ir);
|
||||
else
|
||||
OPT(do_dead_code_unlinked, ir);
|
||||
OPT(do_dead_code_local, ir);
|
||||
|
@@ -212,8 +212,7 @@ glsl_to_nir(const struct gl_constants *consts,
|
||||
* TODO: add missing glsl ir to nir support and remove this loop.
|
||||
*/
|
||||
while (has_unsupported_function_param(sh->ir)) {
|
||||
do_common_optimization(sh->ir, true, true, gl_options,
|
||||
consts->NativeIntegers);
|
||||
do_common_optimization(sh->ir, true, gl_options, consts->NativeIntegers);
|
||||
}
|
||||
|
||||
nir_shader *shader = nir_shader_create(NULL, stage, options,
|
||||
|
@@ -79,7 +79,6 @@ enum lower_packing_builtins_op {
|
||||
};
|
||||
|
||||
bool do_common_optimization(exec_list *ir, bool linked,
|
||||
bool uniform_locations_assigned,
|
||||
const struct gl_shader_compiler_options *options,
|
||||
bool native_integers);
|
||||
|
||||
@@ -94,7 +93,7 @@ bool do_constant_variable(exec_list *instructions);
|
||||
bool do_constant_variable_unlinked(exec_list *instructions);
|
||||
bool do_copy_propagation_elements(exec_list *instructions);
|
||||
bool do_constant_propagation(exec_list *instructions);
|
||||
bool do_dead_code(exec_list *instructions, bool uniform_locations_assigned);
|
||||
bool do_dead_code(exec_list *instructions);
|
||||
bool do_dead_code_local(exec_list *instructions);
|
||||
bool do_dead_code_unlinked(exec_list *instructions);
|
||||
bool do_dead_functions(exec_list *instructions);
|
||||
|
@@ -3566,8 +3566,7 @@ linker_optimisation_loop(const struct gl_constants *consts, exec_list *ir,
|
||||
unsigned stage)
|
||||
{
|
||||
/* Run it just once, since NIR will do the real optimizaiton. */
|
||||
do_common_optimization(ir, true, false,
|
||||
&consts->ShaderCompilerOptions[stage],
|
||||
do_common_optimization(ir, true, &consts->ShaderCompilerOptions[stage],
|
||||
consts->NativeIntegers);
|
||||
}
|
||||
|
||||
|
@@ -43,7 +43,7 @@ static bool debug = false;
|
||||
* for usage on an unlinked instruction stream.
|
||||
*/
|
||||
bool
|
||||
do_dead_code(exec_list *instructions, bool uniform_locations_assigned)
|
||||
do_dead_code(exec_list *instructions)
|
||||
{
|
||||
ir_variable_refcount_visitor v;
|
||||
bool progress = false;
|
||||
@@ -122,12 +122,11 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned)
|
||||
*/
|
||||
|
||||
/* uniform initializers are precious, and could get used by another
|
||||
* stage. Also, once uniform locations have been assigned, the
|
||||
* declaration cannot be deleted.
|
||||
* stage.
|
||||
*/
|
||||
if (entry->var->data.mode == ir_var_uniform ||
|
||||
entry->var->data.mode == ir_var_shader_storage) {
|
||||
if (uniform_locations_assigned || entry->var->constant_initializer)
|
||||
if (entry->var->constant_initializer)
|
||||
continue;
|
||||
|
||||
/* Section 2.11.6 (Uniform Variables) of the OpenGL ES 3.0.3 spec
|
||||
@@ -188,12 +187,7 @@ do_dead_code_unlinked(exec_list *instructions)
|
||||
ir_function *f = ir->as_function();
|
||||
if (f) {
|
||||
foreach_in_list(ir_function_signature, sig, &f->signatures) {
|
||||
/* The setting of the uniform_locations_assigned flag here is
|
||||
* irrelevent. If there is a uniform declaration encountered
|
||||
* inside the body of the function, something has already gone
|
||||
* terribly, terribly wrong.
|
||||
*/
|
||||
if (do_dead_code(&sig->body, false))
|
||||
if (do_dead_code(&sig->body))
|
||||
progress = true;
|
||||
}
|
||||
}
|
||||
|
@@ -545,7 +545,6 @@ standalone_compile_shader(const struct standalone_options *_options,
|
||||
progress = do_function_inlining(ir);
|
||||
|
||||
progress = do_common_optimization(ir,
|
||||
false,
|
||||
false,
|
||||
compiler_options,
|
||||
true)
|
||||
|
@@ -63,7 +63,7 @@ do_optimization(struct exec_list *ir, const char *optimization,
|
||||
int int_3;
|
||||
|
||||
if (sscanf(optimization, "do_common_optimization ( %d ) ", &int_0) == 1) {
|
||||
return do_common_optimization(ir, int_0 != 0, false, options, true);
|
||||
return do_common_optimization(ir, int_0 != 0, options, true);
|
||||
} else if (strcmp(optimization, "do_algebraic") == 0) {
|
||||
return do_algebraic(ir, true, options);
|
||||
} else if (strcmp(optimization, "do_constant_folding") == 0) {
|
||||
@@ -77,7 +77,7 @@ do_optimization(struct exec_list *ir, const char *optimization,
|
||||
} else if (strcmp(optimization, "do_constant_propagation") == 0) {
|
||||
return do_constant_propagation(ir);
|
||||
} else if (strcmp(optimization, "do_dead_code") == 0) {
|
||||
return do_dead_code(ir, false);
|
||||
return do_dead_code(ir);
|
||||
} else if (strcmp(optimization, "do_dead_code_local") == 0) {
|
||||
return do_dead_code_local(ir);
|
||||
} else if (strcmp(optimization, "do_dead_code_unlinked") == 0) {
|
||||
|
Reference in New Issue
Block a user