summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-04-09 11:19:24 -0700
committerIan Romanick <[email protected]>2012-05-23 11:42:08 -0700
commitc343b980d615bb3a159e0adc6e7597f2f9865323 (patch)
treec5b99659365859b048f4388bac0641b95c468e90 /src/mesa
parent76027f5b5cd8017f8455e2df375fcea7cc888dce (diff)
ir_to_mesa: Propagate initial values in _mesa_associate_uniform_storage
The linker may have set initial values for uniforms. Propagate these values to the driver's backing storage when it is first associated. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 840648e0449..b8e256069f7 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2526,6 +2526,15 @@ _mesa_associate_uniform_storage(struct gl_context *ctx,
4 * sizeof(float),
format,
&params->ParameterValues[i]);
+
+ /* After attaching the driver's storage to the uniform, propagate any
+ * data from the linker's backing store. This will cause values from
+ * initializers in the source code to be copied over.
+ */
+ _mesa_propagate_uniforms_to_driver_storage(storage,
+ 0,
+ MAX2(1, storage->array_elements));
+
last_location = location;
}
}