mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
cogl: Inline cogl_use_program into its one caller
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
This commit is contained in:
parent
640ad4718e
commit
c1bdaba5ac
@ -561,9 +561,6 @@ typedef struct _CoglPipelineFlushOptions
|
||||
CoglTexture *layer0_override_texture;
|
||||
} CoglPipelineFlushOptions;
|
||||
|
||||
void
|
||||
cogl_use_program (GLuint gl_program);
|
||||
|
||||
unsigned int
|
||||
_cogl_get_n_args_for_combine_func (CoglPipelineCombineFunc func);
|
||||
|
||||
|
@ -233,25 +233,6 @@ _cogl_pipeline_texture_storage_change_notify (CoglTexture *texture)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cogl_use_program (GLuint gl_program)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
if (ctx->current_gl_program != gl_program)
|
||||
{
|
||||
_cogl_gl_util_clear_gl_errors (ctx);
|
||||
ctx->glUseProgram (gl_program);
|
||||
if (_cogl_gl_util_get_error (ctx) == GL_NO_ERROR)
|
||||
ctx->current_gl_program = gl_program;
|
||||
else
|
||||
{
|
||||
GE( ctx, glUseProgram (0) );
|
||||
ctx->current_gl_program = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(HAVE_COGL_GLES2) || defined(HAVE_COGL_GL)
|
||||
|
||||
static gboolean
|
||||
|
@ -752,7 +752,18 @@ _cogl_pipeline_progend_glsl_end (CoglPipeline *pipeline,
|
||||
|
||||
gl_program = program_state->program;
|
||||
|
||||
cogl_use_program (gl_program);
|
||||
if (ctx->current_gl_program != gl_program)
|
||||
{
|
||||
_cogl_gl_util_clear_gl_errors (ctx);
|
||||
ctx->glUseProgram (gl_program);
|
||||
if (_cogl_gl_util_get_error (ctx) == GL_NO_ERROR)
|
||||
ctx->current_gl_program = gl_program;
|
||||
else
|
||||
{
|
||||
GE( ctx, glUseProgram (0) );
|
||||
ctx->current_gl_program = 0;
|
||||
}
|
||||
}
|
||||
|
||||
state.unit = 0;
|
||||
state.gl_program = gl_program;
|
||||
|
Loading…
Reference in New Issue
Block a user