cogl: Remove unused CoglPipelineProgramType

There is only GLSL.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/819
This commit is contained in:
Adam Jackson 2019-03-07 13:44:49 -05:00
parent 23e9fd3dfa
commit 8cac82318f
5 changed files with 4 additions and 105 deletions

View File

@ -249,8 +249,6 @@ struct _CoglContext
/* Fragment processing programs */
CoglHandle current_program;
CoglPipelineProgramType current_fragment_program_type;
CoglPipelineProgramType current_vertex_program_type;
GLuint current_gl_program;
gboolean current_gl_dither_enabled;

View File

@ -299,8 +299,6 @@ cogl_context_new (CoglDisplay *display,
context->max_texture_units = -1;
context->max_activateable_texture_units = -1;
context->current_fragment_program_type = COGL_PIPELINE_PROGRAM_TYPE_GLSL;
context->current_vertex_program_type = COGL_PIPELINE_PROGRAM_TYPE_GLSL;
context->current_gl_program = 0;
context->current_gl_dither_enabled = TRUE;

View File

@ -481,11 +481,6 @@ typedef struct
void (* pre_paint) (CoglPipeline *pipeline, CoglFramebuffer *framebuffer);
} CoglPipelineProgend;
typedef enum
{
COGL_PIPELINE_PROGRAM_TYPE_GLSL = 1,
} CoglPipelineProgramType;
extern const CoglPipelineFragend *
_cogl_pipeline_fragends[COGL_PIPELINE_N_FRAGENDS];
extern const CoglPipelineVertend *
@ -618,10 +613,7 @@ typedef struct _CoglPipelineFlushOptions
} CoglPipelineFlushOptions;
void
_cogl_use_fragment_program (GLuint gl_program, CoglPipelineProgramType type);
void
_cogl_use_vertex_program (GLuint gl_program, CoglPipelineProgramType type);
cogl_use_program (GLuint gl_program);
unsigned int
_cogl_get_n_args_for_combine_func (CoglPipelineCombineFunc func);

View File

@ -238,8 +238,8 @@ _cogl_pipeline_texture_storage_change_notify (CoglTexture *texture)
}
}
static void
set_glsl_program (GLuint gl_program)
void
cogl_use_program (GLuint gl_program)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
@ -257,94 +257,6 @@ set_glsl_program (GLuint gl_program)
}
}
void
_cogl_use_fragment_program (GLuint gl_program, CoglPipelineProgramType type)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
/* If we're changing program type... */
if (type != ctx->current_fragment_program_type)
{
/* ... disable the old type */
switch (ctx->current_fragment_program_type)
{
case COGL_PIPELINE_PROGRAM_TYPE_GLSL:
/* If the program contains a vertex shader then we shouldn't
disable it */
if (ctx->current_vertex_program_type !=
COGL_PIPELINE_PROGRAM_TYPE_GLSL)
set_glsl_program (0);
break;
}
/* ... and enable the new type */
switch (type)
{
case COGL_PIPELINE_PROGRAM_TYPE_GLSL:
/* don't need to to anything */
break;
}
}
if (type == COGL_PIPELINE_PROGRAM_TYPE_GLSL)
{
#ifdef COGL_PIPELINE_FRAGEND_GLSL
set_glsl_program (gl_program);
#else
g_warning ("Unexpected use of GLSL fragend!");
#endif /* COGL_PIPELINE_FRAGEND_GLSL */
}
ctx->current_fragment_program_type = type;
}
void
_cogl_use_vertex_program (GLuint gl_program, CoglPipelineProgramType type)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
/* If we're changing program type... */
if (type != ctx->current_vertex_program_type)
{
/* ... disable the old type */
switch (ctx->current_vertex_program_type)
{
case COGL_PIPELINE_PROGRAM_TYPE_GLSL:
/* If the program contains a fragment shader then we shouldn't
disable it */
if (ctx->current_fragment_program_type !=
COGL_PIPELINE_PROGRAM_TYPE_GLSL)
set_glsl_program (0);
break;
}
/* ... and enable the new type */
switch (type)
{
case COGL_PIPELINE_PROGRAM_TYPE_GLSL:
/* don't need to to anything */
break;
}
}
if (type == COGL_PIPELINE_PROGRAM_TYPE_GLSL)
{
#ifdef COGL_PIPELINE_VERTEND_GLSL
set_glsl_program (gl_program);
#else
g_warning ("Unexpected use of GLSL vertend!");
#endif /* COGL_PIPELINE_VERTEND_GLSL */
}
ctx->current_vertex_program_type = type;
}
#if defined(HAVE_COGL_GLES2) || defined(HAVE_COGL_GL)
static gboolean

View File

@ -773,8 +773,7 @@ _cogl_pipeline_progend_glsl_end (CoglPipeline *pipeline,
gl_program = program_state->program;
_cogl_use_fragment_program (gl_program, COGL_PIPELINE_PROGRAM_TYPE_GLSL);
_cogl_use_vertex_program (gl_program, COGL_PIPELINE_PROGRAM_TYPE_GLSL);
cogl_use_program (gl_program);
state.unit = 0;
state.gl_program = gl_program;