continue;
struct gl_program *prog =
- ctx->Driver.NewProgram(ctx, _mesa_program_index_to_target(stage),
+ ctx->Driver.NewProgram(ctx, _mesa_shader_stage_to_program(stage),
shader->base.Name);
if (!prog)
return false;
_mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
linked_prog);
if (!ctx->Driver.ProgramStringNotify(ctx,
- _mesa_program_index_to_target(i),
+ _mesa_shader_stage_to_program(i),
linked_prog)) {
return GL_FALSE;
}
static inline GLenum
-_mesa_shader_stage_to_program(gl_shader_stage stage)
+_mesa_shader_stage_to_program(unsigned stage)
{
switch (stage) {
case MESA_SHADER_VERTEX:
}
-static inline GLenum
-_mesa_program_index_to_target(GLuint i)
-{
- static const GLenum enums[] = {
- GL_VERTEX_PROGRAM_ARB,
- GL_GEOMETRY_PROGRAM_NV,
- GL_FRAGMENT_PROGRAM_ARB
- };
- STATIC_ASSERT(Elements(enums) == MESA_SHADER_STAGES);
- if(i >= MESA_SHADER_STAGES) {
- assert(!"Unexpected program index");
- return 0;
- } else
- return enums[i];
-}
-
-
/* Cast wrappers from gl_program to gl_vertex/geometry/fragment_program */
static inline struct gl_fragment_program *
_mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
linked_prog);
if (!ctx->Driver.ProgramStringNotify(ctx,
- _mesa_program_index_to_target(i),
+ _mesa_shader_stage_to_program(i),
linked_prog)) {
_mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
NULL);