[vlc-devel] [PATCH v3 18/22] opengl: add support for renderbuffers API
Romain Vimont
rom1v at videolabs.io
Mon Jul 6 12:47:11 CEST 2020
Co-authored-by: Alexandre Janniaux <ajanni at videolabs.io>
---
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 */
--
2.27.0
More information about the vlc-devel
mailing list