glshader: some compatibility changes for GL 1.4

GL 1.4 (with GL_ARB_shader_objects) doesn't have glIsProgram or glIsShader
equivalents.  As they are simply assertions, skip them when there isn't a
valid function pointer.
This commit is contained in:
Matthew Waters 2016-03-10 17:46:05 +11:00 committed by Tim-Philipp Müller
parent c1d49430ec
commit fdca1dec0d
2 changed files with 11 additions and 7 deletions

View file

@ -458,9 +458,11 @@ gst_gl_shader_detach_unlocked (GstGLShader * shader, GstGLSLStage * stage)
return;
}
g_assert (shader->context->gl_vtable->IsProgram (shader->priv->
program_handle));
g_assert (shader->context->gl_vtable->IsShader (stage_handle));
if (shader->context->gl_vtable->IsProgram)
g_assert (shader->context->gl_vtable->IsProgram (shader->
priv->program_handle));
if (shader->context->gl_vtable->IsShader)
g_assert (shader->context->gl_vtable->IsShader (stage_handle));
GST_LOG_OBJECT (shader, "detaching shader %i from program %i", stage_handle,
(int) shader->priv->program_handle);
@ -533,9 +535,11 @@ gst_gl_shader_attach_unlocked (GstGLShader * shader, GstGLSLStage * stage)
return FALSE;
}
g_assert (shader->context->gl_vtable->IsProgram (shader->priv->
program_handle));
g_assert (shader->context->gl_vtable->IsShader (stage_handle));
if (shader->context->gl_vtable->IsProgram)
g_assert (shader->context->gl_vtable->IsProgram (shader->
priv->program_handle));
if (shader->context->gl_vtable->IsShader)
g_assert (shader->context->gl_vtable->IsShader (stage_handle));
shader->priv->stages =
g_list_prepend (shader->priv->stages, gst_object_ref_sink (stage));

View file

@ -471,7 +471,7 @@ _compile_shader (GstGLContext * context, struct compile *data)
/* FIXME: supported threaded GLSL compilers and don't destroy compilation
* performance by getting the compilation result directly after compilation */
status = GL_FALSE;
gl->GetShaderiv (priv->handle, GL_COMPILE_STATUS, &status);
vtable->GetShaderiv (priv->handle, GL_COMPILE_STATUS, &status);
len = 0;
vtable->GetShaderInfoLog (priv->handle, sizeof (info_buffer) - 1, &len,