[Mesa-dev] [PATCH] mesa: inline _mesa_active_program()

Timothy Arceri timothy.arceri at collabora.com
Fri Apr 15 12:15:59 UTC 2016


This is the only place it is used.
---
 src/mesa/main/shaderapi.c | 31 +++++++++++--------------------
 src/mesa/main/shaderapi.h |  4 ----
 2 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index f7ac298..7619b8f 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1101,25 +1101,6 @@ print_shader_info(const struct gl_shader_program *shProg)
 }
 
 
-/**
- * Use the named shader program for subsequent glUniform calls
- */
-void
-_mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg,
-		     const char *caller)
-{
-   if ((shProg != NULL) && !shProg->LinkStatus) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-		  "%s(program %u not linked)", caller, shProg->Name);
-      return;
-   }
-
-   if (ctx->Shader.ActiveProgram != shProg) {
-      _mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram, shProg);
-   }
-}
-
-
 static void
 use_shader_program(struct gl_context *ctx, gl_shader_stage stage,
                    struct gl_shader_program *shProg,
@@ -1173,7 +1154,17 @@ _mesa_use_program(struct gl_context *ctx, struct gl_shader_program *shProg)
    int i;
    for (i = 0; i < MESA_SHADER_STAGES; i++)
       use_shader_program(ctx, i, shProg, &ctx->Shader);
-   _mesa_active_program(ctx, shProg, "glUseProgram");
+
+   if ((shProg != NULL) && !shProg->LinkStatus) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glUseProgram(program %u not linked)", shProg->Name);
+      return;
+   }
+
+   /* Use the named shader program for subsequent glUniform calls */
+   if (ctx->Shader.ActiveProgram != shProg) {
+      _mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram, shProg);
+   }
 
    _mesa_shader_program_init_subroutine_defaults(shProg);
    if (ctx->Driver.UseProgram)
diff --git a/src/mesa/main/shaderapi.h b/src/mesa/main/shaderapi.h
index d2d7f16..55123f8 100644
--- a/src/mesa/main/shaderapi.h
+++ b/src/mesa/main/shaderapi.h
@@ -51,10 +51,6 @@ extern void
 _mesa_use_program(struct gl_context *ctx, struct gl_shader_program *shProg);
 
 extern void
-_mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg,
-		     const char *caller);
-
-extern void
 _mesa_compile_shader(struct gl_context *ctx, struct gl_shader *sh);
 
 extern void
-- 
2.5.5



More information about the mesa-dev mailing list