From 414a319f039b42464c6d4c2dbd6879f72757ed46 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 12 Nov 2014 22:48:04 +1100 Subject: [PATCH] glframebuffer: add support for gl3 --- gst-libs/gst/gl/gstglframebuffer.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gst-libs/gst/gl/gstglframebuffer.c b/gst-libs/gst/gl/gstglframebuffer.c index 6cde96ce70..5a37b4df81 100644 --- a/gst-libs/gst/gl/gstglframebuffer.c +++ b/gst-libs/gst/gl/gstglframebuffer.c @@ -112,11 +112,12 @@ gst_gl_framebuffer_generate (GstGLFramebuffer * frame, gint width, gint height, gl->GenRenderbuffers (1, depth); gl->BindRenderbuffer (GL_RENDERBUFFER, *depth); - if (gst_gl_context_get_gl_api (frame->context) & GST_GL_API_OPENGL) { - gl->RenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH_COMPONENT, - width, height); - gl->RenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, - width, height); + if (gst_gl_context_get_gl_api (frame->context) & (GST_GL_API_OPENGL | + GST_GL_API_OPENGL3)) { + gl->RenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH_COMPONENT, width, + height); + gl->RenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, width, + height); } if (gst_gl_context_get_gl_api (frame->context) & GST_GL_API_GLES2) { gl->RenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, @@ -141,7 +142,8 @@ gst_gl_framebuffer_generate (GstGLFramebuffer * frame, gint width, gint height, gl->FramebufferRenderbuffer (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, *depth); - if (gst_gl_context_get_gl_api (frame->context) & GST_GL_API_OPENGL) { + if (gst_gl_context_get_gl_api (frame->context) & (GST_GL_API_OPENGL | + GST_GL_API_OPENGL3)) { gl->FramebufferRenderbuffer (GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, *depth); } @@ -299,7 +301,8 @@ gst_gl_framebuffer_use_v2 (GstGLFramebuffer * frame, gint texture_fbo_width, gl->Viewport (0, 0, texture_fbo_width, texture_fbo_height); - if (gst_gl_context_get_gl_api (frame->context) & GST_GL_API_OPENGL) + if (gst_gl_context_get_gl_api (frame->context) & (GST_GL_API_OPENGL | + GST_GL_API_OPENGL3)) gl->DrawBuffer (GL_COLOR_ATTACHMENT0); gl->ClearColor (0.0, 0.0, 0.0, 0.0); @@ -308,7 +311,8 @@ gst_gl_framebuffer_use_v2 (GstGLFramebuffer * frame, gint texture_fbo_width, /* the opengl scene */ cb (stuff); - if (gst_gl_context_get_gl_api (frame->context) & GST_GL_API_OPENGL) + if (gst_gl_context_get_gl_api (frame->context) & (GST_GL_API_OPENGL | + GST_GL_API_OPENGL3)) gl->DrawBuffer (GL_NONE); gl->Viewport (viewport_dim[0], viewport_dim[1],