[Mesa-dev] [PATCH v2 22/37] panfrost: Extend the panfrost_batch_add_bo() API to pass access flags

Alyssa Rosenzweig alyssa at rosenzweig.io
Mon Sep 16 19:19:07 UTC 2019


> > PAN_BO_GPU_ACCESS_* is rather wordy. We're a GPU driver, of course it's
> > GPU access :)
> 
> Well, the driver can also do CPU accesses to the same BOs :P.

Yes, but we won't be marking them off this way ever, no?

> > > +        panfrost_batch_add_bo(batch, rsrc->bo,
> > > +                              PAN_BO_GPU_ACCESS_SHARED | PAN_BO_GPU_ACCESS_READ |
> > > +                              PAN_BO_GPU_ACCESS_VERTEX_TILER |
> > > +                              (st == PIPE_SHADER_FRAGMENT ?
> > > +                               PAN_BO_GPU_ACCESS_FRAGMENT : 0));  
> > 
> > I'm not sure this is quite right... should it maybe be:
> > 
> > (st == PIPE_SHADER_FRAGMENT ? PAN_BO_ACCESS_FRAGMENT :
> > PAN_BO_ACCESS_VERTEX_TILER)
> 
> That's a good question. I wasn't sure so I decided to put the
> vertex/tiler unconditionally.

It should only be accessed from vertex/tiler if it is used by:

 - Vertex shaders (attributes, varyings, VS uniforms, VS texture)
 - Tiling (varyings, tiler structures)

Fragment use:

 - Fragment shaders (yaryings, FS uniforms, FS texture)
 - Tiler structures

> Oops, that's a mistake. I meant PAN_BO_GPU_ACCESS_VERTEX_TILER here.
> It should definitely have ACCESS_SHARED | ACCESS_READ.

+1


More information about the mesa-dev mailing list