Mesa (master): glsl_to_tgsi: remove unused code

Bryan Cain bryanc at kemper.freedesktop.org
Sat Aug 27 17:28:01 PDT 2011


Module: Mesa
Branch: master
Commit: c8fed01c732fa20e1ae035ed5f7b6156a5d6ffe9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c8fed01c732fa20e1ae035ed5f7b6156a5d6ffe9

Author: Marek Olšák <maraeo at gmail.com>
Date:   Wed Aug 24 23:58:43 2011 +0200

glsl_to_tgsi: remove unused code

---

 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |   79 ----------------------------
 src/mesa/state_tracker/st_glsl_to_tgsi.h   |    1 -
 2 files changed, 0 insertions(+), 80 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 9cac309..2266083 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2963,36 +2963,6 @@ set_uniform_initializer(struct gl_context *ctx, void *mem_ctx,
    }
 }
 
-static void
-set_uniform_initializers(struct gl_context *ctx,
-        		 struct gl_shader_program *shader_program)
-{
-   void *mem_ctx = NULL;
-
-   for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) {
-      struct gl_shader *shader = shader_program->_LinkedShaders[i];
-
-      if (shader == NULL)
-         continue;
-
-      foreach_iter(exec_list_iterator, iter, *shader->ir) {
-         ir_instruction *ir = (ir_instruction *)iter.get();
-         ir_variable *var = ir->as_variable();
-
-         if (!var || var->mode != ir_var_uniform || !var->constant_value)
-            continue;
-
-         if (!mem_ctx)
-            mem_ctx = ralloc_context(NULL);
-
-         set_uniform_initializer(ctx, mem_ctx, shader_program, var->name,
-        			 var->type, var->constant_value);
-      }
-   }
-
-   ralloc_free(mem_ctx);
-}
-
 /*
  * Scan/rewrite program to remove reads of custom (output) registers.
  * The passed type has to be either PROGRAM_OUTPUT or PROGRAM_VARYING
@@ -5090,53 +5060,4 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
    return GL_TRUE;
 }
 
-
-/**
- * Link a GLSL shader program.  Called via glLinkProgram().
- */
-void
-st_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
-{
-   unsigned int i;
-
-   _mesa_clear_shader_program_data(ctx, prog);
-
-   prog->LinkStatus = GL_TRUE;
-
-   for (i = 0; i < prog->NumShaders; i++) {
-      if (!prog->Shaders[i]->CompileStatus) {
-         fail_link(prog, "linking with uncompiled shader");
-         prog->LinkStatus = GL_FALSE;
-      }
-   }
-
-   prog->Varying = _mesa_new_parameter_list();
-   _mesa_reference_vertprog(ctx, &prog->VertexProgram, NULL);
-   _mesa_reference_fragprog(ctx, &prog->FragmentProgram, NULL);
-   _mesa_reference_geomprog(ctx, &prog->GeometryProgram, NULL);
-
-   if (prog->LinkStatus) {
-      link_shaders(ctx, prog);
-   }
-
-   if (prog->LinkStatus) {
-      if (!ctx->Driver.LinkShader(ctx, prog)) {
-         prog->LinkStatus = GL_FALSE;
-      }
-   }
-
-   set_uniform_initializers(ctx, prog);
-
-   if (ctx->Shader.Flags & GLSL_DUMP) {
-      if (!prog->LinkStatus) {
-         printf("GLSL shader program %d failed to link\n", prog->Name);
-      }
-
-      if (prog->InfoLog && prog->InfoLog[0] != 0) {
-         printf("GLSL shader program %d info log:\n", prog->Name);
-         printf("%s\n", prog->InfoLog);
-      }
-   }
-}
-
 } /* extern "C" */
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.h b/src/mesa/state_tracker/st_glsl_to_tgsi.h
index d877471..fafe52e 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.h
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.h
@@ -64,7 +64,6 @@ struct gl_shader *st_new_shader(struct gl_context *ctx, GLuint name, GLuint type
 struct gl_shader_program *
 st_new_shader_program(struct gl_context *ctx, GLuint name);
 
-void st_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
 GLboolean st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
 
 #ifdef __cplusplus



More information about the mesa-commit mailing list