[Mesa-dev] [PATCH 56/88] glsl: don't reset sampler or image units on cache fallback

Timothy Arceri timothy.arceri at collabora.com
Sat Sep 24 05:25:37 UTC 2016


---
 src/compiler/glsl/link_uniforms.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index 799bcb2..a79bb33 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -1040,8 +1040,10 @@ link_assign_uniform_locations(struct gl_shader_program *prog,
        *     initializer, if present, or 0 if no initializer is present. Sampler
        *     types cannot have initializers."
        */
-      memset(sh->SamplerUnits, 0, sizeof(sh->SamplerUnits));
-      memset(sh->ImageUnits, 0, sizeof(sh->ImageUnits));
+      if (!is_cache_fallback) {
+         memset(sh->SamplerUnits, 0, sizeof(sh->SamplerUnits));
+         memset(sh->ImageUnits, 0, sizeof(sh->ImageUnits));
+      }
 
       link_update_uniform_buffer_variables(sh);
 
-- 
2.7.4



More information about the mesa-dev mailing list