diff options
author | Brian Paul <[email protected]> | 2012-01-26 20:01:12 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-01-27 18:21:45 -0700 |
commit | 94a0d38c240625202d21a7c4522ad8a1c9bc1a89 (patch) | |
tree | 9ca008b78d739d7206dca659700771129219acba /src | |
parent | 51aab798a3386cc1493fe879802f693ca1fa565e (diff) |
mesa: implement more cases in _mesa_format_matches_format_and_type()
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/formats.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index a52b38babe8..cecb70c01f2 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -2733,7 +2733,7 @@ _mesa_format_matches_format_and_type(gl_format gl_format, !swapBytes; case MESA_FORMAT_S8: - return GL_FALSE; + return format == GL_STENCIL_INDEX && type == GL_UNSIGNED_BYTE; case MESA_FORMAT_SRGB8: case MESA_FORMAT_SRGBA8: @@ -2859,8 +2859,26 @@ _mesa_format_matches_format_and_type(gl_format gl_format, case MESA_FORMAT_SIGNED_R8: case MESA_FORMAT_SIGNED_RG88_REV: case MESA_FORMAT_SIGNED_RGBX8888: + return GL_FALSE; + case MESA_FORMAT_SIGNED_RGBA8888: + if (format == GL_RGBA && type == GL_BYTE && !littleEndian) + return GL_TRUE; + + if (format == GL_ABGR_EXT && type == GL_BYTE && littleEndian) + return GL_TRUE; + + return GL_FALSE; + case MESA_FORMAT_SIGNED_RGBA8888_REV: + if (format == GL_RGBA && type == GL_BYTE && littleEndian) + return GL_TRUE; + + if (format == GL_ABGR_EXT && type == GL_BYTE && !littleEndian) + return GL_TRUE; + + return GL_FALSE; + case MESA_FORMAT_SIGNED_R16: case MESA_FORMAT_SIGNED_GR1616: case MESA_FORMAT_SIGNED_RGB_16: @@ -2896,7 +2914,9 @@ _mesa_format_matches_format_and_type(gl_format gl_format, return GL_FALSE; case MESA_FORMAT_ARGB2101010_UINT: - return GL_FALSE; + return (format == GL_BGRA_INTEGER_EXT && + type == GL_UNSIGNED_INT_2_10_10_10_REV && + !swapBytes); case MESA_FORMAT_RGB9_E5_FLOAT: return format == GL_RGB && type == GL_UNSIGNED_INT_5_9_9_9_REV && |