[Mesa-dev] [PATCH] st/mesa: remove st_dump_program_for_shader_db

Nicolai Hähnle nhaehnle at gmail.com
Wed Jul 6 08:53:17 UTC 2016


Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

On 05.07.2016 11:36, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> replaced by MESA_SHADER_CAPTURE_PATH in core Mesa
> ---
>   src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 66 ------------------------------
>   1 file changed, 66 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 6d08c58..8c2551d 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -6685,71 +6685,6 @@ get_mesa_program(struct gl_context *ctx,
>
>   extern "C" {
>
> -static void
> -st_dump_program_for_shader_db(struct gl_context *ctx,
> -                              struct gl_shader_program *prog)
> -{
> -   /* Dump only successfully compiled and linked shaders to the specified
> -    * file. This is for shader-db.
> -    *
> -    * These options allow some pre-processing of shaders while dumping,
> -    * because some apps have ill-formed shaders.
> -    */
> -   const char *dump_filename = os_get_option("ST_DUMP_SHADERS");
> -   const char *insert_directives = os_get_option("ST_DUMP_INSERT");
> -
> -   if (dump_filename && prog->Name != 0) {
> -      FILE *f = fopen(dump_filename, "a");
> -
> -      if (f) {
> -         for (unsigned i = 0; i < prog->NumShaders; i++) {
> -            const struct gl_shader *sh = prog->Shaders[i];
> -            const char *source;
> -            bool skip_version = false;
> -
> -            if (!sh)
> -               continue;
> -
> -            source = sh->Source;
> -
> -            /* This string mustn't be changed. shader-db uses it to find
> -             * where the shader begins.
> -             */
> -            fprintf(f, "GLSL %s shader %d source for linked program %d:\n",
> -                    _mesa_shader_stage_to_string(sh->Stage),
> -                    i, prog->Name);
> -
> -            /* Dump the forced version if set. */
> -            if (ctx->Const.ForceGLSLVersion) {
> -               fprintf(f, "#version %i\n", ctx->Const.ForceGLSLVersion);
> -               skip_version = true;
> -            }
> -
> -            /* Insert directives (optional). */
> -            if (insert_directives) {
> -               if (!ctx->Const.ForceGLSLVersion && prog->Version)
> -                  fprintf(f, "#version %i\n", prog->Version);
> -               fprintf(f, "%s\n", insert_directives);
> -               skip_version = true;
> -            }
> -
> -            if (skip_version && strncmp(source, "#version ", 9) == 0) {
> -               const char *next_line = strstr(source, "\n");
> -
> -               if (next_line)
> -                  source = next_line + 1;
> -               else
> -                  continue;
> -            }
> -
> -            fprintf(f, "%s", source);
> -            fprintf(f, "\n");
> -         }
> -         fclose(f);
> -      }
> -   }
> -}
> -
>   /**
>    * Link a shader.
>    * Called via ctx->Driver.LinkShader()
> @@ -6876,7 +6811,6 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
>         _mesa_reference_program(ctx, &linked_prog, NULL);
>      }
>
> -   st_dump_program_for_shader_db(ctx, prog);
>      return GL_TRUE;
>   }
>
>


More information about the mesa-dev mailing list