summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2015-12-19 14:43:13 +1000
committerDave Airlie <[email protected]>2016-01-01 09:43:53 +1000
commit14506dcae20d89ae9380c7a4f1843586c59db16d (patch)
treec1c319a9628cccc4220dd89b526602b3918ee5c0
parentaab0c6c9c400bc7f83516b29cf736fa7ce1f2a13 (diff)
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 <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp9
1 files changed, 7 insertions, 2 deletions
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. */