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,8 +458,10 @@ gst_gl_shader_detach_unlocked (GstGLShader * shader, GstGLSLStage * stage)
return; return;
} }
g_assert (shader->context->gl_vtable->IsProgram (shader->priv-> if (shader->context->gl_vtable->IsProgram)
program_handle)); 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)); g_assert (shader->context->gl_vtable->IsShader (stage_handle));
GST_LOG_OBJECT (shader, "detaching shader %i from program %i", stage_handle, GST_LOG_OBJECT (shader, "detaching shader %i from program %i", stage_handle,
@ -533,8 +535,10 @@ gst_gl_shader_attach_unlocked (GstGLShader * shader, GstGLSLStage * stage)
return FALSE; return FALSE;
} }
g_assert (shader->context->gl_vtable->IsProgram (shader->priv-> if (shader->context->gl_vtable->IsProgram)
program_handle)); 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)); g_assert (shader->context->gl_vtable->IsShader (stage_handle));
shader->priv->stages = shader->priv->stages =

View file

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