[Mesa-dev] [PATCH 1/6] i965/vec4: Plumb log_data through so the backend_shader field gets set.

Kenneth Graunke kenneth at whitecape.org
Fri Jul 3 09:29:16 PDT 2015


On Friday, July 03, 2015 10:50:52 AM Pohjolainen, Topi wrote:
> On Wed, Jul 01, 2015 at 03:03:31PM -0700, Kenneth Graunke wrote:
> > Jason plumbed this through a while back in the FS backend, but
> > apparently we were just passing NULL in the vec4 backend.
> > 
> > This patch passes brw in as intended.
> > 
> > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > ---
> >  src/mesa/drivers/dri/i965/brw_vec4.cpp            |  2 +-
> >  src/mesa/drivers/dri/i965/brw_vec4.h              |  1 +
> >  src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp | 10 ++++++----
> >  src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.h   |  1 +
> >  src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp    |  3 ++-
> >  src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp |  4 +++-
> >  src/mesa/drivers/dri/i965/brw_vs.h                |  1 +
> >  src/mesa/drivers/dri/i965/gen6_gs_visitor.h       |  4 +++-
> >  8 files changed, 18 insertions(+), 8 deletions(-)
> > 
> > diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
> > index a5c686c..2a56564 100644
> > --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
> > +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
> > @@ -1940,7 +1940,7 @@ brw_vs_emit(struct brw_context *brw,
> >     if (!assembly) {
> >        prog_data->base.dispatch_mode = DISPATCH_MODE_4X2_DUAL_OBJECT;
> >  
> > -      vec4_vs_visitor v(brw->intelScreen->compiler,
> > +      vec4_vs_visitor v(brw->intelScreen->compiler, brw,
> >                          c, prog_data, prog, mem_ctx, st_index,
> >                          !_mesa_is_gles3(&brw->ctx));
> >        if (!v.run(brw_select_clip_planes(&brw->ctx))) {
> > diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
> > index 2ac1693..043557b 100644
> > --- a/src/mesa/drivers/dri/i965/brw_vec4.h
> > +++ b/src/mesa/drivers/dri/i965/brw_vec4.h
> > @@ -77,6 +77,7 @@ class vec4_visitor : public backend_shader, public ir_visitor
> >  {
> >  public:
> >     vec4_visitor(const struct brw_compiler *compiler,
> > +                void *log_data,
> 
> As far as I can see, all the constructors addressed in this patch are
> "struct brw_context" aware. Could we use the type "struct brw_context *"
> instead of "void *"? The pointer is in the end given to shader_perf_log_mesa()
> which in turn unconditionally casts is to "struct brw_context *".

Jason is trying to separate the compiler backend from the OpenGL driver,
so we can more easily reuse it...elsewhere :)  "elsewhere" does not have
a brw_context, but will have some other structure.  So instead he made the
logging functions pass a void * closure.

I'm also concerned that if we pass in brw_context that people will start
using it everywhere.  Admittedly, having to type log_data-> might deter
them, though...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150703/a4ac292b/attachment.sig>


More information about the mesa-dev mailing list