+ if(!get_component_size(fmt) && MSP_sized_internal_formats)
+ {
+ unsigned size = (fmt==DEPTH_COMPONENT ? get_gl_api()==OPENGL_ES2 ? 2 : 4 : 1);
+ fmt = get_sized_pixelformat(fmt, size);
+ }
+
+ FormatSwizzle swiz = NO_SWIZZLE;
+ if(ARB_texture_rg && ARB_texture_swizzle)
+ {
+ if(fmt==LUMINANCE8 || fmt==SLUMINANCE8)
+ {
+ fmt = R8;
+ swiz = R_TO_LUMINANCE;
+ }
+ else if(fmt==LUMINANCE8_ALPHA8 || fmt==SLUMINANCE8_ALPHA8)
+ {
+ fmt = RG8;
+ swiz = RG_TO_LUMINANCE_ALPHA;
+ }
+ }