tests/gl: make sure all GL commands are executed on the GL thread

e.g. the final glGetError() must also be completed on the GL thread
This commit is contained in:
Matthew Waters 2016-09-29 11:45:57 +10:00 committed by Tim-Philipp Müller
parent 112f85a474
commit 7ab50a8e8f
2 changed files with 16 additions and 2 deletions

View file

@ -85,14 +85,21 @@ setup (void)
} }
static void static void
teardown (void) _check_gl_error (GstGLContext * context, gpointer data)
{ {
GLuint error = context->gl_vtable->GetError (); GLuint error = context->gl_vtable->GetError ();
fail_if (error != GL_NONE, "GL error 0x%x encountered during processing\n", fail_if (error != GL_NONE, "GL error 0x%x encountered during processing\n",
error); error);
}
static void
teardown (void)
{
gst_object_unref (convert); gst_object_unref (convert);
gst_object_unref (window); gst_object_unref (window);
gst_gl_context_thread_add (context, (GstGLContextThreadFunc) _check_gl_error,
NULL);
gst_object_unref (context); gst_object_unref (context);
gst_object_unref (display); gst_object_unref (display);
} }

View file

@ -86,14 +86,21 @@ setup (void)
} }
static void static void
teardown (void) _check_gl_error (GstGLContext * context, gpointer data)
{ {
GLuint error = context->gl_vtable->GetError (); GLuint error = context->gl_vtable->GetError ();
fail_if (error != GL_NONE, "GL error 0x%x encountered during processing\n", fail_if (error != GL_NONE, "GL error 0x%x encountered during processing\n",
error); error);
}
static void
teardown (void)
{
gst_object_unref (upload); gst_object_unref (upload);
gst_object_unref (window); gst_object_unref (window);
gst_gl_context_thread_add (context, (GstGLContextThreadFunc) _check_gl_error,
NULL);
gst_object_unref (context); gst_object_unref (context);
gst_object_unref (display); gst_object_unref (display);
if (shader) if (shader)