program: convert _mesa_init_gl_program() to take struct gl_program *
Rather than accepting a void pointer, only to down and up cast around it, convert the function to take the base (struct gl_program) pointer. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
@@ -1315,9 +1315,10 @@ static struct gl_program *
|
||||
i915NewProgram(struct gl_context * ctx, GLenum target, GLuint id)
|
||||
{
|
||||
switch (target) {
|
||||
case GL_VERTEX_PROGRAM_ARB:
|
||||
return _mesa_init_gl_program(CALLOC_STRUCT(gl_vertex_program),
|
||||
target, id);
|
||||
case GL_VERTEX_PROGRAM_ARB: {
|
||||
struct gl_vertex_program *prog = CALLOC_STRUCT(gl_vertex_program);
|
||||
return _mesa_init_gl_program(&prog->Base, target, id);
|
||||
}
|
||||
|
||||
case GL_FRAGMENT_PROGRAM_ARB:{
|
||||
struct i915_fragment_program *prog =
|
||||
@@ -1325,7 +1326,7 @@ i915NewProgram(struct gl_context * ctx, GLenum target, GLuint id)
|
||||
if (prog) {
|
||||
i915_init_program(I915_CONTEXT(ctx), prog);
|
||||
|
||||
return _mesa_init_gl_program(prog, target, id);
|
||||
return _mesa_init_gl_program(&prog->FragProg.Base, target, id);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user