summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-03-15 17:08:17 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-03-16 23:57:11 -0700
commit7753657cf2cf3c1090186f9e33335a0417ce35fe (patch)
tree5fbacd2294834d9facabb2269908e260764a5cc3
parenta461e0003fdca564fa1ec7528c2463c50a797e85 (diff)
mesa: Make link_program() take a gl_shader_program, not a GLuint.
In half the callers, we already have a pointer, and don't need to look it up again. This will also help with upcoming meta work. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
-rw-r--r--src/mesa/main/shaderapi.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 43c4188cf2..c7b1047bea 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1021,11 +1021,8 @@ compile_shader(struct gl_context *ctx, struct gl_shader *sh)
* Link a program's shaders.
*/
static void
-link_program(struct gl_context *ctx, GLuint program)
+link_program(struct gl_context *ctx, struct gl_shader_program *shProg)
{
- struct gl_shader_program *shProg;
-
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glLinkProgram");
if (!shProg)
return;
@@ -1515,7 +1512,8 @@ _mesa_LinkProgram(GLuint programObj)
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glLinkProgram %u\n", programObj);
- link_program(ctx, programObj);
+ link_program(ctx, _mesa_lookup_shader_program_err(ctx, programObj,
+ "glLinkProgram"));
}
#if defined(HAVE_SHA1)
@@ -2169,7 +2167,7 @@ _mesa_CreateShaderProgramv(GLenum type, GLsizei count,
get_shaderiv(ctx, shader, GL_COMPILE_STATUS, &compiled);
if (compiled) {
attach_shader(ctx, program, shader);
- link_program(ctx, program);
+ link_program(ctx, shProg);
detach_shader(ctx, program, shader);
#if 0