summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-06-24 20:03:37 -0400
committerRob Clark <[email protected]>2016-07-02 09:00:19 -0400
commit01ccb0d91e6f976716eb79cdb0fb11ad4d0b4fcf (patch)
tree39612c7d7646fa6b76990a387386cb63bcfdc4d2 /src/mesa/drivers
parentf78a6b1ce398a537d77c25b1a93f156109086975 (diff)
i965: don't drop const initializers in vector splitting
Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
index 5fe24debeec..5c05586f49a 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
@@ -372,6 +372,18 @@ brw_do_vector_splitting(exec_list *instructions)
ralloc_free(name);
+ if (entry->var->constant_initializer) {
+ ir_constant_data data = {0};
+ assert(entry->var->data.has_initializer);
+ if (entry->var->type->is_double()) {
+ data.d[0] = entry->var->constant_initializer->value.d[i];
+ } else {
+ data.u[0] = entry->var->constant_initializer->value.u[i];
+ }
+ entry->components[i]->data.has_initializer = true;
+ entry->components[i]->constant_initializer = new(entry->components[i]) ir_constant(type, &data);
+ }
+
entry->var->insert_before(entry->components[i]);
}