diff options
author | marha <marha@users.sourceforge.net> | 2011-03-30 07:22:44 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-03-30 07:22:44 +0000 |
commit | 4e1588b6805ee5c7cd34e733cd1eff098d063b95 (patch) | |
tree | 763d6761b0131ecd36be7b0d48d2e644b8a25c95 /mesalib/src/glsl/linker.cpp | |
parent | a69f20daead874a20fad57a4fadd99df393f28d6 (diff) | |
parent | aee5cfef9a419ee2845d66b0c31e476880bea663 (diff) | |
download | vcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.tar.gz vcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.tar.bz2 vcxsrv-4e1588b6805ee5c7cd34e733cd1eff098d063b95.zip |
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/glsl/linker.cpp')
-rw-r--r-- | mesalib/src/glsl/linker.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp index 7760b4f2c..16894757b 100644 --- a/mesalib/src/glsl/linker.cpp +++ b/mesalib/src/glsl/linker.cpp @@ -994,6 +994,19 @@ update_array_sizes(struct gl_shader_program *prog) }
if (size + 1 != var->type->fields.array->length) {
+ /* If this is a built-in uniform (i.e., it's backed by some
+ * fixed-function state), adjust the number of state slots to
+ * match the new array size. The number of slots per array entry
+ * is not known. It seems saft to assume that the total number of
+ * slots is an integer multiple of the number of array elements.
+ * 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);
+ }
+
var->type = glsl_type::get_array_instance(var->type->fields.array,
size + 1);
/* FINISHME: We should update the types of array
|