From ce8504d196291452b42ed755ed3830ecb16febcd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 19 Jul 2016 11:10:36 -0700 Subject: vc4: Disable early Z with computed depth. We don't tell the hardware whether we're computing depth, so we need to manage early Z state manually. Fixes piglit early-z. --- src/gallium/drivers/vc4/vc4_program.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gallium/drivers/vc4/vc4_program.c') diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 4ee49a258f1..9057b86068e 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -2253,6 +2253,11 @@ vc4_get_compiled_shader(struct vc4_context *vc4, enum qstage stage, shader->input_slots[shader->num_inputs] = *slot; shader->num_inputs++; } + + /* Note: the temporary clone in c->s has been freed. */ + nir_shader *orig_shader = key->shader_state->base.ir.nir; + if (orig_shader->info.outputs_written & (1 << FRAG_RESULT_DEPTH)) + shader->disable_early_z = true; } else { shader->num_inputs = c->num_inputs; -- cgit v1.2.3