From: Rob Clark Date: Sat, 25 Jun 2016 00:03:37 +0000 (-0400) Subject: i965: don't drop const initializers in vector splitting X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01ccb0d91e6f976716eb79cdb0fb11ad4d0b4fcf;p=mesa.git i965: don't drop const initializers in vector splitting Signed-off-by: Rob Clark Reviewed-by: Kenneth Graunke --- 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]); }