X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fi965%2Fbrw_fs_vector_splitting.cpp;h=5c05586f49ab7d43d896e43be2a3f21a1881d311;hb=be095e11e41158f91bcb3f6fcbc2e2a91a5d9124;hp=cab5af318a26cfe4613ddddadd6626d12be265f3;hpb=958fc04dc51a2561c8598f42df59e3d9139e56a7;p=mesa.git 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 cab5af318a2..5c05586f49a 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp @@ -37,12 +37,10 @@ * behavior we want for the results of texture lookups, but probably not for */ -#include "main/core.h" -#include "brw_context.h" -#include "glsl/ir.h" -#include "glsl/ir_visitor.h" -#include "glsl/ir_rvalue_visitor.h" -#include "glsl/nir/glsl_types.h" +#include "main/imports.h" +#include "compiler/glsl/ir.h" +#include "compiler/glsl/ir_rvalue_visitor.h" +#include "compiler/glsl_types.h" #include "util/hash_table.h" static bool debug = false; @@ -107,6 +105,7 @@ ir_vector_reference_visitor::get_variable_entry(ir_variable *var) switch (var->data.mode) { case ir_var_uniform: case ir_var_shader_storage: + case ir_var_shader_shared: case ir_var_shader_in: case ir_var_shader_out: case ir_var_system_value: @@ -373,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]); }