[vlc-commits] opengl: remove RGB fallback

Thomas Guillem git at videolan.org
Fri Feb 3 15:05:55 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Feb  3 14:56:27 2017 +0100| [f1d46eec0a7999d9c7e9d00ad4e2d8cf8fb6a0f9] | committer: Thomas Guillem

opengl: remove RGB fallback

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

 modules/video_output/opengl/vout_helper.c | 37 +++++++++++++------------------
 1 file changed, 16 insertions(+), 21 deletions(-)

diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 0ae232e..2c8961a 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -560,29 +560,24 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
         return NULL;
     }
 
-    const video_format_t *fmts[2] = { fmt, &vgl->fmt };
-    for (size_t i = 0; i < 2 && fragment_shader == 0; ++i)
+    for (size_t j = 0; j < ARRAY_SIZE(opengl_tex_converter_init_cbs); ++j)
     {
-        /* Try first the untouched fmt, then the rgba fmt */
-        for (size_t j = 0; j < ARRAY_SIZE(opengl_tex_converter_init_cbs); ++j)
+        tex_conv = (opengl_tex_converter_t) {
+            .gl = vgl->gl,
+            .api = &vgl->api,
+            .glexts = extensions,
+            .orientation = fmt->orientation,
+        };
+        fragment_shader = opengl_tex_converter_init_cbs[j](fmt, &tex_conv);
+        if (fragment_shader != 0)
         {
-            tex_conv = (opengl_tex_converter_t) {
-                .gl = vgl->gl,
-                .api = &vgl->api,
-                .glexts = extensions,
-                .orientation = fmt->orientation,
-            };
-            fragment_shader = opengl_tex_converter_init_cbs[j](fmts[i], &tex_conv);
-            if (fragment_shader != 0)
-            {
-                assert(tex_conv.chroma != 0 && tex_conv.tex_target != 0 &&
-                       tex_conv.tex_count > 0 &&  tex_conv.pf_update != NULL &&
-                       tex_conv.pf_fetch_locations != NULL &&
-                       tex_conv.pf_prepare_shader != NULL);
-                vgl->fmt = *fmt;
-                vgl->fmt.i_chroma = tex_conv.chroma;
-                break;
-            }
+            assert(tex_conv.chroma != 0 && tex_conv.tex_target != 0 &&
+                   tex_conv.tex_count > 0 &&  tex_conv.pf_update != NULL &&
+                   tex_conv.pf_fetch_locations != NULL &&
+                   tex_conv.pf_prepare_shader != NULL);
+            vgl->fmt = *fmt;
+            vgl->fmt.i_chroma = tex_conv.chroma;
+            break;
         }
     }
     if (fragment_shader == 0)



More information about the vlc-commits mailing list