[Mesa-dev] [PATCH 34/56] glsl: skip more uniform initialisation when doing fallback linking
Timothy Arceri
timothy.arceri at collabora.com
Tue Nov 29 03:58:33 UTC 2016
We already pull these values from the metadata cache so no need to
recreate them.
---
src/compiler/glsl/linker.cpp | 20 ++++++++++++--------
src/mesa/main/shaderobj.c | 8 +++++---
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 0dcf00d..b609c86 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -4698,13 +4698,15 @@ link_varyings_and_uniforms(unsigned first, unsigned last,
update_array_sizes(prog);
link_assign_uniform_locations(prog, ctx, num_explicit_uniform_locs);
- link_assign_atomic_counter_resources(ctx, prog);
- link_calculate_subroutine_compat(prog);
- check_resources(ctx, prog);
- check_subroutine_resources(prog);
- check_image_resources(ctx, prog);
- link_check_atomic_counter_resources(ctx, prog);
+ if (!prog->data->cache_fallback) {
+ link_assign_atomic_counter_resources(ctx, prog);
+ link_calculate_subroutine_compat(prog);
+ check_resources(ctx, prog);
+ check_subroutine_resources(prog);
+ check_image_resources(ctx, prog);
+ link_check_atomic_counter_resources(ctx, prog);
+ }
if (!prog->data->LinkStatus)
return false;
@@ -4940,8 +4942,10 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
last = i;
}
- num_explicit_uniform_locs = check_explicit_uniform_locations(ctx, prog);
- link_assign_subroutine_types(prog);
+ if (!prog->data->cache_fallback) {
+ num_explicit_uniform_locs = check_explicit_uniform_locations(ctx, prog);
+ link_assign_subroutine_types(prog);
+ }
if (!prog->data->LinkStatus)
goto done;
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index b197144..8dca7ec 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -362,9 +362,11 @@ _mesa_clear_shader_program_data(struct gl_context *ctx,
shProg->data->ShaderStorageBlocks = NULL;
shProg->data->NumShaderStorageBlocks = 0;
- ralloc_free(shProg->data->AtomicBuffers);
- shProg->data->AtomicBuffers = NULL;
- shProg->data->NumAtomicBuffers = 0;
+ if (shProg->data->AtomicBuffers && !shProg->data->cache_fallback) {
+ ralloc_free(shProg->data->AtomicBuffers);
+ shProg->data->AtomicBuffers = NULL;
+ shProg->data->NumAtomicBuffers = 0;
+ }
if (shProg->data->ProgramResourceList) {
ralloc_free(shProg->data->ProgramResourceList);
--
2.7.4
More information about the mesa-dev
mailing list