]> git.tdb.fi Git - libs/gl.git/commitdiff
Remove sized L and LA pixel formats
authorMikko Rasa <tdb@tdb.fi>
Sun, 9 Feb 2020 21:48:45 +0000 (23:48 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 9 Feb 2020 21:48:45 +0000 (23:48 +0200)
These constants are not part of modern OpenGL and not supported on
OpenGL ES.  The unsized formats can still be used for uploading data
and will be translated to RED and RG for use as internal format.

source/pixelformat.cpp
source/pixelformat.h
source/texture.cpp

index 547a6a6970b4d69566b1a5552ca93a6a39c3fb47..dcc6b4eea70d7c38eb07020d53b9f4aa107a9242 100644 (file)
@@ -101,8 +101,6 @@ PixelFormat get_unsized_pixelformat(PixelFormat pf)
        case RGBA16F:
        case RGBA32F: return RGBA;
        case SRGB8_ALPHA8: return SRGB_ALPHA;
-       case LUMINANCE8: return LUMINANCE;
-       case LUMINANCE8_ALPHA8: return LUMINANCE_ALPHA;
        case DEPTH_COMPONENT16:
        case DEPTH_COMPONENT24:
        case DEPTH_COMPONENT32:
@@ -129,8 +127,6 @@ PixelFormat get_sized_pixelformat(PixelFormat pf, unsigned size)
                case RGBA: return RGBA8;
                case SRGB: return SRGB8;
                case SRGB_ALPHA: return SRGB8_ALPHA8;
-               case LUMINANCE: return LUMINANCE8;
-               case LUMINANCE_ALPHA: return LUMINANCE8_ALPHA8;
                default: throw invalid_argument("get_sized_pixelformat");
                }
        case 2:
@@ -222,8 +218,6 @@ unsigned get_component_size(PixelFormat pf)
        case RGBA8:
        case SRGB8:
        case SRGB8_ALPHA8:
-       case LUMINANCE8:
-       case LUMINANCE8_ALPHA8:
                return 1;
        case R16F:
        case RG16F:
index eca0b0e5833970f858f64e08e5c7061b0a9cd3e0..377335f25fd901900046cf703cf97b9b6ac865ab 100644 (file)
@@ -47,9 +47,7 @@ enum PixelFormat
        BGR             = GL_BGR,
        BGRA            = GL_BGRA,
        LUMINANCE       = GL_LUMINANCE,
-       LUMINANCE8      = GL_LUMINANCE8,
-       LUMINANCE_ALPHA    = GL_LUMINANCE_ALPHA,
-       LUMINANCE8_ALPHA8  = GL_LUMINANCE8_ALPHA8
+       LUMINANCE_ALPHA = GL_LUMINANCE_ALPHA
 };
 
 void operator>>(const LexicalConverter &, PixelFormat &);
index a7e4898c1edae7d73de8efe9bf425dbb69ccc569..1452cfbb44c3afe099a444cdb44d557015061051 100644 (file)
@@ -97,24 +97,24 @@ DataType Texture::get_alloc_type(PixelFormat fmt)
 
 void Texture::set_internal_format(PixelFormat fmt)
 {
-       if(!get_component_size(fmt) && OES_required_internalformat)
-               fmt = get_default_sized_pixelformat(fmt);
-
        FormatSwizzle swiz = NO_SWIZZLE;
        if(ARB_texture_rg && ARB_texture_swizzle)
        {
-               if(fmt==LUMINANCE8)
+               if(fmt==LUMINANCE)
                {
-                       fmt = R8;
+                       fmt = RED;
                        swiz = R_TO_LUMINANCE;
                }
-               else if(fmt==LUMINANCE8_ALPHA8)
+               else if(fmt==LUMINANCE_ALPHA)
                {
-                       fmt = RG8;
+                       fmt = RG;
                        swiz = RG_TO_LUMINANCE_ALPHA;
                }
        }
 
+       if(!get_component_size(fmt) && OES_required_internalformat)
+               fmt = get_default_sized_pixelformat(fmt);
+
        require_pixelformat(fmt);
        ifmt = fmt;
        swizzle = swiz;