[vlc-commits] opengl: enforce use of non-power-of-2-textures when drawing using Open GL ES 2, since those are supported by specification
Felix Paul Kühne
git at videolan.org
Mon Mar 4 18:31:05 CET 2013
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Mar 4 18:19:14 2013 +0100| [a7413eadafcc876d52f6836092f0914d4b09840a] | committer: Felix Paul Kühne
opengl: enforce use of non-power-of-2-textures when drawing using Open GL ES 2, since those are supported by specification
Hence, checks for extensions adding this feature will fail.
This solves a green line issue on Apple's ES2 platform
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a7413eadafcc876d52f6836092f0914d4b09840a
---
modules/video_output/opengl.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index a655494..f12008b 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -382,6 +382,14 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
vgl->supports_npot = HasExtension(extensions, "GL_ARB_texture_non_power_of_two") ||
HasExtension(extensions, "GL_APPLE_texture_2D_limited_npot");
+#if USE_OPENGL_ES
+ /* OpenGL ES 2 includes support for non-power of 2 textures by specification
+ * so checks for extensions are bound to fail. Check for OpenGL ES version instead. */
+ const unsigned char *ogl_version = glGetString(GL_VERSION);
+ if (strverscmp((const char *)ogl_version, "2.0") >= 0)
+ vgl->supports_npot = true;
+#endif
+
GLint max_texture_units = 0;
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &max_texture_units);
More information about the vlc-commits
mailing list