comparison libvo/gl_common.c @ 36178:927dedf22dde

Support 16-bit YUV on OpenGL ES.
author reimar
date Thu, 16 May 2013 19:20:31 +0000
parents 4fc911fa5366
children 16e7d4a1ee59
comparison
equal deleted inserted replaced
36177:00a9c3937ea1 36178:927dedf22dde
593 else if (strstr(allexts, "NV_float_buffer")) 593 else if (strstr(allexts, "NV_float_buffer"))
594 hqtexfmt = GL_FLOAT_RGB32_NV; 594 hqtexfmt = GL_FLOAT_RGB32_NV;
595 else 595 else
596 hqtexfmt = GL_RGB16; 596 hqtexfmt = GL_RGB16;
597 use_depth_l16 = !!strstr(allexts, "GL_EXT_shadow") || 597 use_depth_l16 = !!strstr(allexts, "GL_EXT_shadow") ||
598 !!strstr(allexts, "GL_ARB_shadow"); 598 !!strstr(allexts, "GL_ARB_shadow") ||
599 !!strstr(allexts, "GL_OES_depth_texture");
599 free(allexts); 600 free(allexts);
600 } 601 }
601 602
602 /** 603 /**
603 * \brief create a texture and set some defaults 604 * \brief create a texture and set some defaults
633 mpglTexImage2D(target, 0, fmt, w, h, 0, format, type, init); 634 mpglTexImage2D(target, 0, fmt, w, h, 0, format, type, init);
634 if (format == GL_LUMINANCE && type == GL_UNSIGNED_SHORT) { 635 if (format == GL_LUMINANCE && type == GL_UNSIGNED_SHORT) {
635 // ensure we get enough bits 636 // ensure we get enough bits
636 GLint bits = 0; 637 GLint bits = 0;
637 mpglGetTexLevelParameteriv(target, 0, GL_TEXTURE_LUMINANCE_SIZE, &bits); 638 mpglGetTexLevelParameteriv(target, 0, GL_TEXTURE_LUMINANCE_SIZE, &bits);
638 if (bits > 0 && bits < 14 && (use_depth_l16 || HAVE_BIGENDIAN)) { 639 if (bits >= 0 && bits < 14 && (use_depth_l16 || HAVE_BIGENDIAN)) {
639 fmt = GL_DEPTH_COMPONENT16; 640 fmt = GL_DEPTH_COMPONENT;
640 format = GL_DEPTH_COMPONENT; 641 format = GL_DEPTH_COMPONENT;
641 if (!use_depth_l16) { 642 if (!use_depth_l16) {
642 // if we cannot get 16 bit anyway, we can fall back 643 // if we cannot get 16 bit anyway, we can fall back
643 // to L8A8 on big-endian, which is at least faster... 644 // to L8A8 on big-endian, which is at least faster...
644 fmt = format = GL_LUMINANCE_ALPHA; 645 fmt = format = GL_LUMINANCE_ALPHA;