[vlc-commits] opengl: simplify opengl_init_program() call
Romain Vimont
git at videolan.org
Thu Feb 13 23:12:49 CET 2020
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Mon Jan 27 15:52:12 2020 +0100| [94dc92ab9e5285d708665dacf761bc7a6d23bf07] | committer: Jean-Baptiste Kempf
opengl: simplify opengl_init_program() call
Do not pass extensions to opengl_init_program().
This was an optimization not to retrieve the extensions list twice.
However, since the initialization will be moved into a separate
component (the renderer), we don't want to expose this internal detail.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=94dc92ab9e5285d708665dacf761bc7a6d23bf07
---
modules/video_output/opengl/vout_helper.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index de17819257..914834a8e4 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -534,10 +534,17 @@ opengl_deinit_program(vout_display_opengl_t *vgl, struct prgm *prgm)
static int
opengl_init_program(vout_display_opengl_t *vgl, vlc_video_context *context,
- struct prgm *prgm, const char *glexts,
- const video_format_t *fmt, bool subpics,
+ struct prgm *prgm, const video_format_t *fmt, bool subpics,
bool b_dump_shaders)
{
+ const char *glexts = (const char *) vgl->vt.GetString(GL_EXTENSIONS);
+ assert(glexts);
+ if (!glexts)
+ {
+ msg_Err(vgl->gl, "glGetString returned NULL");
+ return VLC_EGENERIC;
+ }
+
opengl_tex_converter_t *tc = calloc(1, sizeof(*tc));
if (tc == NULL)
return VLC_ENOMEM;
@@ -839,7 +846,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
GL_ASSERT_NOERROR();
int ret;
- ret = opengl_init_program(vgl, context, vgl->prgm, extensions, fmt, false,
+ ret = opengl_init_program(vgl, context, vgl->prgm, fmt, false,
b_dump_shaders);
if (ret != VLC_SUCCESS)
{
@@ -850,7 +857,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
}
GL_ASSERT_NOERROR();
- ret = opengl_init_program(vgl, context, vgl->sub_prgm, extensions, fmt, true,
+ ret = opengl_init_program(vgl, context, vgl->sub_prgm, fmt, true,
b_dump_shaders);
if (ret != VLC_SUCCESS)
{
More information about the vlc-commits
mailing list