aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/formats.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-09 22:56:02 +0100
committermarha <marha@users.sourceforge.net>2014-03-09 22:56:02 +0100
commit2112b7dec49833ba872bd3ebcd7288930fec0796 (patch)
tree407c80c9a70f590af2d4c3e5c14678827e189331 /mesalib/src/mesa/main/formats.c
parent8badbdef38ce843dc443ddee219eda4040ef2cd5 (diff)
parent3dd4b6420f686b0147d5b8136268cc63196e253b (diff)
downloadvcxsrv-2112b7dec49833ba872bd3ebcd7288930fec0796.tar.gz
vcxsrv-2112b7dec49833ba872bd3ebcd7288930fec0796.tar.bz2
vcxsrv-2112b7dec49833ba872bd3ebcd7288930fec0796.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig mesa xserver git update 9 Mar 2014 Conflicts: mesalib/src/mapi/glapi/glapi.h xorg-server/hw/kdrive/ephyr/hostx.c
Diffstat (limited to 'mesalib/src/mesa/main/formats.c')
-rw-r--r--mesalib/src/mesa/main/formats.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/formats.c b/mesalib/src/mesa/main/formats.c
index f6c399ede..0cf97fa31 100644
--- a/mesalib/src/mesa/main/formats.c
+++ b/mesalib/src/mesa/main/formats.c
@@ -520,6 +520,15 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4
},
{
+ MESA_FORMAT_R8G8B8A8_SRGB,
+ "MESA_FORMAT_R8G8B8A8_SRGB",
+ GL_RGBA,
+ GL_UNSIGNED_NORMALIZED,
+ 8, 8, 8, 8,
+ 0, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
MESA_FORMAT_L_SRGB8,
"MESA_FORMAT_L_SRGB8",
GL_LUMINANCE,
@@ -1790,6 +1799,15 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
0, 0, 0, 0, 0,
1, 1, 4
},
+ {
+ MESA_FORMAT_B8G8R8X8_SRGB,
+ "MESA_FORMAT_B8G8R8X8_SRGB",
+ GL_RGB,
+ GL_UNSIGNED_NORMALIZED,
+ 8, 8, 8, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 4
+ },
};
@@ -2025,6 +2043,7 @@ _mesa_get_format_color_encoding(mesa_format format)
case MESA_FORMAT_BGR_SRGB8:
case MESA_FORMAT_A8B8G8R8_SRGB:
case MESA_FORMAT_B8G8R8A8_SRGB:
+ case MESA_FORMAT_R8G8B8A8_SRGB:
case MESA_FORMAT_L_SRGB8:
case MESA_FORMAT_L8A8_SRGB:
case MESA_FORMAT_SRGB_DXT1:
@@ -2035,6 +2054,7 @@ _mesa_get_format_color_encoding(mesa_format format)
case MESA_FORMAT_ETC2_SRGB8:
case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC:
case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1:
+ case MESA_FORMAT_B8G8R8X8_SRGB:
return GL_SRGB;
default:
return GL_LINEAR;
@@ -2059,6 +2079,9 @@ _mesa_get_srgb_format_linear(mesa_format format)
case MESA_FORMAT_B8G8R8A8_SRGB:
format = MESA_FORMAT_B8G8R8A8_UNORM;
break;
+ case MESA_FORMAT_R8G8B8A8_SRGB:
+ format = MESA_FORMAT_R8G8B8A8_UNORM;
+ break;
case MESA_FORMAT_L_SRGB8:
format = MESA_FORMAT_L_UNORM8;
break;
@@ -2089,6 +2112,9 @@ _mesa_get_srgb_format_linear(mesa_format format)
case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1:
format = MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1;
break;
+ case MESA_FORMAT_B8G8R8X8_SRGB:
+ format = MESA_FORMAT_B8G8R8X8_UNORM;
+ break;
default:
break;
}
@@ -2563,6 +2589,7 @@ _mesa_format_to_type_and_comps(mesa_format format,
return;
case MESA_FORMAT_A8B8G8R8_SRGB:
case MESA_FORMAT_B8G8R8A8_SRGB:
+ case MESA_FORMAT_R8G8B8A8_SRGB:
*datatype = GL_UNSIGNED_BYTE;
*comps = 4;
return;
@@ -2895,6 +2922,11 @@ _mesa_format_to_type_and_comps(mesa_format format,
*comps = 2;
return;
+ case MESA_FORMAT_B8G8R8X8_SRGB:
+ *datatype = GL_UNSIGNED_BYTE;
+ *comps = 4;
+ return;
+
case MESA_FORMAT_COUNT:
assert(0);
return;
@@ -2967,6 +2999,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
return GL_FALSE;
case MESA_FORMAT_R8G8B8A8_UNORM:
+ case MESA_FORMAT_R8G8B8A8_SRGB:
if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
!swapBytes)
return GL_TRUE;
@@ -3448,6 +3481,9 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
case MESA_FORMAT_G16R16_SNORM:
return format == GL_RG && type == GL_SHORT && !littleEndian &&
!swapBytes;
+
+ case MESA_FORMAT_B8G8R8X8_SRGB:
+ return GL_FALSE;
}
return GL_FALSE;