mesa: remove _mesa_ir_link_shader()

The final use of this was removed when the classic drivers were
dropped.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14066>
This commit is contained in:
Timothy Arceri
2021-12-05 12:58:18 +11:00
committed by Marge Bot
parent d44478483c
commit 33cbab854e
4 changed files with 0 additions and 99 deletions

View File

@@ -483,10 +483,3 @@ _mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name,
{
return _mesa_lookup_shader_program_err_glthread(ctx, name, false, caller);
}
void
_mesa_init_shader_object_functions(struct dd_function_table *driver)
{
driver->LinkShader = _mesa_ir_link_shader;
}

View File

@@ -123,10 +123,6 @@ extern void
_mesa_delete_shader_program(struct gl_context *ctx,
struct gl_shader_program *shProg);
extern void
_mesa_init_shader_object_functions(struct dd_function_table *driver);
static inline gl_shader_stage
_mesa_shader_enum_to_shader_stage(GLenum v)
{

View File

@@ -3002,93 +3002,6 @@ fail_exit:
extern "C" {
/**
* Link a shader.
* Called via ctx->Driver.LinkShader()
* This actually involves converting GLSL IR into Mesa gl_programs with
* code lowering and other optimizations.
*/
GLboolean
_mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
{
assert(prog->data->LinkStatus);
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
if (prog->_LinkedShaders[i] == NULL)
continue;
bool progress;
exec_list *ir = prog->_LinkedShaders[i]->ir;
const struct gl_shader_compiler_options *options =
&ctx->Const.ShaderCompilerOptions[prog->_LinkedShaders[i]->Stage];
do {
progress = false;
/* Lowering */
do_mat_op_to_vec(ir);
lower_instructions(ir, (MOD_TO_FLOOR | DIV_TO_MUL_RCP | EXP_TO_EXP2
| LOG_TO_LOG2 | INT_DIV_TO_MUL_RCP
| MUL64_TO_MUL_AND_MUL_HIGH
| ((options->EmitNoPow) ? POW_TO_EXP2 : 0)));
progress = do_common_optimization(ir, true, true,
options, ctx->Const.NativeIntegers)
|| progress;
progress = lower_quadop_vector(ir, true) || progress;
if (options->MaxIfDepth == 0)
progress = lower_discard(ir) || progress;
progress = lower_if_to_cond_assign((gl_shader_stage)i, ir,
options->MaxIfDepth) || progress;
/* If there are forms of indirect addressing that the driver
* cannot handle, perform the lowering pass.
*/
if (options->EmitNoIndirectInput || options->EmitNoIndirectOutput
|| options->EmitNoIndirectTemp || options->EmitNoIndirectUniform)
progress =
lower_variable_index_to_cond_assign(prog->_LinkedShaders[i]->Stage, ir,
options->EmitNoIndirectInput,
options->EmitNoIndirectOutput,
options->EmitNoIndirectTemp,
options->EmitNoIndirectUniform)
|| progress;
progress = do_vec_index_to_cond_assign(ir) || progress;
progress = lower_vector_insert(ir, true) || progress;
} while (progress);
validate_ir_tree(ir);
}
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
struct gl_program *linked_prog;
if (prog->_LinkedShaders[i] == NULL)
continue;
linked_prog = get_mesa_program(ctx, prog, prog->_LinkedShaders[i]);
if (linked_prog) {
_mesa_copy_linked_program_data(prog, prog->_LinkedShaders[i]);
if (!ctx->Driver.ProgramStringNotify(ctx,
_mesa_shader_stage_to_program(i),
linked_prog)) {
_mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
NULL);
return GL_FALSE;
}
}
}
build_program_resource_list(ctx, prog, false);
return prog->data->LinkStatus;
}
/**
* Link a GLSL shader program. Called via glLinkProgram().
*/

View File

@@ -38,7 +38,6 @@ struct gl_linked_shader;
struct gl_program_parameter_list;
void _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
GLboolean _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
void
_mesa_generate_parameters_list_for_uniforms(struct gl_context *ctx,