array_insert(ctx->ir, ctx->ir->predicates, kill);
array_insert(b, b->keeps, kill);
- ctx->so->no_earlyz = true;
+ ctx->so->has_kill = true;
break;
}
bool need_fine_derivatives;
- /* do we have kill, image write, etc (which prevents early-z): */
+ /* do we have image write, etc (which prevents early-z): */
bool no_earlyz;
+ /* do we have kill, which also prevents early-z, but not necessarily
+ * early-lrz (as long as lrz-write is disabled, which must be handled
+ * outside of ir3. Unlike other no_earlyz cases, kill doesn't have
+ * side effects that prevent early-lrz discard.
+ */
+ bool has_kill;
+
bool per_samp;
/* for astc srgb workaround, the number/base of additional
uint32_t gras_su_depth_plane_cntl = 0;
uint32_t rb_depth_plane_cntl = 0;
- if (fs->no_earlyz || fs->writes_pos) {
+ if (fs->no_earlyz || fs->has_kill || fs->writes_pos) {
gras_su_depth_plane_cntl |= A6XX_GRAS_SU_DEPTH_PLANE_CNTL_FRAG_WRITES_Z;
rb_depth_plane_cntl |= A6XX_RB_DEPTH_PLANE_CNTL_FRAG_WRITES_Z;
}
val |= A3XX_RB_DEPTH_CONTROL_FRAG_WRITES_Z;
val |= A3XX_RB_DEPTH_CONTROL_EARLY_Z_DISABLE;
}
- if (fp->no_earlyz) {
+ if (fp->no_earlyz || fp->has_kill) {
val |= A3XX_RB_DEPTH_CONTROL_EARLY_Z_DISABLE;
}
if (!ctx->rasterizer->depth_clip_near) {
if (dirty & (FD_DIRTY_ZSA | FD_DIRTY_RASTERIZER | FD_DIRTY_PROG)) {
struct fd4_zsa_stateobj *zsa = fd4_zsa_stateobj(ctx->zsa);
- bool fragz = fp->no_earlyz | fp->writes_pos;
+ bool fragz = fp->no_earlyz | fp->has_kill | fp->writes_pos;
bool clamp = !ctx->rasterizer->depth_clip_near;
OUT_PKT0(ring, REG_A4XX_RB_DEPTH_CONTROL, 1);
/* figure out whether we need to disable LRZ write for binning
* pass using draw pass's fp:
*/
- emit.no_lrz_write = fp->writes_pos || fp->no_earlyz;
+ emit.no_lrz_write = fp->writes_pos || fp->no_earlyz || fp->has_kill;
emit.binning_pass = false;
emit.dirty = dirty;
if (dirty & (FD_DIRTY_ZSA | FD_DIRTY_RASTERIZER | FD_DIRTY_PROG)) {
struct fd5_zsa_stateobj *zsa = fd5_zsa_stateobj(ctx->zsa);
- bool fragz = fp->no_earlyz | fp->writes_pos;
+ bool fragz = fp->no_earlyz || fp->has_kill || fp->writes_pos;
OUT_PKT4(ring, REG_A5XX_RB_DEPTH_CNTL, 1);
OUT_RING(ring, zsa->rb_depth_cntl);
/* figure out whether we need to disable LRZ write for binning
* pass using draw pass's fs:
*/
- emit.no_lrz_write = emit.fs->writes_pos || emit.fs->no_earlyz;
+ emit.no_lrz_write = emit.fs->writes_pos || emit.fs->no_earlyz || emit.fs->has_kill;
struct fd_ringbuffer *ring = ctx->batch->draw;
OUT_RING(ring,
COND(primid_passthru, A6XX_VFD_CONTROL_6_PRIMID_PASSTHRU)); /* VFD_CONTROL_6 */
- bool fragz = fs->no_earlyz | fs->writes_pos;
+ bool fragz = fs->no_earlyz || fs->has_kill || fs->writes_pos;
OUT_PKT4(ring, REG_A6XX_RB_DEPTH_PLANE_CNTL, 1);
OUT_RING(ring, COND(fragz, A6XX_RB_DEPTH_PLANE_CNTL_FRAG_WRITES_Z));