[vlc-commits] opengl: add support for renderbuffers API

Romain Vimont git at videolan.org
Thu Sep 10 15:41:54 CEST 2020


vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Tue Jul  7 12:34:00 2020 +0200| [cbe2ebee4a461cd7b195fdd3109042204010a0ce] | committer: Alexandre Janniaux

opengl: add support for renderbuffers API

Co-authored-by: Alexandre Janniaux <ajanni at videolabs.io>
Signed-off-by: Alexandre Janniaux <ajanni at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cbe2ebee4a461cd7b195fdd3109042204010a0ce
---

 modules/video_output/opengl/gl_api.c    |  6 ++++++
 modules/video_output/opengl/gl_common.h | 17 +++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/modules/video_output/opengl/gl_api.c b/modules/video_output/opengl/gl_api.c
index bdfd9c030b..68c42cc6d4 100644
--- a/modules/video_output/opengl/gl_api.c
+++ b/modules/video_output/opengl/gl_api.c
@@ -124,6 +124,12 @@ vlc_gl_api_Init(struct vlc_gl_api *api, vlc_gl_t *gl)
     GET_PROC_ADDR_OPTIONAL(BindFramebuffer);
     GET_PROC_ADDR_OPTIONAL(FramebufferTexture2D);
     GET_PROC_ADDR_OPTIONAL(CheckFramebufferStatus);
+    GET_PROC_ADDR_OPTIONAL(GenRenderbuffers);
+    GET_PROC_ADDR_OPTIONAL(DeleteRenderbuffers);
+    GET_PROC_ADDR_OPTIONAL(BindRenderbuffer);
+    GET_PROC_ADDR_OPTIONAL(RenderbufferStorageMultisample);
+    GET_PROC_ADDR_OPTIONAL(FramebufferRenderbuffer);
+    GET_PROC_ADDR_OPTIONAL(BlitFramebuffer);
 
     GET_PROC_ADDR_OPTIONAL(BufferSubData);
     GET_PROC_ADDR_OPTIONAL(BufferStorage);
diff --git a/modules/video_output/opengl/gl_common.h b/modules/video_output/opengl/gl_common.h
index a1dd060dff..81ec807400 100644
--- a/modules/video_output/opengl/gl_common.h
+++ b/modules/video_output/opengl/gl_common.h
@@ -72,6 +72,9 @@
 #ifndef GL_RG16
 # define GL_RG16 0x822C
 #endif
+#ifndef GL_RGBA8
+# define GL_RGBA8 0x8058
+#endif
 #ifndef GL_LUMINANCE16
 # define GL_LUMINANCE16 0x8042
 #endif
@@ -208,6 +211,14 @@ typedef void (APIENTRY *PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GL
 typedef void (APIENTRY *PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
 typedef void (APIENTRY *PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
 typedef void (APIENTRY *PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRY *PFNGLGENRENDERBUFFERSPROC) (GLsizei count, GLuint *renderbuffers);
+typedef void (APIENTRY *PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRY *PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRY *PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRY *PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRY *PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+                                                   GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+                                                   GLbitfield mask, GLenum filter);
 
 /* The following are defined in glext.h but not for GLES2 or on Apple systems */
 #if defined(USE_OPENGL_ES2) || defined(__APPLE__)
@@ -353,6 +364,12 @@ typedef struct {
     PFNGLBINDFRAMEBUFFERPROC        BindFramebuffer;
     PFNGLFRAMEBUFFERTEXTURE2DPROC   FramebufferTexture2D;
     PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus;
+    PFNGLGENRENDERBUFFERSPROC       GenRenderbuffers;
+    PFNGLDELETERENDERBUFFERSPROC    DeleteRenderbuffers;
+    PFNGLBINDRENDERBUFFERPROC       BindRenderbuffer;
+    PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample;
+    PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer;
+    PFNGLBLITFRAMEBUFFERPROC        BlitFramebuffer;
 
     /* Commands used for PBO and/or Persistent mapping */
     PFNGLBUFFERSUBDATAPROC          BufferSubData; /* can be NULL */



More information about the vlc-commits mailing list