* GLSL utility code that could be linked against any stage, so just
* arbitrarily pick GL_VERTEX_SHADER.
*/
- shader = _mesa_new_shader(NULL, 0, MESA_SHADER_VERTEX);
+ shader = _mesa_new_shader(0, MESA_SHADER_VERTEX);
shader->symbols = new(mem_ctx) glsl_symbol_table;
gl_ModelViewProjectionMatrix =
}
struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, gl_shader_stage stage)
+_mesa_new_shader(GLuint name, gl_shader_stage stage)
{
struct gl_shader *shader;
- (void) ctx;
-
assert(stage == MESA_SHADER_FRAGMENT || stage == MESA_SHADER_VERTEX);
shader = rzalloc(NULL, struct gl_shader);
if (shader) {
struct gl_shader *sh);
extern "C" struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, gl_shader_stage stage);
+_mesa_new_shader(GLuint name, gl_shader_stage stage);
extern "C" struct gl_linked_shader *
_mesa_new_linked_shader(gl_shader_stage stage);
const GLuint name = ~0;
struct gl_shader *sh;
- sh = _mesa_new_shader(ctx, name, stage);
+ sh = _mesa_new_shader(name, stage);
sh->Source = strdup(source);
sh->CompileStatus = false;
_mesa_compile_shader(ctx, sh);
_mesa_glsl_parse_state *state;
p.mem_ctx = ralloc_context(NULL);
- p.shader = _mesa_new_shader(ctx, 0, MESA_SHADER_FRAGMENT);
+ p.shader = _mesa_new_shader(0, MESA_SHADER_FRAGMENT);
p.shader->ir = new(p.shader) exec_list;
state = new(p.shader) _mesa_glsl_parse_state(ctx, MESA_SHADER_FRAGMENT,
p.shader);
_mesa_HashLockMutex(ctx->Shared->ShaderObjects);
name = _mesa_HashFindFreeKeyBlock(ctx->Shared->ShaderObjects, 1);
- sh = _mesa_new_shader(ctx, name, _mesa_shader_enum_to_shader_stage(type));
+ sh = _mesa_new_shader(name, _mesa_shader_enum_to_shader_stage(type));
sh->Type = type;
_mesa_HashInsertLocked(ctx->Shared->ShaderObjects, name, sh);
_mesa_HashUnlockMutex(ctx->Shared->ShaderObjects);
}
}
-void
-_mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader)
+static void
+_mesa_init_shader(struct gl_shader *shader)
{
shader->RefCount = 1;
shader->Geom.VerticesOut = -1;
* Allocate a new gl_shader object, initialize it.
*/
struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, gl_shader_stage stage)
+_mesa_new_shader(GLuint name, gl_shader_stage stage)
{
struct gl_shader *shader;
shader = rzalloc(NULL, struct gl_shader);
if (shader) {
shader->Stage = stage;
shader->Name = name;
- _mesa_init_shader(ctx, shader);
+ _mesa_init_shader(shader);
}
return shader;
}
_mesa_reference_shader_program_(ctx, ptr, shProg);
}
-
-extern void
-_mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader);
-
extern struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, gl_shader_stage type);
+_mesa_new_shader(GLuint name, gl_shader_stage type);
extern struct gl_linked_shader *
_mesa_new_linked_shader(gl_shader_stage type);