summaryrefslogtreecommitdiff
path: root/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-12-22 00:32:33 +0100
committerMarek Olšák <maraeo@gmail.com>2010-12-23 16:54:58 +0100
commiteb31837a0d4fa4fe115bb288ddb37cbedea954ae (patch)
treede384dba7f46628e6a9d24900ce3c030b7067989 /src/mesa/main/texstore.c
parentbae9d511f343c7bd5eb66d1d1d18d32b47e738e3 (diff)
mesa: implement new texture format A16
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r--src/mesa/main/texstore.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index f9ab946902..107fbf1951 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -2357,21 +2357,21 @@ _mesa_texstore_unorm1616(TEXSTORE_PARAMS)
}
+/* Texstore for R16, A16. */
static GLboolean
-_mesa_texstore_r16(TEXSTORE_PARAMS)
+_mesa_texstore_unorm16(TEXSTORE_PARAMS)
{
const GLboolean littleEndian = _mesa_little_endian();
const GLuint texelBytes = _mesa_get_format_bytes(dstFormat);
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
- ASSERT(dstFormat == MESA_FORMAT_R16);
+ ASSERT(dstFormat == MESA_FORMAT_R16 ||
+ dstFormat == MESA_FORMAT_A16);
ASSERT(texelBytes == 2);
if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_R16 &&
- baseInternalFormat == GL_RED &&
- srcFormat == GL_RED &&
+ baseInternalFormat == srcFormat &&
srcType == GL_UNSIGNED_SHORT &&
littleEndian) {
/* simple memcpy path */
@@ -4048,6 +4048,7 @@ texstore_funcs[MESA_FORMAT_COUNT] =
{ MESA_FORMAT_AL1616_REV, _mesa_texstore_unorm1616 },
{ MESA_FORMAT_RGB332, _mesa_texstore_rgb332 },
{ MESA_FORMAT_A8, _mesa_texstore_a8 },
+ { MESA_FORMAT_A16, _mesa_texstore_unorm16 },
{ MESA_FORMAT_L8, _mesa_texstore_a8 },
{ MESA_FORMAT_I8, _mesa_texstore_a8 },
{ MESA_FORMAT_CI8, _mesa_texstore_ci8 },
@@ -4056,7 +4057,7 @@ texstore_funcs[MESA_FORMAT_COUNT] =
{ MESA_FORMAT_R8, _mesa_texstore_a8 },
{ MESA_FORMAT_RG88, _mesa_texstore_unorm88 },
{ MESA_FORMAT_RG88_REV, _mesa_texstore_unorm88 },
- { MESA_FORMAT_R16, _mesa_texstore_r16 },
+ { MESA_FORMAT_R16, _mesa_texstore_unorm16 },
{ MESA_FORMAT_RG1616, _mesa_texstore_unorm1616 },
{ MESA_FORMAT_RG1616_REV, _mesa_texstore_unorm1616 },
{ MESA_FORMAT_ARGB2101010, _mesa_texstore_argb2101010 },