cogl: Remove unused CoglShaderLanguage

There is only GLSL.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/819
This commit is contained in:
Adam Jackson 2019-10-17 16:12:22 -04:00
parent 5aa971b177
commit 22d1febf3c
5 changed files with 6 additions and 65 deletions

View File

@ -76,9 +76,6 @@ _cogl_program_flush_uniforms (CoglProgram *program,
GLuint gl_program,
gboolean gl_program_changed);
CoglShaderLanguage
_cogl_program_get_language (CoglHandle handle);
gboolean
_cogl_program_has_fragment_shader (CoglHandle handle);

View File

@ -96,7 +96,6 @@ cogl_program_attach_shader (CoglHandle program_handle,
CoglHandle shader_handle)
{
CoglProgram *program;
CoglShader *shader;
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
@ -104,11 +103,6 @@ cogl_program_attach_shader (CoglHandle program_handle,
return;
program = program_handle;
shader = shader_handle;
if (shader->language == COGL_SHADER_LANGUAGE_GLSL)
g_return_if_fail (_cogl_program_get_language (program) ==
COGL_SHADER_LANGUAGE_GLSL);
program->attached_shaders
= g_slist_prepend (program->attached_shaders,
@ -355,26 +349,19 @@ _cogl_program_flush_uniforms (CoglProgram *program,
{
if (gl_program_changed || !uniform->location_valid)
{
if (_cogl_program_get_language (program) ==
COGL_SHADER_LANGUAGE_GLSL)
uniform->location =
ctx->glGetUniformLocation (gl_program, uniform->name);
uniform->location =
ctx->glGetUniformLocation (gl_program, uniform->name);
uniform->location_valid = TRUE;
uniform->location_valid = TRUE;
}
/* If the uniform isn't really in the program then there's
no need to actually set it */
if (uniform->location != -1)
{
switch (_cogl_program_get_language (program))
{
case COGL_SHADER_LANGUAGE_GLSL:
_cogl_boxed_value_set_uniform (ctx,
uniform->location,
&uniform->value);
break;
}
_cogl_boxed_value_set_uniform (ctx,
uniform->location,
&uniform->value);
}
uniform->dirty = FALSE;
@ -382,22 +369,6 @@ _cogl_program_flush_uniforms (CoglProgram *program,
}
}
CoglShaderLanguage
_cogl_program_get_language (CoglHandle handle)
{
CoglProgram *program = handle;
/* Use the language of the first shader */
if (program->attached_shaders)
{
CoglShader *shader = program->attached_shaders->data;
return shader->language;
}
else
return COGL_SHADER_LANGUAGE_GLSL;
}
static gboolean
_cogl_program_has_shader_type (CoglProgram *program,
CoglShaderType type)

View File

@ -38,18 +38,12 @@
typedef struct _CoglShader CoglShader;
typedef enum
{
COGL_SHADER_LANGUAGE_GLSL,
} CoglShaderLanguage;
struct _CoglShader
{
CoglHandleObject _parent;
GLuint gl_handle;
CoglPipeline *compilation_pipeline;
CoglShaderType type;
CoglShaderLanguage language;
char *source;
};

View File

@ -84,7 +84,6 @@ cogl_create_shader (CoglShaderType type)
}
shader = g_slice_new (CoglShader);
shader->language = COGL_SHADER_LANGUAGE_GLSL;
shader->gl_handle = 0;
shader->compilation_pipeline = NULL;
shader->type = type;
@ -114,7 +113,6 @@ cogl_shader_source (CoglHandle handle,
const char *source)
{
CoglShader *shader;
CoglShaderLanguage language;
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
@ -122,16 +120,8 @@ cogl_shader_source (CoglHandle handle,
return;
shader = handle;
language = COGL_SHADER_LANGUAGE_GLSL;
/* Delete the old object if the language is changing... */
if (G_UNLIKELY (language != shader->language) &&
shader->gl_handle)
delete_shader (shader);
shader->source = g_strdup (source);
shader->language = language;
}
void

View File

@ -638,15 +638,6 @@ _cogl_pipeline_progend_glsl_flush_uniforms (CoglPipeline *pipeline,
static gboolean
_cogl_pipeline_progend_glsl_start (CoglPipeline *pipeline)
{
CoglHandle user_program;
_COGL_GET_CONTEXT (ctx, FALSE);
user_program = cogl_pipeline_get_user_program (pipeline);
if (user_program &&
_cogl_program_get_language (user_program) != COGL_SHADER_LANGUAGE_GLSL)
return FALSE;
return TRUE;
}
@ -742,8 +733,6 @@ _cogl_pipeline_progend_glsl_end (CoglPipeline *pipeline,
_cogl_shader_compile_real (shader, pipeline);
g_assert (shader->language == COGL_SHADER_LANGUAGE_GLSL);
GE( ctx, glAttachShader (program_state->program,
shader->gl_handle) );
}