[vlc-commits] opengl: add a debug switch to display fragment shaders

Thomas Guillem git at videolan.org
Fri Nov 3 21:16:19 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Nov  3 21:09:32 2017 +0100| [b2f63c22f202917d8a2f96adb4e819834f622964] | committer: Thomas Guillem

opengl: add a debug switch to display fragment shaders

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

 modules/video_output/opengl/fragment_shaders.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c
index 941d95cf04..33bb8df5c9 100644
--- a/modules/video_output/opengl/fragment_shaders.c
+++ b/modules/video_output/opengl/fragment_shaders.c
@@ -56,6 +56,10 @@
 # define GL_TEXTURE_LUMINANCE_SIZE 0x8060
 #endif
 
+#if 0
+#define DUMP_SHADERS
+#endif
+
 static int GetTexFormatSize(opengl_tex_converter_t *tc, int target,
                             int tex_format, int tex_internal, int tex_type)
 {
@@ -699,6 +703,10 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
     GLint length = ms.length;
     tc->vt->ShaderSource(fragment_shader, 1, (const char **)&ms.ptr, &length);
     tc->vt->CompileShader(fragment_shader);
+#ifdef DUMP_SHADERS
+    fprintf(stderr, "\n=== Fragment shader for fourcc: %4.4s, colorspace: %d ===\n%s\n\n",
+            (const char *)&chroma, yuv_space, ms.ptr);
+#endif
     free(ms.ptr);
 
     tc->tex_target = tex_target;



More information about the vlc-commits mailing list