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

Timothy Arceri timothy.arceri at collabora.com
Mon Oct 3 06:05:08 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 ad7e8b7..37cc8d4 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -1277,8 +1277,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