From 14506dcae20d89ae9380c7a4f1843586c59db16d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 19 Dec 2015 14:43:13 +1000 Subject: st/glsl_to_tgsi: handle doubles in array shrinking code. This code takes into account double inputs in the array shrinking code. This fixes some issues with doubles and geom/tess inputs. Signed-off-by: Dave Airlie --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index d152bf93485..6eb31b330b5 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -2372,6 +2372,7 @@ glsl_to_tgsi_visitor::visit(ir_dereference_variable *ir) static void shrink_array_declarations(struct array_decl *arrays, unsigned count, GLbitfield64 usage_mask, + GLbitfield64 double_usage_mask, GLbitfield patch_usage_mask) { unsigned i, j; @@ -2392,6 +2393,8 @@ shrink_array_declarations(struct array_decl *arrays, unsigned count, else { if (usage_mask & BITFIELD64_BIT(decl->mesa_index+j)) break; + if (double_usage_mask & BITFIELD64_BIT(decl->mesa_index+j-1)) + break; } decl->mesa_index++; @@ -2409,6 +2412,8 @@ shrink_array_declarations(struct array_decl *arrays, unsigned count, else { if (usage_mask & BITFIELD64_BIT(decl->mesa_index+j)) break; + if (double_usage_mask & BITFIELD64_BIT(decl->mesa_index+j-1)) + break; } decl->array_size--; @@ -5587,9 +5592,9 @@ get_mesa_program(struct gl_context *ctx, do_set_program_inouts(shader->ir, prog, shader->Stage); shrink_array_declarations(v->input_arrays, v->num_input_arrays, - prog->InputsRead, prog->PatchInputsRead); + prog->InputsRead, prog->DoubleInputsRead, prog->PatchInputsRead); shrink_array_declarations(v->output_arrays, v->num_output_arrays, - prog->OutputsWritten, prog->PatchOutputsWritten); + prog->OutputsWritten, 0ULL, prog->PatchOutputsWritten); count_resources(v, prog); /* This must be done before the uniform storage is associated. */ -- cgit v1.2.3