mesa/st: move new ati fragment shader to mesa

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14700>
This commit is contained in:
Dave Airlie 2021-12-20 16:00:43 +10:00 committed by Marge Bot
parent 3faa21bda7
commit 5730772e36
3 changed files with 13 additions and 15 deletions

View file

@ -56,6 +56,17 @@ _mesa_new_ati_fragment_shader(struct gl_context *ctx, GLuint id)
return s;
}
static struct gl_program *
new_ati_fs(struct gl_context *ctx, struct ati_fragment_shader *curProg)
{
struct gl_program *prog = rzalloc(NULL, struct gl_program);
if (!prog)
return NULL;
_mesa_init_gl_program(prog, MESA_SHADER_FRAGMENT, curProg->Id, true);
prog->ati_fs = curProg;
return prog;
}
/**
* Delete the given ati fragment shader
@ -415,8 +426,8 @@ _mesa_EndFragmentShaderATI(void)
}
#endif
struct gl_program *prog = st_new_ati_fs(ctx,
ctx->ATIFragmentShader.Current);
struct gl_program *prog = new_ati_fs(ctx,
ctx->ATIFragmentShader.Current);
_mesa_reference_program(ctx, &ctx->ATIFragmentShader.Current->Program,
NULL);
/* Don't use _mesa_reference_program(), just take ownership */

View file

@ -127,18 +127,6 @@ st_program_string_notify( struct gl_context *ctx,
return GL_TRUE;
}
/**
* Called in glEndFragmentShaderATI()
*/
struct gl_program *
st_new_ati_fs(struct gl_context *ctx, struct ati_fragment_shader *curProg)
{
struct gl_program *prog = st_new_program(ctx, MESA_SHADER_FRAGMENT,
curProg->Id, true);
prog->ati_fs = curProg;
return prog;
}
/**
* Plug in the program and shader-related device driver functions.
*/

View file

@ -40,7 +40,6 @@ void st_delete_program(struct gl_context *ctx, struct gl_program *prog);
GLboolean st_program_string_notify(struct gl_context *ctx,
GLenum target,
struct gl_program *prog);
struct gl_program *st_new_ati_fs(struct gl_context *ctx, struct ati_fragment_shader *curProg);
#ifdef __cplusplus
}