diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 813fe899626..c23c2e7a9db 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -551,8 +551,7 @@ panfrost_prepare_midgard_fs_state(struct panfrost_context *ctx, * lying to the hardware about the discard and setting the * reads tilebuffer? flag to compensate */ state->properties.midgard.shader_reads_tilebuffer = - fs->info.fs.outputs_read || - (!zsa->enabled && fs->info.fs.can_discard); + !zsa->enabled && fs->info.fs.can_discard; state->properties.midgard.shader_contains_discard = zsa->enabled && fs->info.fs.can_discard; } diff --git a/src/panfrost/lib/pan_shader.h b/src/panfrost/lib/pan_shader.h index 732e0fc821e..c31c35dfc6d 100644 --- a/src/panfrost/lib/pan_shader.h +++ b/src/panfrost/lib/pan_shader.h @@ -55,8 +55,12 @@ pan_shader_prepare_midgard_rsd(const struct pan_shader_info *info, /* For fragment shaders, work register count, early-z, reads at draw-time */ - if (info->stage != MESA_SHADER_FRAGMENT) + if (info->stage != MESA_SHADER_FRAGMENT) { rsd->properties.midgard.work_register_count = info->work_reg_count; + } else { + rsd->properties.midgard.shader_reads_tilebuffer = + info->fs.outputs_read; + } } /* Classify a shader into the following pixel kill categories: