Mesa (staging/19.0): glsl: Set location on structure-split sampler uniform variables
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Apr 12 20:37:20 UTC 2019
Module: Mesa
Branch: staging/19.0
Commit: 2e63686268028a72df23555253d5ba99aaea9924
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e63686268028a72df23555253d5ba99aaea9924
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Thu Apr 11 07:04:58 2019 -0700
glsl: Set location on structure-split sampler uniform variables
gl_nir_lower_samplers_as_deref splits structure uniform variables,
creating new variables for individual fields. As part of that, it
calculates a new location. It then never set this on the new variables.
Thanks to Michael Fiano for finding this bug. Fixes crashes on i965
with Piglit's new tests/spec/glsl-1.10/execution/samplers/uniform-struct
test, which was reduced from the failing case in Michael's app.
Fixes: f003859f97c nir: Make gl_nir_lower_samplers use gl_nir_lower_samplers_as_deref
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
(cherry picked from commit 9e0c744f07a21fc7bb018a77cf83b057436d0d1b)
---
src/compiler/glsl/gl_nir_lower_samplers_as_deref.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c b/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c
index 719968a6671..9bd0f9a4eb3 100644
--- a/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c
+++ b/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c
@@ -167,6 +167,7 @@ lower_deref(nir_builder *b, struct lower_samplers_as_deref_state *state,
} else {
var = nir_variable_create(state->shader, nir_var_uniform, type, name);
var->data.binding = binding;
+ var->data.location = location;
_mesa_hash_table_insert_pre_hashed(state->remap_table, hash, name, var);
}
More information about the mesa-commit
mailing list