summaryrefslogtreecommitdiffstats
path: root/src/broadcom/compiler
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-01-04 13:33:35 -0800
committerEric Anholt <[email protected]>2019-01-14 13:18:02 -0800
commit051a41d3d56ee0eccf99e1871133cfaa4606b728 (patch)
treeac5524d428cffe6e47203af36a18168f7e100338 /src/broadcom/compiler
parentb417a9f7b26e46260044ce8adb16166aa0384396 (diff)
v3d: Add support for the early_fragment_tests flag.
If this flag hasn't been set by the shader and it has some visible side effects, then we need to disable EZ.
Diffstat (limited to 'src/broadcom/compiler')
-rw-r--r--src/broadcom/compiler/vir.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c
index 4e6149d11aa..ae7b362f3ba 100644
--- a/src/broadcom/compiler/vir.c
+++ b/src/broadcom/compiler/vir.c
@@ -781,6 +781,16 @@ v3d_fs_set_prog_data(struct v3d_compile *c,
prog_data->discard = (c->s->info.fs.uses_discard ||
c->fs_key->sample_alpha_to_coverage);
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