diff --git a/src/gallium/drivers/v3d/v3d_job.c b/src/gallium/drivers/v3d/v3d_job.c index c03fa8c7ea3..ae827d9091b 100644 --- a/src/gallium/drivers/v3d/v3d_job.c +++ b/src/gallium/drivers/v3d/v3d_job.c @@ -426,6 +426,10 @@ v3d_get_job_for_fbo(struct v3d_context *v3d) struct v3d_resource *rsc = v3d_resource(cbufs[i]->texture); if (!rsc->writes) job->clear_tlb |= PIPE_CLEAR_COLOR0 << i; + if (rsc->invalidated) { + job->invalidated_load |= PIPE_CLEAR_COLOR0 << i; + rsc->invalidated = false; + } } } @@ -439,6 +443,16 @@ v3d_get_job_for_fbo(struct v3d_context *v3d) if (!rsc->writes) job->clear_tlb |= PIPE_CLEAR_STENCIL; + if (rsc->invalidated) { + /* Currently gallium only applies invalidates if it + * affects both depth and stencil together. + */ + job->invalidated_load |= + PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL; + rsc->invalidated = false; + if (rsc->separate_stencil) + rsc->separate_stencil->invalidated = false; + } } job->tile_desc.draw_x = DIV_ROUND_UP(v3d->framebuffer.width, diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index 3853f2ef722..506284dae98 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -1094,13 +1094,8 @@ v3d_update_job_tlb_load_store(struct v3d_job *job) { if (job->store & bit || !job->cbufs[i]) continue; struct v3d_resource *rsc = v3d_resource(job->cbufs[i]->texture); + job->load |= bit & ~no_load_mask; - if (rsc->invalidated) { - job->invalidated_load |= bit; - rsc->invalidated = false; - } else { - job->load |= bit & ~no_load_mask; - } if (v3d->blend->base.rt[blend_rt].colormask) job->store |= bit; v3d_job_add_bo(job, rsc->bo); @@ -1401,20 +1396,6 @@ v3d_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info, u_stream_outputs_for_vertices(info->mode, draws[0].count); } - if (v3d->zsa && job->zsbuf) { - struct v3d_resource *rsc = v3d_resource(job->zsbuf->texture); - if (rsc->invalidated) { - /* Currently gallium only applies invalidates if it - * affects both depth and stencil together. - */ - job->invalidated_load |= - PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL; - rsc->invalidated = false; - if (rsc->separate_stencil) - rsc->separate_stencil->invalidated = false; - } - } - v3d_update_job_tlb_load_store(job); if (indirect && indirect->buffer)