[Mesa-dev] [PATCH 5/5] r600g: Invalidate texture cache when creating vertex buffers for compute
Tom Stellard
tom at stellard.net
Mon Sep 17 16:11:07 PDT 2012
On Mon, Sep 17, 2012 at 11:35:29PM +0200, Marek Olšák wrote:
> On Mon, Sep 17, 2012 at 11:09 PM, Tom Stellard <tom at stellard.net> wrote:
> > From: Tom Stellard <thomas.stellard at amd.com>
> >
> > Compute shaders fetch data from vertex buffers via the texture cache, so
> > we need to make sure the texture cache is flushed.
> > ---
> > src/gallium/drivers/r600/evergreen_compute.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
> > index 2749b05..e5396d8 100644
> > --- a/src/gallium/drivers/r600/evergreen_compute.c
> > +++ b/src/gallium/drivers/r600/evergreen_compute.c
> > @@ -96,7 +96,10 @@ static void evergreen_cs_set_vertex_buffer(
> > vb->buffer = buffer;
> > vb->user_buffer = NULL;
> >
> > - rctx->flags |= rctx->has_vertex_cache ? R600_CONTEXT_VTX_FLUSH : R600_CONTEXT_TEX_FLUSH;
> > + /* The vertex instructions in the compute shaders use the texture cache,
> > + * so we need to invalid it. */
> > + rctx->flags |= rctx->has_vertex_cache | R600_CONTEXT_VTX_FLUSH
> > + | R600_CONTEXT_TEX_FLUSH;
>
> Here you combine the has_vertex_cache bool variable with the context
> flush flags. That doesn't look right. I think you wanted to do (if I
> understand correctly):
>
> ctx->flags |= R600_CONTEXT_TEX_FLUSH;
>
You're right, I must have mixed that up during the rebase. I'll
fix that.
> Other than that, this series is:
>
> Reviewed-by: Marek Olšák <maraeo at gmail.com>
>
> Marek
More information about the mesa-dev
mailing list