summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2017-04-28 10:56:23 -0700
committerMatt Turner <mattst88@gmail.com>2017-04-28 11:24:42 -0700
commit389c581b01c8f3192c4215260d07140e43639082 (patch)
tree5a44c1c85348852d4a2546c5de980b2f66766f1f
parent75a31a20af269c047661af33e28f793269537b79 (diff)
i965: Don't allocate uniform space for samplersHEADmaster
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")
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp b/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
index f35e8f88dd2..2d9638049df 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) {