EXT(EXT_texture_rectangle , NV_texture_rectangle , GLL, x , x , x , 2004)
EXT(EXT_texture_rg , ARB_texture_rg , x , x , x , ES2, 2011)
EXT(EXT_texture_sRGB , EXT_texture_sRGB , GLL, GLC, x , x , 2004)
+EXT(EXT_texture_sRGB_R8 , EXT_texture_sRGB_R8 , x , x , x , 30, 2015)
EXT(EXT_texture_sRGB_decode , EXT_texture_sRGB_decode , GLL, GLC, x , 30, 2006)
EXT(EXT_texture_shared_exponent , EXT_texture_shared_exponent , GLL, GLC, x , x , 2004)
EXT(EXT_texture_snorm , EXT_texture_snorm , GLL, GLC, x , x , 2009)
*comps = 4;
return;
case MESA_FORMAT_L_SRGB8:
+ case MESA_FORMAT_R_SRGB8:
*datatype = GL_UNSIGNED_BYTE;
*comps = 1;
return;
(type == GL_UNSIGNED_SHORT_8_8_REV_MESA && littleEndian != swapBytes));
case MESA_FORMAT_R_UNORM8:
+ case MESA_FORMAT_R_SRGB8:
return format == GL_RED && type == GL_UNSIGNED_BYTE;
case MESA_FORMAT_R8G8_UNORM:
return format == GL_RG && type == GL_UNSIGNED_BYTE && littleEndian;
MESA_FORMAT_A8L8_SRGB , packed, 1, 1, 1, un8 , un8 , , , yyyx, srgb
# Array sRGB formats
+MESA_FORMAT_R_SRGB8 , array , 1, 1, 1, un8 , , , , x001, srgb
MESA_FORMAT_L_SRGB8 , array , 1, 1, 1, un8 , , , , xxx1, srgb
MESA_FORMAT_BGR_SRGB8 , array , 1, 1, 1, un8 , un8 , un8 , , zyx1, srgb
MESA_FORMAT_X8B8G8R8_SRGB, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */
MESA_FORMAT_L8A8_SRGB, /* AAAA AAAA LLLL LLLL */
MESA_FORMAT_A8L8_SRGB, /* LLLL LLLL AAAA AAAA */
+ MESA_FORMAT_R_SRGB8, /* RRRR RRRR */
/* Array sRGB formats */
MESA_FORMAT_L_SRGB8, /* ubyte[i] = L */
}
}
+ if (ctx->Extensions.EXT_texture_sRGB_R8) {
+ switch (internalFormat) {
+ case GL_SR8_EXT:
+ return GL_RED;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
if (ctx->Version >= 30 ||
ctx->Extensions.EXT_texture_integer) {
switch (internalFormat) {
return GL_INVALID_OPERATION;
switch (type) {
case GL_UNSIGNED_BYTE:
- if (internalFormat != GL_R8)
- return GL_INVALID_OPERATION;
- break;
+ if (internalFormat == GL_R8 ||
+ ((internalFormat == GL_SR8_EXT) &&
+ ctx->Extensions.EXT_texture_sRGB_R8))
+ break;
+ return GL_INVALID_OPERATION;
case GL_BYTE:
if (internalFormat != GL_R8_SNORM)
#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837
#endif
+#ifndef GL_EXT_texture_sRGB_R8
+#define GL_SR8_EXT 0x8FBD
+#endif
/**
* Internal token to represent a GLSL shader program (a collection of
GLboolean EXT_texture_shared_exponent;
GLboolean EXT_texture_snorm;
GLboolean EXT_texture_sRGB;
+ GLboolean EXT_texture_sRGB_R8;
GLboolean EXT_texture_sRGB_decode;
GLboolean EXT_texture_swizzle;
GLboolean EXT_texture_type_2_10_10_10_REV;
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_SRGB);
RETURN_IF_SUPPORTED(MESA_FORMAT_A8R8G8B8_SRGB);
break;
+ case GL_SR8_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_R_SRGB8);
+ break;
case GL_SLUMINANCE_EXT:
case GL_SLUMINANCE8_EXT:
RETURN_IF_SUPPORTED(MESA_FORMAT_L_SRGB8);
FETCH_FUNCS(A8L8_SRGB),
/* Array sRGB formats */
+ FETCH_FUNCS(R_SRGB8),
FETCH_FUNCS(L_SRGB8),
FETCH_FUNCS(BGR_SRGB8),
FETCH_RGBA(R8G8B8A8_SRGB, GLuint, 1)
FETCH_RGBA(R8G8B8X8_SRGB, GLuint, 1)
FETCH_RGBA(X8B8G8R8_SRGB, GLuint, 1)
+FETCH_RGBA(R_SRGB8, GLubyte, 1)
FETCH_RGBA(L_SRGB8, GLubyte, 1)
FETCH_RGBA(L8A8_SRGB, GLushort, 1)
FETCH_RGBA(A8L8_SRGB, GLushort, 2)