* Compile a shader.
*/
static void
-compile_shader(struct gl_context *ctx, GLuint shaderObj)
+compile_shader(struct gl_context *ctx, struct gl_shader *sh)
{
- struct gl_shader *sh;
-
- sh = _mesa_lookup_shader_err(ctx, shaderObj, "glCompileShader");
if (!sh)
return;
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glCompileShader %u\n", shaderObj);
- compile_shader(ctx, shaderObj);
+ compile_shader(ctx,
+ _mesa_lookup_shader_err(ctx, shaderObj, "glCompileShader"));
}
}
if (shader) {
- _mesa_ShaderSource(shader, count, strings, NULL);
+ struct gl_shader *sh = _mesa_lookup_shader(ctx, shader);
- compile_shader(ctx, shader);
+ _mesa_ShaderSource(shader, count, strings, NULL);
+ compile_shader(ctx, sh);
program = create_shader_program(ctx);
if (program) {
struct gl_shader_program *shProg;
- struct gl_shader *sh;
GLint compiled = GL_FALSE;
shProg = _mesa_lookup_shader_program(ctx, program);
- sh = _mesa_lookup_shader(ctx, shader);
shProg->SeparateShader = GL_TRUE;