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

Pohjolainen, Topi topi.pohjolainen at intel.com
Fri Jul 3 00:50:52 PDT 2015


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 *".

>                  struct brw_vec4_compile *c,
>                  struct gl_program *prog,
>                  const struct brw_vue_prog_key *key,
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
> index 69bcf5a..80c59af 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
> @@ -35,12 +35,14 @@ const unsigned MAX_GS_INPUT_VERTICES = 6;
>  namespace brw {
>  
>  vec4_gs_visitor::vec4_gs_visitor(const struct brw_compiler *compiler,
> +                                 void *log_data,
>                                   struct brw_gs_compile *c,
>                                   struct gl_shader_program *prog,
>                                   void *mem_ctx,
>                                   bool no_spills,
>                                   int shader_time_index)
> -   : vec4_visitor(compiler, &c->base, &c->gp->program.Base, &c->key.base,
> +   : vec4_visitor(compiler, log_data,
> +                  &c->base, &c->gp->program.Base, &c->key.base,
>                    &c->prog_data.base, prog, MESA_SHADER_GEOMETRY, mem_ctx,
>                    no_spills, shader_time_index),
>       c(c)
> @@ -662,7 +664,7 @@ brw_gs_emit(struct brw_context *brw,
>            likely(!(INTEL_DEBUG & DEBUG_NO_DUAL_OBJECT_GS))) {
>           c->prog_data.base.dispatch_mode = DISPATCH_MODE_4X2_DUAL_OBJECT;
>  
> -         vec4_gs_visitor v(brw->intelScreen->compiler,
> +         vec4_gs_visitor v(brw->intelScreen->compiler, brw,
>                             c, prog, mem_ctx, true /* no_spills */, st_index);
>           if (v.run(NULL /* clip planes */)) {
>              return generate_assembly(brw, prog, &c->gp->program.Base,
> @@ -704,11 +706,11 @@ brw_gs_emit(struct brw_context *brw,
>     const unsigned *ret = NULL;
>  
>     if (brw->gen >= 7)
> -      gs = new vec4_gs_visitor(brw->intelScreen->compiler,
> +      gs = new vec4_gs_visitor(brw->intelScreen->compiler, brw,
>                                 c, prog, mem_ctx, false /* no_spills */,
>                                 st_index);
>     else
> -      gs = new gen6_gs_visitor(brw->intelScreen->compiler,
> +      gs = new gen6_gs_visitor(brw->intelScreen->compiler, brw,
>                                 c, prog, mem_ctx, false /* no_spills */,
>                                 st_index);
>  
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.h b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.h
> index e693c56..e48d861 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.h
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.h
> @@ -69,6 +69,7 @@ class vec4_gs_visitor : public vec4_visitor
>  {
>  public:
>     vec4_gs_visitor(const struct brw_compiler *compiler,
> +                   void *log_data,
>                     struct brw_gs_compile *c,
>                     struct gl_shader_program *prog,
>                     void *mem_ctx,
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> index 8d7a80b..21d9b01 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> @@ -3678,6 +3678,7 @@ vec4_visitor::resolve_bool_comparison(ir_rvalue *rvalue, src_reg *reg)
>  }
>  
>  vec4_visitor::vec4_visitor(const struct brw_compiler *compiler,
> +                           void *log_data,
>                             struct brw_vec4_compile *c,
>                             struct gl_program *prog,
>                             const struct brw_vue_prog_key *key,
> @@ -3687,7 +3688,7 @@ vec4_visitor::vec4_visitor(const struct brw_compiler *compiler,
>  			   void *mem_ctx,
>                             bool no_spills,
>                             int shader_time_index)
> -   : backend_shader(compiler, NULL, mem_ctx,
> +   : backend_shader(compiler, log_data, mem_ctx,
>                      shader_prog, prog, &prog_data->base, stage),
>       c(c),
>       key(key),
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp
> index f93062b..eed4d6d 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_vs_visitor.cpp
> @@ -212,13 +212,15 @@ vec4_vs_visitor::emit_thread_end()
>  
>  
>  vec4_vs_visitor::vec4_vs_visitor(const struct brw_compiler *compiler,
> +                                 void *log_data,
>                                   struct brw_vs_compile *vs_compile,
>                                   struct brw_vs_prog_data *vs_prog_data,
>                                   struct gl_shader_program *prog,
>                                   void *mem_ctx,
>                                   int shader_time_index,
>                                   bool use_legacy_snorm_formula)
> -   : vec4_visitor(compiler, &vs_compile->base, &vs_compile->vp->program.Base,
> +   : vec4_visitor(compiler, log_data,
> +                  &vs_compile->base, &vs_compile->vp->program.Base,
>                    &vs_compile->key.base, &vs_prog_data->base, prog,
>                    MESA_SHADER_VERTEX,
>                    mem_ctx, false /* no_spills */,
> diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h
> index 61f9b00..a15cba0 100644
> --- a/src/mesa/drivers/dri/i965/brw_vs.h
> +++ b/src/mesa/drivers/dri/i965/brw_vs.h
> @@ -91,6 +91,7 @@ class vec4_vs_visitor : public vec4_visitor
>  {
>  public:
>     vec4_vs_visitor(const struct brw_compiler *compiler,
> +                   void *log_data,
>                     struct brw_vs_compile *vs_compile,
>                     struct brw_vs_prog_data *vs_prog_data,
>                     struct gl_shader_program *prog,
> diff --git a/src/mesa/drivers/dri/i965/gen6_gs_visitor.h b/src/mesa/drivers/dri/i965/gen6_gs_visitor.h
> index 27254eb..862d0ea 100644
> --- a/src/mesa/drivers/dri/i965/gen6_gs_visitor.h
> +++ b/src/mesa/drivers/dri/i965/gen6_gs_visitor.h
> @@ -36,12 +36,14 @@ class gen6_gs_visitor : public vec4_gs_visitor
>  {
>  public:
>     gen6_gs_visitor(const struct brw_compiler *comp,
> +                   void *log_data,
>                     struct brw_gs_compile *c,
>                     struct gl_shader_program *prog,
>                     void *mem_ctx,
>                     bool no_spills,
>                     int shader_time_index) :
> -      vec4_gs_visitor(comp, c, prog, mem_ctx, no_spills, shader_time_index) {}
> +      vec4_gs_visitor(comp, log_data, c, prog, mem_ctx, no_spills,
> +                      shader_time_index) {}
>  
>  protected:
>     virtual void assign_binding_table_offsets();
> -- 
> 2.4.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list