[Mesa-dev] [PATCH 13/53] i965: pass gl_program directly to brw_compile_tes()

Lionel Landwerlin lionel.g.landwerlin at intel.com
Tue Jan 3 17:50:23 UTC 2017


Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

On 03/01/17 02:43, Timothy Arceri wrote:
> This is the only thing we use from gl_shader_program so pass it directly.
> ---
>   src/mesa/drivers/dri/i965/brw_compiler.h | 2 +-
>   src/mesa/drivers/dri/i965/brw_shader.cpp | 6 ++----
>   src/mesa/drivers/dri/i965/brw_tes.c      | 2 +-
>   3 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_compiler.h b/src/mesa/drivers/dri/i965/brw_compiler.h
> index 5e70601..db8f39c 100644
> --- a/src/mesa/drivers/dri/i965/brw_compiler.h
> +++ b/src/mesa/drivers/dri/i965/brw_compiler.h
> @@ -803,7 +803,7 @@ brw_compile_tes(const struct brw_compiler *compiler, void *log_data,
>                   const struct brw_tes_prog_key *key,
>                   struct brw_tes_prog_data *prog_data,
>                   const struct nir_shader *shader,
> -                struct gl_shader_program *shader_prog,
> +                struct gl_program *prog,
>                   int shader_time_index,
>                   unsigned *final_assembly_size,
>                   char **error_str);
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
> index 1ada15d..0d2f475 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
> @@ -1341,14 +1341,12 @@ brw_compile_tes(const struct brw_compiler *compiler,
>                   const struct brw_tes_prog_key *key,
>                   struct brw_tes_prog_data *prog_data,
>                   const nir_shader *src_shader,
> -                struct gl_shader_program *shader_prog,
> +                struct gl_program *prog,
>                   int shader_time_index,
>                   unsigned *final_assembly_size,
>                   char **error_str)
>   {
>      const struct gen_device_info *devinfo = compiler->devinfo;
> -   struct gl_linked_shader *shader =
> -      shader_prog->_LinkedShaders[MESA_SHADER_TESS_EVAL];
>      const bool is_scalar = compiler->scalar_stage[MESA_SHADER_TESS_EVAL];
>   
>      nir_shader *nir = nir_shader_clone(mem_ctx, src_shader);
> @@ -1406,7 +1404,7 @@ brw_compile_tes(const struct brw_compiler *compiler,
>   
>      if (is_scalar) {
>         fs_visitor v(compiler, log_data, mem_ctx, (void *) key,
> -                   &prog_data->base.base, shader->Program, nir, 8,
> +                   &prog_data->base.base, prog, nir, 8,
>                      shader_time_index, &input_vue_map);
>         if (!v.run_tes()) {
>            if (error_str)
> diff --git a/src/mesa/drivers/dri/i965/brw_tes.c b/src/mesa/drivers/dri/i965/brw_tes.c
> index 464dbde..f98f874 100644
> --- a/src/mesa/drivers/dri/i965/brw_tes.c
> +++ b/src/mesa/drivers/dri/i965/brw_tes.c
> @@ -178,7 +178,7 @@ brw_codegen_tes_prog(struct brw_context *brw,
>      char *error_str;
>      const unsigned *program =
>         brw_compile_tes(compiler, brw, mem_ctx, key, &prog_data, nir,
> -                      shader_prog, st_index, &program_size, &error_str);
> +                      &tep->program, st_index, &program_size, &error_str);
>      if (program == NULL) {
>         tep->program.sh.data->LinkStatus = false;
>         ralloc_strcat(&tep->program.sh.data->InfoLog, error_str);




More information about the mesa-dev mailing list