Fix OpenGL ES luminance formats (which aren't deprecated in GLES)

This commit is contained in:
rdb 2016-02-03 14:07:59 +01:00
parent 98a86bf43a
commit 30fc995a2d

View File

@ -8341,7 +8341,7 @@ get_external_image_format(Texture *tex) const {
#endif
case Texture::F_alpha:
#ifdef SUPPORT_FIXED_FUNCTION
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
return GL_ALPHA;
#else
return GL_RED;
@ -8386,7 +8386,7 @@ get_external_image_format(Texture *tex) const {
case Texture::F_luminance:
case Texture::F_sluminance:
#ifdef SUPPORT_FIXED_FUNCTION
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
return GL_LUMINANCE;
#else
return GL_RED;
@ -8394,7 +8394,7 @@ get_external_image_format(Texture *tex) const {
case Texture::F_luminance_alphamask:
case Texture::F_luminance_alpha:
case Texture::F_sluminance_alpha:
#ifdef SUPPORT_FIXED_FUNCTION
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
return GL_LUMINANCE_ALPHA;
#else
return GL_RG;
@ -8967,14 +8967,14 @@ get_internal_image_format(Texture *tex, bool force_sized) const {
#endif
case Texture::F_alpha:
#ifdef SUPPORT_FIXED_FUNCTION
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
return force_sized ? GL_ALPHA8 : GL_ALPHA;
#else
return force_sized ? GL_R8 : GL_RED;
#endif
case Texture::F_luminance:
#ifdef SUPPORT_FIXED_FUNCTION
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
#ifndef OPENGLES
if (tex->get_component_type() == Texture::T_float) {
return GL_LUMINANCE16F_ARB;
@ -8992,7 +8992,7 @@ get_internal_image_format(Texture *tex, bool force_sized) const {
#endif
case Texture::F_luminance_alpha:
case Texture::F_luminance_alphamask:
#ifdef SUPPORT_FIXED_FUNCTION
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
#ifndef OPENGLES
if (tex->get_component_type() == Texture::T_float || tex->get_component_type() == Texture::T_unsigned_short) {
return GL_LUMINANCE_ALPHA16F_ARB;
@ -11531,7 +11531,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) {
}
#endif
#if !defined(SUPPORT_FIXED_FUNCTION) && !defined(OPENGLES_2)
#if !defined(SUPPORT_FIXED_FUNCTION) && !defined(OPENGLES)
// Do we need to apply a swizzle mask to emulate these deprecated
// texture formats?
switch (tex->get_format()) {