diff options
author | Tapani Pälli <[email protected]> | 2020-01-07 17:56:26 +0200 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2020-01-09 07:28:13 +0200 |
commit | 1e29ff7b3dab02aa8cf87144e38b10d2c9e19813 (patch) | |
tree | 59bf8048f0b2f91081322de50a37e97ff2f61d20 /src | |
parent | ee9879335e6c798dff4cacef9096265912268ce4 (diff) |
mesa: create program resource hash in a single place
This is a cleanup but also a fix for commit dd09f1d806b. In case of
i965 we did not actually create hash for cached shader programs.
Fixes: dd09f1d806b "mesa/st/i965: add a ProgramResourceHash for quicker resource lookup"
Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_link.cpp | 2 | ||||
-rw-r--r-- | src/mesa/program/ir_to_mesa.cpp | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 |
4 files changed, 3 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp index 8a62ffd760b..2a844575c3d 100644 --- a/src/mesa/drivers/dri/i965/brw_link.cpp +++ b/src/mesa/drivers/dri/i965/brw_link.cpp @@ -388,8 +388,6 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg) else nir_build_program_resource_list(ctx, shProg, true); - _mesa_create_program_resource_hash(shProg); - for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) { struct gl_linked_shader *shader = shProg->_LinkedShaders[stage]; if (!shader) diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 293c412d23d..bcf50c505e1 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -3187,6 +3187,9 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) prog->data->LinkStatus = LINKING_FAILURE; } + if (prog->data->LinkStatus != LINKING_FAILURE) + _mesa_create_program_resource_hash(prog); + /* Return early if we are loading the shader from on-disk cache */ if (prog->data->LinkStatus == LINKING_SKIPPED) return; diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index b01cc3fd8d9..c92b1c365a7 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -843,8 +843,6 @@ st_link_nir(struct gl_context *ctx, prev_info = info; } - _mesa_create_program_resource_hash(shader_program); - return true; } diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index cd77effebc4..b6c2c2deb77 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -7428,7 +7428,5 @@ st_link_tgsi(struct gl_context *ctx, struct gl_shader_program *prog) } } - _mesa_create_program_resource_hash(prog); - return GL_TRUE; } |