v3d: Use the early_fragment_tests flag for the shader's disable-EZ field.

Apparently we need disable-EZ flagged, not just "does Z writes".

Fixes
dEQP-GLES31.functional.image_load_store.early_fragment_tests.no_early_fragment_tests_depth_fbo
on 7278, even though it passed in simulation.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: 051a41d3d5 ("v3d: Add support for the early_fragment_tests flag.")
This commit is contained in:
Eric Anholt
2019-02-12 14:39:40 -08:00
parent 332b969c4e
commit cd5e0b2729
4 changed files with 23 additions and 17 deletions

View File

@@ -745,21 +745,9 @@ v3d_fs_set_prog_data(struct v3d_compile *c,
struct v3d_fs_prog_data *prog_data)
{
v3d_set_fs_prog_data_inputs(c, prog_data);
prog_data->writes_z = (c->s->info.outputs_written &
(1 << FRAG_RESULT_DEPTH));
prog_data->discard = (c->s->info.fs.uses_discard ||
c->fs_key->sample_alpha_to_coverage);
prog_data->writes_z = c->writes_z;
prog_data->disable_ez = !c->s->info.fs.early_fragment_tests;
prog_data->uses_center_w = c->uses_center_w;
/* If the shader has some side effects and hasn't allowed early
* fragment tests, disable them.
*/
if (!c->s->info.fs.early_fragment_tests &&
(c->s->info.num_images ||
c->s->info.num_ssbos ||
c->s->info.num_abos)) {
prog_data->discard = true;
}
}
static void
@@ -856,6 +844,15 @@ v3d_nir_lower_fs_early(struct v3d_compile *c)
{
if (c->fs_key->int_color_rb || c->fs_key->uint_color_rb)
v3d_fixup_fs_output_types(c);
/* If the shader has no non-TLB side effects, we can promote it to
* enabling early_fragment_tests even if the user didn't.
*/
if (!(c->s->info.num_images ||
c->s->info.num_ssbos ||
c->s->info.num_abos)) {
c->s->info.fs.early_fragment_tests = true;
}
}
static void