summaryrefslogtreecommitdiffstats
path: root/src/broadcom/compiler/vir.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-09-28 10:37:02 -0700
committerEric Anholt <[email protected]>2017-10-10 11:42:05 -0700
commit732a3a72cb8b5c78e95eee47572701b3f6055c19 (patch)
tree5953561d0a1a8843e94a020fd87ecc4cf96bf895 /src/broadcom/compiler/vir.c
parent4c4fbab345c164284e62e5e2587382785ade1750 (diff)
broadcom/compiler: Set up passthrough Z when doing FS discards.
In order to keep early-Z from writing early in a discard shader, you need to set the "modifies Z" bit in the shader state (which the new prog_data.discards will indicate). Then, in the shader we do a TLB write to make Z passthrough happen (the QPU result is ignored, so we use a NULL source).
Diffstat (limited to 'src/broadcom/compiler/vir.c')
-rw-r--r--src/broadcom/compiler/vir.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c
index 35df757a208..1c25da6193c 100644
--- a/src/broadcom/compiler/vir.c
+++ b/src/broadcom/compiler/vir.c
@@ -762,8 +762,9 @@ uint64_t *v3d_compile_fs(const struct v3d_compiler *compiler,
v3d_set_prog_data(c, &prog_data->base);
v3d_set_fs_prog_data_inputs(c, prog_data);
- if (c->s->info.outputs_written & (1 << FRAG_RESULT_DEPTH))
- prog_data->writes_z = true;
+ prog_data->writes_z = (c->s->info.outputs_written &
+ (1 << FRAG_RESULT_DEPTH));
+ prog_data->discard = c->s->info.fs.uses_discard;
return v3d_return_qpu_insts(c, final_assembly_size);
}