[vlc-devel] [PATCH v2 07/29] opengl: simplify opengl_init_program() call
Romain Vimont
rom1v at videolabs.io
Thu Feb 6 14:17:36 CET 2020
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.
---
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)
{
--
2.25.0
More information about the vlc-devel
mailing list