summaryrefslogtreecommitdiffstats
path: root/src/glsl/linker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r--src/glsl/linker.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 2fece74d552..dbcc5b4578f 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1832,9 +1832,10 @@ update_array_sizes(struct gl_shader_program *prog)
* Determine the number of slots per array element by dividing by
* the old (total) size.
*/
- if (var->num_state_slots > 0) {
- var->num_state_slots = (size + 1)
- * (var->num_state_slots / var->type->length);
+ const unsigned num_slots = var->get_num_state_slots();
+ if (num_slots > 0) {
+ var->set_num_state_slots((size + 1)
+ * (num_slots / var->type->length));
}
var->type = glsl_type::get_array_instance(var->type->fields.array,