Mesa (master): mesa: more use of _mesa_format_matches_format_and_type() in texstore code

Brian Paul brianp at kemper.freedesktop.org
Sat Jan 28 01:25:37 UTC 2012


Module: Mesa
Branch: master
Commit: 453d4b40bc1dfd4fc1e48c25bda1d293f66597a1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=453d4b40bc1dfd4fc1e48c25bda1d293f66597a1

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Jan 26 20:01:13 2012 -0700

mesa: more use of _mesa_format_matches_format_and_type() in texstore code

For rgba5551, argb1555, argb2101010 formats.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/main/texstore.c |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 61c33cc..d25e410 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1788,11 +1788,9 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS)
    ASSERT(_mesa_get_format_bytes(dstFormat) == 2);
 
    if (!ctx->_ImageTransferState &&
-       !srcPacking->SwapBytes &&
-       dstFormat == MESA_FORMAT_RGBA5551 &&
        baseInternalFormat == GL_RGBA &&
-       srcFormat == GL_RGBA &&
-       srcType == GL_UNSIGNED_SHORT_5_5_5_1) {
+       _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+                                            srcPacking->SwapBytes)) {
       /* simple memcpy path */
       memcpy_texture(ctx, dims,
                      dstFormat,
@@ -1841,11 +1839,9 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS)
    ASSERT(_mesa_get_format_bytes(dstFormat) == 2);
 
    if (!ctx->_ImageTransferState &&
-       !srcPacking->SwapBytes &&
-       dstFormat == MESA_FORMAT_ARGB1555 &&
        baseInternalFormat == GL_RGBA &&
-       srcFormat == GL_BGRA &&
-       srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV) {
+       _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+                                            srcPacking->SwapBytes)) {
       /* simple memcpy path */
       memcpy_texture(ctx, dims,
                      dstFormat,
@@ -1905,11 +1901,9 @@ _mesa_texstore_argb2101010(TEXSTORE_PARAMS)
    ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
 
    if (!ctx->_ImageTransferState &&
-       !srcPacking->SwapBytes &&
-       dstFormat == MESA_FORMAT_ARGB2101010 &&
-       srcFormat == GL_BGRA &&
-       srcType == GL_UNSIGNED_INT_2_10_10_10_REV &&
-       baseInternalFormat == GL_RGBA) {
+       baseInternalFormat == GL_RGBA &&
+       _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+                                            srcPacking->SwapBytes)) {
       /* simple memcpy path */
       memcpy_texture(ctx, dims,
                      dstFormat,




More information about the mesa-commit mailing list