<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 23, 2017 at 5:11 PM, Jordan Justen <span dir="ltr"><<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Attached is the missing change to brw_vec4_gs_visitor.cpp, which Jason<br>
pointed out. The issue was hiding out in a compiler warning.<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>We should be able to drop the final_program_size variable.  I think that would be a bit more fool-proof.  Other than that, this patch (with the attached squash-in) is</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
-Jordan<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 2017-10-22 13:01:25, Jordan Justen wrote:<br>
> The caller can now use brw_stage_prog_data::program_<wbr>size which is set<br>
> by the brw_compile_* functions.<br>
><br>
> Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
> Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
> ---<br>
>  src/intel/blorp/blorp.c             | 10 ++++------<br>
>  src/intel/blorp/blorp_blit.c        |  5 ++---<br>
>  src/intel/blorp/blorp_clear.c       | 15 ++++++---------<br>
>  src/intel/blorp/blorp_priv.h        |  6 ++----<br>
>  src/intel/compiler/brw_<wbr>compiler.h   |  6 ------<br>
>  src/intel/compiler/brw_fs.cpp       | 10 ++--------<br>
>  src/intel/compiler/brw_shader.<wbr>cpp   |  8 ++++----<br>
>  src/intel/compiler/brw_vec4.<wbr>cpp     |  8 ++++----<br>
>  src/intel/compiler/brw_vec4_<wbr>tcs.cpp |  8 ++++----<br>
>  src/intel/vulkan/anv_pipeline.<wbr>c     | 23 ++++++++++++-----------<br>
>  src/mesa/drivers/dri/i965/brw_<wbr>cs.c  |  5 ++---<br>
>  src/mesa/drivers/dri/i965/brw_<wbr>gs.c  |  5 ++---<br>
>  src/mesa/drivers/dri/i965/brw_<wbr>tcs.c |  5 ++---<br>
>  src/mesa/drivers/dri/i965/brw_<wbr>tes.c |  5 ++---<br>
>  src/mesa/drivers/dri/i965/brw_<wbr>vs.c  | 11 +++++------<br>
>  src/mesa/drivers/dri/i965/brw_<wbr>wm.c  |  5 ++---<br>
>  16 files changed, 55 insertions(+), 80 deletions(-)<br>
><br>
> diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c<br>
> index 7cc6335f2f6..5faba75b8db 100644<br>
> --- a/src/intel/blorp/blorp.c<br>
> +++ b/src/intel/blorp/blorp.c<br>
> @@ -162,8 +162,7 @@ blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx,<br>
>                   struct nir_shader *nir,<br>
>                   struct brw_wm_prog_key *wm_key,<br>
>                   bool use_repclear,<br>
> -                 struct brw_wm_prog_data *wm_prog_data,<br>
> -                 unsigned *program_size)<br>
> +                 struct brw_wm_prog_data *wm_prog_data)<br>
>  {<br>
>     const struct brw_compiler *compiler = blorp->compiler;<br>
><br>
> @@ -194,7 +193,7 @@ blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx,<br>
>     const unsigned *program =<br>
>        brw_compile_fs(compiler, blorp->driver_ctx, mem_ctx, wm_key,<br>
>                       wm_prog_data, nir, NULL, -1, -1, false, use_repclear,<br>
> -                     NULL, program_size, NULL);<br>
> +                     NULL, NULL);<br>
><br>
>     return program;<br>
>  }<br>
> @@ -202,8 +201,7 @@ blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx,<br>
>  const unsigned *<br>
>  blorp_compile_vs(struct blorp_context *blorp, void *mem_ctx,<br>
>                   struct nir_shader *nir,<br>
> -                 struct brw_vs_prog_data *vs_prog_data,<br>
> -                 unsigned *program_size)<br>
> +                 struct brw_vs_prog_data *vs_prog_data)<br>
>  {<br>
>     const struct brw_compiler *compiler = blorp->compiler;<br>
><br>
> @@ -225,7 +223,7 @@ blorp_compile_vs(struct blorp_context *blorp, void *mem_ctx,<br>
>     const unsigned *program =<br>
>        brw_compile_vs(compiler, blorp->driver_ctx, mem_ctx,<br>
>                       &vs_key, vs_prog_data, nir,<br>
> -                     false, -1, program_size, NULL);<br>
> +                     false, -1, NULL);<br>
><br>
>     return program;<br>
>  }<br>
> diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c<br>
> index 4507046dae5..9b5c1f1f8c1 100644<br>
> --- a/src/intel/blorp/blorp_blit.c<br>
> +++ b/src/intel/blorp/blorp_blit.c<br>
> @@ -1308,7 +1308,6 @@ brw_blorp_get_blit_kernel(<wbr>struct blorp_context *blorp,<br>
>     void *mem_ctx = ralloc_context(NULL);<br>
><br>
>     const unsigned *program;<br>
> -   unsigned program_size;<br>
>     struct brw_wm_prog_data prog_data;<br>
><br>
>     nir_shader *nir = brw_blorp_build_nir_shader(<wbr>blorp, mem_ctx, prog_key);<br>
> @@ -1322,11 +1321,11 @@ brw_blorp_get_blit_kernel(<wbr>struct blorp_context *blorp,<br>
>     wm_key.multisample_fbo = prog_key->rt_samples > 1;<br>
><br>
>     program = blorp_compile_fs(blorp, mem_ctx, nir, &wm_key, false,<br>
> -                              &prog_data, &program_size);<br>
> +                              &prog_data);<br>
><br>
>     bool result =<br>
>        blorp->upload_shader(blorp, prog_key, sizeof(*prog_key),<br>
> -                           program, program_size,<br>
> +                           program, prog_data.base.program_size,<br>
>                             &prog_data.base, sizeof(prog_data),<br>
>                             &params->wm_prog_kernel, &params->wm_prog_data);<br>
><br>
> diff --git a/src/intel/blorp/blorp_clear.<wbr>c b/src/intel/blorp/blorp_clear.<wbr>c<br>
> index cd83fa13caf..8d758df155f 100644<br>
> --- a/src/intel/blorp/blorp_clear.<wbr>c<br>
> +++ b/src/intel/blorp/blorp_clear.<wbr>c<br>
> @@ -75,14 +75,13 @@ blorp_params_get_clear_kernel(<wbr>struct blorp_context *blorp,<br>
>     brw_blorp_init_wm_prog_key(&<wbr>wm_key);<br>
><br>
>     struct brw_wm_prog_data prog_data;<br>
> -   unsigned program_size;<br>
>     const unsigned *program =<br>
>        blorp_compile_fs(blorp, mem_ctx, b.shader, &wm_key, use_replicated_data,<br>
> -                       &prog_data, &program_size);<br>
> +                       &prog_data);<br>
><br>
>     bool result =<br>
>        blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),<br>
> -                           program, program_size,<br>
> +                           program, prog_data.base.program_size,<br>
>                             &prog_data.base, sizeof(prog_data),<br>
>                             &params->wm_prog_kernel, &params->wm_prog_data);<br>
><br>
> @@ -167,13 +166,12 @@ blorp_params_get_layer_offset_<wbr>vs(struct blorp_context *blorp,<br>
>     struct brw_vs_prog_data vs_prog_data;<br>
>     memset(&vs_prog_data, 0, sizeof(vs_prog_data));<br>
><br>
> -   unsigned program_size;<br>
>     const unsigned *program =<br>
> -      blorp_compile_vs(blorp, mem_ctx, b.shader, &vs_prog_data, &program_size);<br>
> +      blorp_compile_vs(blorp, mem_ctx, b.shader, &vs_prog_data);<br>
><br>
>     bool result =<br>
>        blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),<br>
> -                           program, program_size,<br>
> +                           program, vs_prog_data.base.base.<wbr>program_size,<br>
>                             &vs_prog_data.base.base, sizeof(vs_prog_data),<br>
>                             &params->vs_prog_kernel, &params->vs_prog_data);<br>
><br>
> @@ -864,14 +862,13 @@ blorp_params_get_mcs_partial_<wbr>resolve_kernel(struct blorp_context *blorp,<br>
>     wm_key.multisample_fbo = true;<br>
><br>
>     struct brw_wm_prog_data prog_data;<br>
> -   unsigned program_size;<br>
>     const unsigned *program =<br>
>        blorp_compile_fs(blorp, mem_ctx, b.shader, &wm_key, false,<br>
> -                       &prog_data, &program_size);<br>
> +                       &prog_data);<br>
><br>
>     bool result =<br>
>        blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),<br>
> -                           program, program_size,<br>
> +                           program, prog_data.base.program_size,<br>
>                             &prog_data.base, sizeof(prog_data),<br>
>                             &params->wm_prog_kernel, &params->wm_prog_data);<br>
><br>
> diff --git a/src/intel/blorp/blorp_priv.h b/src/intel/blorp/blorp_priv.h<br>
> index c7d5d308da7..d91e436c1c5 100644<br>
> --- a/src/intel/blorp/blorp_priv.h<br>
> +++ b/src/intel/blorp/blorp_priv.h<br>
> @@ -342,14 +342,12 @@ blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx,<br>
>                   struct nir_shader *nir,<br>
>                   struct brw_wm_prog_key *wm_key,<br>
>                   bool use_repclear,<br>
> -                 struct brw_wm_prog_data *wm_prog_data,<br>
> -                 unsigned *program_size);<br>
> +                 struct brw_wm_prog_data *wm_prog_data);<br>
><br>
>  const unsigned *<br>
>  blorp_compile_vs(struct blorp_context *blorp, void *mem_ctx,<br>
>                   struct nir_shader *nir,<br>
> -                 struct brw_vs_prog_data *vs_prog_data,<br>
> -                 unsigned *program_size);<br>
> +                 struct brw_vs_prog_data *vs_prog_data);<br>
><br>
>  bool<br>
>  blorp_ensure_sf_program(struct blorp_context *blorp,<br>
> diff --git a/src/intel/compiler/brw_<wbr>compiler.h b/src/intel/compiler/brw_<wbr>compiler.h<br>
> index b57834ddaa3..701b4a80bf1 100644<br>
> --- a/src/intel/compiler/brw_<wbr>compiler.h<br>
> +++ b/src/intel/compiler/brw_<wbr>compiler.h<br>
> @@ -1102,7 +1102,6 @@ brw_compile_vs(const struct brw_compiler *compiler, void *log_data,<br>
>                 const struct nir_shader *shader,<br>
>                 bool use_legacy_snorm_formula,<br>
>                 int shader_time_index,<br>
> -               unsigned *final_assembly_size,<br>
>                 char **error_str);<br>
><br>
>  /**<br>
> @@ -1118,7 +1117,6 @@ brw_compile_tcs(const struct brw_compiler *compiler,<br>
>                  struct brw_tcs_prog_data *prog_data,<br>
>                  const struct nir_shader *nir,<br>
>                  int shader_time_index,<br>
> -                unsigned *final_assembly_size,<br>
>                  char **error_str);<br>
><br>
>  /**<br>
> @@ -1135,7 +1133,6 @@ brw_compile_tes(const struct brw_compiler *compiler, void *log_data,<br>
>                  const struct nir_shader *shader,<br>
>                  struct gl_program *prog,<br>
>                  int shader_time_index,<br>
> -                unsigned *final_assembly_size,<br>
>                  char **error_str);<br>
><br>
>  /**<br>
> @@ -1151,7 +1148,6 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,<br>
>                 const struct nir_shader *shader,<br>
>                 struct gl_program *prog,<br>
>                 int shader_time_index,<br>
> -               unsigned *final_assembly_size,<br>
>                 char **error_str);<br>
><br>
>  /**<br>
> @@ -1202,7 +1198,6 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,<br>
>                 int shader_time_index16,<br>
>                 bool allow_spilling,<br>
>                 bool use_rep_send, struct brw_vue_map *vue_map,<br>
> -               unsigned *final_assembly_size,<br>
>                 char **error_str);<br>
><br>
>  /**<br>
> @@ -1217,7 +1212,6 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data,<br>
>                 struct brw_cs_prog_data *prog_data,<br>
>                 const struct nir_shader *shader,<br>
>                 int shader_time_index,<br>
> -               unsigned *final_assembly_size,<br>
>                 char **error_str);<br>
><br>
>  static inline uint32_t<br>
> diff --git a/src/intel/compiler/brw_fs.<wbr>cpp b/src/intel/compiler/brw_fs.<wbr>cpp<br>
> index bb6955e667e..c1cf48697f0 100644<br>
> --- a/src/intel/compiler/brw_fs.<wbr>cpp<br>
> +++ b/src/intel/compiler/brw_fs.<wbr>cpp<br>
> @@ -6511,7 +6511,6 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,<br>
>                 int shader_time_index8, int shader_time_index16,<br>
>                 bool allow_spilling,<br>
>                 bool use_rep_send, struct brw_vue_map *vue_map,<br>
> -               unsigned *final_assembly_size,<br>
>                 char **error_str)<br>
>  {<br>
>     const struct gen_device_info *devinfo = compiler->devinfo;<br>
> @@ -6660,9 +6659,7 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,<br>
>        prog_data->reg_blocks_0 = brw_register_blocks(simd16_<wbr>grf_used);<br>
>     }<br>
><br>
> -   const unsigned *assembly = g.get_assembly(final_assembly_<wbr>size);<br>
> -   prog_data->base.program_size = *final_assembly_size;<br>
> -   return assembly;<br>
> +   return g.get_assembly(&prog_data-><wbr>base.program_size);<br>
>  }<br>
><br>
>  fs_reg *<br>
> @@ -6749,7 +6746,6 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data,<br>
>                 struct brw_cs_prog_data *prog_data,<br>
>                 const nir_shader *src_shader,<br>
>                 int shader_time_index,<br>
> -               unsigned *final_assembly_size,<br>
>                 char **error_str)<br>
>  {<br>
>     nir_shader *shader = nir_shader_clone(mem_ctx, src_shader);<br>
> @@ -6861,9 +6857,7 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data,<br>
><br>
>     g.generate_code(cfg, prog_data->simd_size);<br>
><br>
> -   const unsigned *assembly = g.get_assembly(final_assembly_<wbr>size);<br>
> -   prog_data->base.program_size = *final_assembly_size;<br>
> -   return assembly;<br>
> +   return g.get_assembly(&prog_data-><wbr>base.program_size);<br>
>  }<br>
><br>
>  /**<br>
> diff --git a/src/intel/compiler/brw_<wbr>shader.cpp b/src/intel/compiler/brw_<wbr>shader.cpp<br>
> index 943dcd59cc1..790c5e70a16 100644<br>
> --- a/src/intel/compiler/brw_<wbr>shader.cpp<br>
> +++ b/src/intel/compiler/brw_<wbr>shader.cpp<br>
> @@ -1161,7 +1161,6 @@ brw_compile_tes(const struct brw_compiler *compiler,<br>
>                  const nir_shader *src_shader,<br>
>                  struct gl_program *prog,<br>
>                  int shader_time_index,<br>
> -                unsigned *final_assembly_size,<br>
>                  char **error_str)<br>
>  {<br>
>     const struct gen_device_info *devinfo = compiler->devinfo;<br>
> @@ -1249,6 +1248,7 @@ brw_compile_tes(const struct brw_compiler *compiler,<br>
>        brw_print_vue_map(stderr, &prog_data->base.vue_map);<br>
>     }<br>
><br>
> +   unsigned final_assembly_size;<br>
>     if (is_scalar) {<br>
>        fs_visitor v(compiler, log_data, mem_ctx, (void *) key,<br>
>                     &prog_data->base.base, NULL, nir, 8,<br>
> @@ -1275,7 +1275,7 @@ brw_compile_tes(const struct brw_compiler *compiler,<br>
><br>
>        g.generate_code(v.cfg, 8);<br>
><br>
> -      assembly = g.get_assembly(final_assembly_<wbr>size);<br>
> +      assembly = g.get_assembly(&final_<wbr>assembly_size);<br>
>     } else {<br>
>        brw::vec4_tes_visitor v(compiler, log_data, key, prog_data,<br>
>                               nir, mem_ctx, shader_time_index);<br>
> @@ -1290,9 +1290,9 @@ brw_compile_tes(const struct brw_compiler *compiler,<br>
><br>
>        assembly = brw_vec4_generate_assembly(<wbr>compiler, log_data, mem_ctx, nir,<br>
>                                              &prog_data->base, v.cfg,<br>
> -                                            final_assembly_size);<br>
> +                                            &final_assembly_size);<br>
>     }<br>
><br>
> -   prog_data->base.base.program_<wbr>size = *final_assembly_size;<br>
> +   prog_data->base.base.program_<wbr>size = final_assembly_size;<br>
>     return assembly;<br>
>  }<br>
> diff --git a/src/intel/compiler/brw_vec4.<wbr>cpp b/src/intel/compiler/brw_vec4.<wbr>cpp<br>
> index b7af8860e8f..b8db3ced0fe 100644<br>
> --- a/src/intel/compiler/brw_vec4.<wbr>cpp<br>
> +++ b/src/intel/compiler/brw_vec4.<wbr>cpp<br>
> @@ -2741,7 +2741,6 @@ brw_compile_vs(const struct brw_compiler *compiler, void *log_data,<br>
>                 const nir_shader *src_shader,<br>
>                 bool use_legacy_snorm_formula,<br>
>                 int shader_time_index,<br>
> -               unsigned *final_assembly_size,<br>
>                 char **error_str)<br>
>  {<br>
>     const bool is_scalar = compiler->scalar_stage[MESA_<wbr>SHADER_VERTEX];<br>
> @@ -2856,6 +2855,7 @@ brw_compile_vs(const struct brw_compiler *compiler, void *log_data,<br>
>        brw_print_vue_map(stderr, &prog_data->base.vue_map);<br>
>     }<br>
><br>
> +   unsigned final_assembly_size;<br>
>     if (is_scalar) {<br>
>        prog_data->base.dispatch_mode = DISPATCH_MODE_SIMD8;<br>
><br>
> @@ -2884,7 +2884,7 @@ brw_compile_vs(const struct brw_compiler *compiler, void *log_data,<br>
>           g.enable_debug(debug_name);<br>
>        }<br>
>        g.generate_code(v.cfg, 8);<br>
> -      assembly = g.get_assembly(final_assembly_<wbr>size);<br>
> +      assembly = g.get_assembly(&final_<wbr>assembly_size);<br>
>     }<br>
><br>
>     if (!assembly) {<br>
> @@ -2902,10 +2902,10 @@ brw_compile_vs(const struct brw_compiler *compiler, void *log_data,<br>
><br>
>        assembly = brw_vec4_generate_assembly(<wbr>compiler, log_data, mem_ctx,<br>
>                                              shader, &prog_data->base, v.cfg,<br>
> -                                            final_assembly_size);<br>
> +                                            &final_assembly_size);<br>
>     }<br>
><br>
> -   prog_data->base.base.program_<wbr>size = *final_assembly_size;<br>
> +   prog_data->base.base.program_<wbr>size = final_assembly_size;<br>
>     return assembly;<br>
>  }<br>
><br>
> diff --git a/src/intel/compiler/brw_vec4_<wbr>tcs.cpp b/src/intel/compiler/brw_vec4_<wbr>tcs.cpp<br>
> index 04feb6bdf17..17c52bd0993 100644<br>
> --- a/src/intel/compiler/brw_vec4_<wbr>tcs.cpp<br>
> +++ b/src/intel/compiler/brw_vec4_<wbr>tcs.cpp<br>
> @@ -382,7 +382,6 @@ brw_compile_tcs(const struct brw_compiler *compiler,<br>
>                  struct brw_tcs_prog_data *prog_data,<br>
>                  const nir_shader *src_shader,<br>
>                  int shader_time_index,<br>
> -                unsigned *final_assembly_size,<br>
>                  char **error_str)<br>
>  {<br>
>     const struct gen_device_info *devinfo = compiler->devinfo;<br>
> @@ -462,6 +461,7 @@ brw_compile_tcs(const struct brw_compiler *compiler,<br>
>        brw_print_vue_map(stderr, &vue_prog_data->vue_map);<br>
>     }<br>
><br>
> +   unsigned final_assembly_size;<br>
>     if (is_scalar) {<br>
>        fs_visitor v(compiler, log_data, mem_ctx, (void *) key,<br>
>                     &prog_data->base.base, NULL, nir, 8,<br>
> @@ -488,7 +488,7 @@ brw_compile_tcs(const struct brw_compiler *compiler,<br>
><br>
>        g.generate_code(v.cfg, 8);<br>
><br>
> -      assembly = g.get_assembly(final_assembly_<wbr>size);<br>
> +      assembly = g.get_assembly(&final_<wbr>assembly_size);<br>
>     } else {<br>
>        vec4_tcs_visitor v(compiler, log_data, key, prog_data,<br>
>                           nir, mem_ctx, shader_time_index, &input_vue_map);<br>
> @@ -504,10 +504,10 @@ brw_compile_tcs(const struct brw_compiler *compiler,<br>
><br>
>        assembly = brw_vec4_generate_assembly(<wbr>compiler, log_data, mem_ctx, nir,<br>
>                                              &prog_data->base, v.cfg,<br>
> -                                            final_assembly_size);<br>
> +                                            &final_assembly_size);<br>
>     }<br>
><br>
> -   prog_data->base.base.program_<wbr>size = *final_assembly_size;<br>
> +   prog_data->base.base.program_<wbr>size = final_assembly_size;<br>
>     return assembly;<br>
>  }<br>
><br>
> diff --git a/src/intel/vulkan/anv_<wbr>pipeline.c b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
> index 51788928af8..6c320651416 100644<br>
> --- a/src/intel/vulkan/anv_<wbr>pipeline.c<br>
> +++ b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
> @@ -523,15 +523,15 @@ anv_pipeline_compile_vs(struct anv_pipeline *pipeline,<br>
>                            nir->info.outputs_written,<br>
>                            nir->info.separate_shader);<br>
><br>
> -      unsigned code_size;<br>
>        const unsigned *shader_code =<br>
>           brw_compile_vs(compiler, NULL, mem_ctx, &key, &prog_data, nir,<br>
> -                        false, -1, &code_size, NULL);<br>
> +                        false, -1, NULL);<br>
>        if (shader_code == NULL) {<br>
>           ralloc_free(mem_ctx);<br>
>           return vk_error(VK_ERROR_OUT_OF_HOST_<wbr>MEMORY);<br>
>        }<br>
><br>
> +      unsigned code_size = prog_data.base.base.program_<wbr>size;<br>
>        bin = anv_pipeline_upload_kernel(<wbr>pipeline, cache, sha1, 20,<br>
>                                         shader_code, code_size,<br>
>                                         &prog_data.base.base, sizeof(prog_data),<br>
> @@ -682,18 +682,18 @@ anv_pipeline_compile_tcs_tes(<wbr>struct anv_pipeline *pipeline,<br>
>        tes_key.inputs_read = tcs_key.outputs_written;<br>
>        tes_key.patch_inputs_read = tcs_key.patch_outputs_written;<br>
><br>
> -      unsigned code_size;<br>
>        const int shader_time_index = -1;<br>
>        const unsigned *shader_code;<br>
><br>
>        shader_code =<br>
>           brw_compile_tcs(compiler, NULL, mem_ctx, &tcs_key, &tcs_prog_data,<br>
> -                         tcs_nir, shader_time_index, &code_size, NULL);<br>
> +                         tcs_nir, shader_time_index, NULL);<br>
>        if (shader_code == NULL) {<br>
>           ralloc_free(mem_ctx);<br>
>           return vk_error(VK_ERROR_OUT_OF_HOST_<wbr>MEMORY);<br>
>        }<br>
><br>
> +      unsigned code_size = tcs_prog_data.base.base.<wbr>program_size;<br>
>        tcs_bin = anv_pipeline_upload_kernel(<wbr>pipeline, cache,<br>
>                                             tcs_sha1, sizeof(tcs_sha1),<br>
>                                             shader_code, code_size,<br>
> @@ -708,12 +708,13 @@ anv_pipeline_compile_tcs_tes(<wbr>struct anv_pipeline *pipeline,<br>
>        shader_code =<br>
>           brw_compile_tes(compiler, NULL, mem_ctx, &tes_key,<br>
>                           &tcs_prog_data.base.vue_map, &tes_prog_data, tes_nir,<br>
> -                         NULL, shader_time_index, &code_size, NULL);<br>
> +                         NULL, shader_time_index, NULL);<br>
>        if (shader_code == NULL) {<br>
>           ralloc_free(mem_ctx);<br>
>           return vk_error(VK_ERROR_OUT_OF_HOST_<wbr>MEMORY);<br>
>        }<br>
><br>
> +      code_size = tes_prog_data.base.base.<wbr>program_size;<br>
>        tes_bin = anv_pipeline_upload_kernel(<wbr>pipeline, cache,<br>
>                                             tes_sha1, sizeof(tes_sha1),<br>
>                                             shader_code, code_size,<br>
> @@ -785,16 +786,16 @@ anv_pipeline_compile_gs(struct anv_pipeline *pipeline,<br>
>                            nir->info.outputs_written,<br>
>                            nir->info.separate_shader);<br>
><br>
> -      unsigned code_size;<br>
>        const unsigned *shader_code =<br>
>           brw_compile_gs(compiler, NULL, mem_ctx, &key, &prog_data, nir,<br>
> -                        NULL, -1, &code_size, NULL);<br>
> +                        NULL, -1, NULL);<br>
>        if (shader_code == NULL) {<br>
>           ralloc_free(mem_ctx);<br>
>           return vk_error(VK_ERROR_OUT_OF_HOST_<wbr>MEMORY);<br>
>        }<br>
><br>
>        /* TODO: SIMD8 GS */<br>
> +      const unsigned code_size = prog_data.base.base.program_<wbr>size;<br>
>        bin = anv_pipeline_upload_kernel(<wbr>pipeline, cache, sha1, 20,<br>
>                                         shader_code, code_size,<br>
>                                         &prog_data.base.base, sizeof(prog_data),<br>
> @@ -909,15 +910,15 @@ anv_pipeline_compile_fs(struct anv_pipeline *pipeline,<br>
><br>
>        anv_fill_binding_table(&prog_<wbr>data.base, num_rts);<br>
><br>
> -      unsigned code_size;<br>
>        const unsigned *shader_code =<br>
>           brw_compile_fs(compiler, NULL, mem_ctx, &key, &prog_data, nir,<br>
> -                        NULL, -1, -1, true, false, NULL, &code_size, NULL);<br>
> +                        NULL, -1, -1, true, false, NULL, NULL);<br>
>        if (shader_code == NULL) {<br>
>           ralloc_free(mem_ctx);<br>
>           return vk_error(VK_ERROR_OUT_OF_HOST_<wbr>MEMORY);<br>
>        }<br>
><br>
> +      unsigned code_size = prog_data.base.program_size;<br>
>        bin = anv_pipeline_upload_kernel(<wbr>pipeline, cache, sha1, 20,<br>
>                                         shader_code, code_size,<br>
>                                         &prog_data.base, sizeof(prog_data),<br>
> @@ -981,15 +982,15 @@ anv_pipeline_compile_cs(struct anv_pipeline *pipeline,<br>
><br>
>        anv_fill_binding_table(&prog_<wbr>data.base, 1);<br>
><br>
> -      unsigned code_size;<br>
>        const unsigned *shader_code =<br>
>           brw_compile_cs(compiler, NULL, mem_ctx, &key, &prog_data, nir,<br>
> -                        -1, &code_size, NULL);<br>
> +                        -1, NULL);<br>
>        if (shader_code == NULL) {<br>
>           ralloc_free(mem_ctx);<br>
>           return vk_error(VK_ERROR_OUT_OF_HOST_<wbr>MEMORY);<br>
>        }<br>
><br>
> +      const unsigned code_size = prog_data.base.program_size;<br>
>        bin = anv_pipeline_upload_kernel(<wbr>pipeline, cache, sha1, 20,<br>
>                                         shader_code, code_size,<br>
>                                         &prog_data.base, sizeof(prog_data),<br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_cs.c b/src/mesa/drivers/dri/i965/<wbr>brw_cs.c<br>
> index be7680def7c..1a0e9f62c63 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>brw_cs.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>brw_cs.c<br>
> @@ -55,7 +55,6 @@ brw_codegen_cs_prog(struct brw_context *brw,<br>
>     const struct gen_device_info *devinfo = &brw->screen->devinfo;<br>
>     const GLuint *program;<br>
>     void *mem_ctx = ralloc_context(NULL);<br>
> -   GLuint program_size;<br>
>     struct brw_cs_prog_data prog_data;<br>
>     bool start_busy = false;<br>
>     double start_time = 0;<br>
> @@ -93,7 +92,7 @@ brw_codegen_cs_prog(struct brw_context *brw,<br>
>     char *error_str;<br>
>     program = brw_compile_cs(brw->screen-><wbr>compiler, brw, mem_ctx, key,<br>
>                              &prog_data, cp->program.nir, st_index,<br>
> -                            &program_size, &error_str);<br>
> +                            &error_str);<br>
>     if (program == NULL) {<br>
>        cp->program.sh.data-><wbr>LinkStatus = linking_failure;<br>
>        ralloc_strcat(&cp->program.sh.<wbr>data->InfoLog, error_str);<br>
> @@ -144,7 +143,7 @@ brw_codegen_cs_prog(struct brw_context *brw,<br>
>     ralloc_steal(NULL, prog_data.base.pull_param);<br>
>     brw_upload_cache(&brw->cache, BRW_CACHE_CS_PROG,<br>
>                      key, sizeof(*key),<br>
> -                    program, program_size,<br>
> +                    program, prog_data.base.program_size,<br>
>                      &prog_data, sizeof(prog_data),<br>
>                      &brw->cs.base.prog_offset, &brw->cs.base.prog_data);<br>
>     ralloc_free(mem_ctx);<br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_gs.c b/src/mesa/drivers/dri/i965/<wbr>brw_gs.c<br>
> index 007629cbbbe..e6e757ce686 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>brw_gs.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>brw_gs.c<br>
> @@ -112,12 +112,11 @@ brw_codegen_gs_prog(struct brw_context *brw,<br>
>        start_time = get_time();<br>
>     }<br>
><br>
> -   unsigned program_size;<br>
>     char *error_str;<br>
>     const unsigned *program =<br>
>        brw_compile_gs(brw->screen-><wbr>compiler, brw, mem_ctx, key,<br>
>                       &prog_data, gp->program.nir, &gp->program,<br>
> -                     st_index, &program_size, &error_str);<br>
> +                     st_index, &error_str);<br>
>     if (program == NULL) {<br>
>        ralloc_strcat(&gp->program.sh.<wbr>data->InfoLog, error_str);<br>
>        _mesa_problem(NULL, "Failed to compile geometry shader: %s\n", error_str);<br>
> @@ -147,7 +146,7 @@ brw_codegen_gs_prog(struct brw_context *brw,<br>
>     ralloc_steal(NULL, prog_data.base.base.pull_<wbr>param);<br>
>     brw_upload_cache(&brw->cache, BRW_CACHE_GS_PROG,<br>
>                      key, sizeof(*key),<br>
> -                    program, program_size,<br>
> +                    program, prog_data.base.base.program_<wbr>size,<br>
>                      &prog_data, sizeof(prog_data),<br>
>                      &stage_state->prog_offset, &brw->gs.base.prog_data);<br>
>     ralloc_free(mem_ctx);<br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_tcs.c b/src/mesa/drivers/dri/i965/<wbr>brw_tcs.c<br>
> index 6c9cb153d31..5ac728ee68f 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>brw_tcs.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>brw_tcs.c<br>
> @@ -226,11 +226,10 @@ brw_codegen_tcs_prog(struct brw_context *brw, struct brw_program *tcp,<br>
>        start_time = get_time();<br>
>     }<br>
><br>
> -   unsigned program_size;<br>
>     char *error_str;<br>
>     const unsigned *program =<br>
>        brw_compile_tcs(compiler, brw, mem_ctx, key, &prog_data, nir, st_index,<br>
> -                      &program_size, &error_str);<br>
> +                      &error_str);<br>
>     if (program == NULL) {<br>
>        if (tep) {<br>
>           tep->program.sh.data-><wbr>LinkStatus = linking_failure;<br>
> @@ -268,7 +267,7 @@ brw_codegen_tcs_prog(struct brw_context *brw, struct brw_program *tcp,<br>
>     ralloc_steal(NULL, prog_data.base.base.pull_<wbr>param);<br>
>     brw_upload_cache(&brw->cache, BRW_CACHE_TCS_PROG,<br>
>                      key, sizeof(*key),<br>
> -                    program, program_size,<br>
> +                    program, prog_data.base.base.program_<wbr>size,<br>
>                      &prog_data, sizeof(prog_data),<br>
>                      &stage_state->prog_offset, &brw->tcs.base.prog_data);<br>
>     ralloc_free(mem_ctx);<br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_tes.c b/src/mesa/drivers/dri/i965/<wbr>brw_tes.c<br>
> index 47f3b510a54..21f44ae74af 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>brw_tes.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>brw_tes.c<br>
> @@ -101,11 +101,10 @@ brw_codegen_tes_prog(struct brw_context *brw,<br>
>     brw_compute_tess_vue_map(&<wbr>input_vue_map, key->inputs_read,<br>
>                              key->patch_inputs_read);<br>
><br>
> -   unsigned program_size;<br>
>     char *error_str;<br>
>     const unsigned *program =<br>
>        brw_compile_tes(compiler, brw, mem_ctx, key, &input_vue_map, &prog_data,<br>
> -                      nir, &tep->program, st_index, &program_size, &error_str);<br>
> +                      nir, &tep->program, st_index, &error_str);<br>
>     if (program == NULL) {<br>
>        tep->program.sh.data-><wbr>LinkStatus = linking_failure;<br>
>        ralloc_strcat(&tep->program.<wbr>sh.data->InfoLog, error_str);<br>
> @@ -138,7 +137,7 @@ brw_codegen_tes_prog(struct brw_context *brw,<br>
>     ralloc_steal(NULL, prog_data.base.base.pull_<wbr>param);<br>
>     brw_upload_cache(&brw->cache, BRW_CACHE_TES_PROG,<br>
>                      key, sizeof(*key),<br>
> -                    program, program_size,<br>
> +                    program, prog_data.base.base.program_<wbr>size,<br>
>                      &prog_data, sizeof(prog_data),<br>
>                      &stage_state->prog_offset, &brw->tes.base.prog_data);<br>
>     ralloc_free(mem_ctx);<br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_vs.c b/src/mesa/drivers/dri/i965/<wbr>brw_vs.c<br>
> index fb5ea4e7ed1..d308bb83332 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>brw_vs.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>brw_vs.c<br>
> @@ -159,7 +159,6 @@ brw_codegen_vs_prog(struct brw_context *brw,<br>
>  {<br>
>     const struct brw_compiler *compiler = brw->screen->compiler;<br>
>     const struct gen_device_info *devinfo = &brw->screen->devinfo;<br>
> -   GLuint program_size;<br>
>     const GLuint *program;<br>
>     struct brw_vs_prog_data prog_data;<br>
>     struct brw_stage_prog_data *stage_prog_data = &prog_data.base.base;<br>
> @@ -223,7 +222,7 @@ brw_codegen_vs_prog(struct brw_context *brw,<br>
>     program = brw_compile_vs(compiler, brw, mem_ctx, key, &prog_data,<br>
>                              vp->program.nir,<br>
>                              !_mesa_is_gles3(&brw->ctx),<br>
> -                            st_index, &program_size, &error_str);<br>
> +                            st_index, &error_str);<br>
>     if (program == NULL) {<br>
>        if (!vp->program.is_arb_asm) {<br>
>           vp->program.sh.data-><wbr>LinkStatus = linking_failure;<br>
> @@ -256,10 +255,10 @@ brw_codegen_vs_prog(struct brw_context *brw,<br>
>     ralloc_steal(NULL, prog_data.base.base.param);<br>
>     ralloc_steal(NULL, prog_data.base.base.pull_<wbr>param);<br>
>     brw_upload_cache(&brw->cache, BRW_CACHE_VS_PROG,<br>
> -                   key, sizeof(struct brw_vs_prog_key),<br>
> -                   program, program_size,<br>
> -                   &prog_data, sizeof(prog_data),<br>
> -                   &brw->vs.base.prog_offset, &brw->vs.base.prog_data);<br>
> +                    key, sizeof(struct brw_vs_prog_key),<br>
> +                    program, prog_data.base.base.program_<wbr>size,<br>
> +                    &prog_data, sizeof(prog_data),<br>
> +                    &brw->vs.base.prog_offset, &brw->vs.base.prog_data);<br>
>     ralloc_free(mem_ctx);<br>
><br>
>     return true;<br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_wm.c b/src/mesa/drivers/dri/i965/<wbr>brw_wm.c<br>
> index e511f0f70ba..601de18b041 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>brw_wm.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>brw_wm.c<br>
> @@ -132,7 +132,6 @@ brw_codegen_wm_prog(struct brw_context *brw,<br>
>     void *mem_ctx = ralloc_context(NULL);<br>
>     struct brw_wm_prog_data prog_data;<br>
>     const GLuint *program;<br>
> -   GLuint program_size;<br>
>     bool start_busy = false;<br>
>     double start_time = 0;<br>
><br>
> @@ -176,7 +175,7 @@ brw_codegen_wm_prog(struct brw_context *brw,<br>
>                              key, &prog_data, fp->program.nir,<br>
>                              &fp->program, st_index8, st_index16,<br>
>                              true, false, vue_map,<br>
> -                            &program_size, &error_str);<br>
> +                            &error_str);<br>
><br>
>     if (program == NULL) {<br>
>        if (!fp->program.is_arb_asm) {<br>
> @@ -213,7 +212,7 @@ brw_codegen_wm_prog(struct brw_context *brw,<br>
>     ralloc_steal(NULL, prog_data.base.pull_param);<br>
>     brw_upload_cache(&brw->cache, BRW_CACHE_FS_PROG,<br>
>                      key, sizeof(struct brw_wm_prog_key),<br>
> -                    program, program_size,<br>
> +                    program, prog_data.base.program_size,<br>
>                      &prog_data, sizeof(prog_data),<br>
>                      &brw->wm.base.prog_offset, &brw->wm.base.prog_data);<br>
><br>
> --<br>
> 2.15.0.rc0<br>
><br>
</div></div></blockquote></div><br></div></div>