From ae002824cde9ad99dd208ce20a40e6f62f1f305a Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Fri, 28 Apr 2017 10:56:23 -0700 Subject: [PATCH] i965: Don't allocate uniform space for samplers Samplers are encoded into the instruction word, so there's no need to make space in the uniform file. Previously matrix_columns and vector_elements were set to 0, making this else case a no-op. Commit 75a31a20af26 changed that, causing malloc corruption in thousands of tests on i965. Fixes: 75a31a20af26 ("glsl: set vector_elements to 1 for samplers") --- src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp b/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp index f35e8f8..2d96380 100644 --- a/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp +++ b/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp @@ -190,7 +190,9 @@ brw_nir_setup_glsl_uniforms(nir_shader *shader, const struct gl_program *prog, nir_foreach_variable(var, &shader->uniforms) { /* UBO's, atomics and samplers don't take up space in the uniform file */ - if (var->interface_type != NULL || var->type->contains_atomic()) + if (var->interface_type != NULL || + var->type->contains_atomic() || + var->type->contains_sampler()) continue; if (strncmp(var->name, "gl_", 3) == 0) { -- 2.10.2