softpipe: Refactor pipe_get/put_tile_rgba_* paths.
authorEric Anholt <eric@anholt.net>
Fri, 8 Nov 2019 21:39:09 +0000 (13:39 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 4 Feb 2020 19:02:59 +0000 (19:02 +0000)
We always want the same behavior of choosing which unpack to do to
generate our 4x32-bit RGBA values, so just sink that choice down below
the pipe_get/put_tile API.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2744>

src/gallium/auxiliary/util/u_debug_image.c
src/gallium/auxiliary/util/u_tests.c
src/gallium/auxiliary/util/u_tile.c
src/gallium/auxiliary/util/u_tile.h
src/gallium/drivers/softpipe/sp_tex_tile_cache.c
src/gallium/drivers/softpipe/sp_tile_cache.c
src/mesa/state_tracker/st_cb_texture.c

index 9eb5e1836b3d309a4877f32c0fea246576aacae0..550fc86ce81c7e448be157d07c7c3e6aceb63c72 100644 (file)
@@ -220,6 +220,7 @@ debug_dump_transfer_bmp(UNUSED struct pipe_context *pipe,
 
    pipe_get_tile_rgba(transfer, ptr, 0, 0,
                       transfer->box.width, transfer->box.height,
+                      transfer->resource->format,
                       rgba);
 
    debug_dump_float_rgba_bmp(filename,
index efd290f89b45fd15ebb1daf2eae5d549b3ab52af..9751d9bcd6f0ef54aee5e6a9136b36d6e2a955c7 100644 (file)
@@ -229,7 +229,7 @@ util_probe_rect_rgba_multi(struct pipe_context *ctx, struct pipe_resource *tex,
 
    map = pipe_transfer_map(ctx, tex, 0, 0, PIPE_TRANSFER_READ,
                            offx, offy, w, h, &transfer);
-   pipe_get_tile_rgba(transfer, map, 0, 0, w, h, pixels);
+   pipe_get_tile_rgba(transfer, map, 0, 0, w, h, tex->format, pixels);
    pipe_transfer_unmap(ctx, transfer);
 
    for (e = 0; e < num_expected_colors; e++) {
index ed76a7ef83d2ef450fe71a71e4451c18765ac170..ca2ccb0b9a81c8a1002340e53797453bef3fe7ad 100644 (file)
@@ -354,134 +354,11 @@ x32_s8_get_tile_rgba(const unsigned *src,
    }
 }
 
-static void
-pipe_tile_raw_to_rgba(enum pipe_format format,
-                      const void *src,
-                      uint w, uint h,
-                      float *dst, unsigned dst_stride)
-{
-   switch (format) {
-   case PIPE_FORMAT_Z16_UNORM:
-      z16_get_tile_rgba((ushort *) src, w, h, dst, dst_stride);
-      break;
-   case PIPE_FORMAT_Z32_UNORM:
-      z32_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride);
-      break;
-   case PIPE_FORMAT_Z24_UNORM_S8_UINT:
-   case PIPE_FORMAT_Z24X8_UNORM:
-      s8z24_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride);
-      break;
-   case PIPE_FORMAT_S8_UINT:
-      s8_get_tile_rgba((unsigned char *) src, w, h, dst, dst_stride);
-      break;
-   case PIPE_FORMAT_X24S8_UINT:
-      s8x24_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride);
-      break;
-   case PIPE_FORMAT_S8_UINT_Z24_UNORM:
-   case PIPE_FORMAT_X8Z24_UNORM:
-      z24s8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride);
-      break;
-   case PIPE_FORMAT_S8X24_UINT:
-      x24s8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride);
-      break;
-   case PIPE_FORMAT_Z32_FLOAT:
-      z32f_get_tile_rgba((float *) src, w, h, dst, dst_stride);
-      break;
-   case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
-      z32f_x24s8_get_tile_rgba((float *) src, w, h, dst, dst_stride);
-      break;
-   case PIPE_FORMAT_X32_S8X24_UINT:
-      x32_s8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride);
-      break;
-   default:
-      util_format_read_4f(format,
-                          dst, dst_stride * sizeof(float),
-                          src, util_format_get_stride(format, w),
-                          0, 0, w, h);
-   }
-}
-
-static void
-pipe_tile_raw_to_unsigned(enum pipe_format format,
-                          const void *src,
-                          uint w, uint h,
-                          unsigned *dst, unsigned dst_stride)
-{
-  util_format_read_4ui(format,
-                       dst, dst_stride * sizeof(float),
-                       src, util_format_get_stride(format, w),
-                       0, 0, w, h);
-}
-
-static void
-pipe_tile_raw_to_signed(enum pipe_format format,
-                          void *src,
-                          uint w, uint h,
-                          int *dst, unsigned dst_stride)
-{
-  util_format_read_4i(format,
-                      dst, dst_stride * sizeof(float),
-                      src, util_format_get_stride(format, w),
-                      0, 0, w, h);
-}
-
-void
-pipe_get_tile_rgba(struct pipe_transfer *pt,
-                   const void *src,
-                   uint x, uint y, uint w, uint h,
-                   float *p)
-{
-   pipe_get_tile_rgba_format(pt, src, x, y, w, h, pt->resource->format, p);
-}
-
-
-void
-pipe_get_tile_rgba_format(struct pipe_transfer *pt,
-                          const void *src,
-                          uint x, uint y, uint w, uint h,
-                          enum pipe_format format,
-                          float *p)
-{
-   unsigned dst_stride = w * 4;
-   void *packed;
-
-   if (u_clip_tile(x, y, &w, &h, &pt->box)) {
-      return;
-   }
-
-   packed = MALLOC(util_format_get_nblocks(format, w, h) * util_format_get_blocksize(format));
-   if (!packed) {
-      return;
-   }
-
-   if (format == PIPE_FORMAT_UYVY || format == PIPE_FORMAT_YUYV) {
-      assert((x & 1) == 0);
-   }
-
-   pipe_get_tile_raw(pt, src, x, y, w, h, packed, 0);
-
-   pipe_tile_raw_to_rgba(format, packed, w, h, p, dst_stride);
-
-   FREE(packed);
-}
-
-
 void
 pipe_put_tile_rgba(struct pipe_transfer *pt,
                    void *dst,
                    uint x, uint y, uint w, uint h,
-                   const float *p)
-{
-   pipe_put_tile_rgba_format(pt, dst, x, y, w, h, pt->resource->format, p);
-}
-
-
-void
-pipe_put_tile_rgba_format(struct pipe_transfer *pt,
-                          void *dst,
-                          uint x, uint y, uint w, uint h,
-                          enum pipe_format format,
-                          const float *p)
+                   enum pipe_format format, const void *p)
 {
    unsigned src_stride = w * 4;
    void *packed;
@@ -493,62 +370,50 @@ pipe_put_tile_rgba_format(struct pipe_transfer *pt,
 
    if (!packed)
       return;
-
-   switch (format) {
-   case PIPE_FORMAT_Z16_UNORM:
-      /*z16_put_tile_rgba((ushort *) packed, w, h, p, src_stride);*/
-      break;
-   case PIPE_FORMAT_Z32_UNORM:
-      /*z32_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
-      break;
-   case PIPE_FORMAT_Z24_UNORM_S8_UINT:
-   case PIPE_FORMAT_Z24X8_UNORM:
-      /*s8z24_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
-      break;
-   case PIPE_FORMAT_S8_UINT_Z24_UNORM:
-   case PIPE_FORMAT_X8Z24_UNORM:
-      /*z24s8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
-      break;
-   case PIPE_FORMAT_Z32_FLOAT:
-      /*z32f_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
-      break;
-   case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
-      /*z32f_s8x24_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
-      break;
-   default:
-      util_format_write_4f(format,
+   /* softpipe's S8_UINT texture cache fetch needs to take the rgba_format
+    * path, not ui (since there's no ui unpack for s8, but it's technically
+    * pure integer).
+    */
+   if (util_format_is_pure_uint(format)) {
+      util_format_write_4ui(format,
+                            p, src_stride * sizeof(float),
+                            packed, util_format_get_stride(format, w),
+                            0, 0, w, h);
+   } else if (util_format_is_pure_sint(format)) {
+      util_format_write_4i(format,
                            p, src_stride * sizeof(float),
                            packed, util_format_get_stride(format, w),
                            0, 0, w, h);
+   } else {
+      switch (format) {
+      case PIPE_FORMAT_Z16_UNORM:
+         /*z16_put_tile_rgba((ushort *) packed, w, h, p, src_stride);*/
+         break;
+      case PIPE_FORMAT_Z32_UNORM:
+         /*z32_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
+         break;
+      case PIPE_FORMAT_Z24_UNORM_S8_UINT:
+      case PIPE_FORMAT_Z24X8_UNORM:
+         /*s8z24_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
+         break;
+      case PIPE_FORMAT_S8_UINT_Z24_UNORM:
+      case PIPE_FORMAT_X8Z24_UNORM:
+         /*z24s8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
+         break;
+      case PIPE_FORMAT_Z32_FLOAT:
+         /*z32f_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
+         break;
+      case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
+         /*z32f_s8x24_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
+         break;
+      default:
+         util_format_write_4f(format,
+                              p, src_stride * sizeof(float),
+                              packed, util_format_get_stride(format, w),
+                              0, 0, w, h);
+      }
    }
 
-   pipe_put_tile_raw(pt, dst, x, y, w, h, packed, 0);
-
-   FREE(packed);
-}
-
-void
-pipe_put_tile_i_format(struct pipe_transfer *pt,
-                       void *dst,
-                       uint x, uint y, uint w, uint h,
-                       enum pipe_format format,
-                       const int *p)
-{
-   unsigned src_stride = w * 4;
-   void *packed;
-
-   if (u_clip_tile(x, y, &w, &h, &pt->box))
-      return;
-
-   packed = MALLOC(util_format_get_nblocks(format, w, h) * util_format_get_blocksize(format));
-
-   if (!packed)
-      return;
-
-   util_format_write_4i(format,
-                        p, src_stride * sizeof(float),
-                        packed, util_format_get_stride(format, w),
-                        0, 0, w, h);
 
    pipe_put_tile_raw(pt, dst, x, y, w, h, packed, 0);
 
@@ -556,39 +421,11 @@ pipe_put_tile_i_format(struct pipe_transfer *pt,
 }
 
 void
-pipe_put_tile_ui_format(struct pipe_transfer *pt,
-                        void *dst,
-                        uint x, uint y, uint w, uint h,
-                        enum pipe_format format,
-                        const unsigned int *p)
-{
-   unsigned src_stride = w * 4;
-   void *packed;
-
-   if (u_clip_tile(x, y, &w, &h, &pt->box))
-      return;
-
-   packed = MALLOC(util_format_get_nblocks(format, w, h) * util_format_get_blocksize(format));
-
-   if (!packed)
-      return;
-
-   util_format_write_4ui(format,
-                         p, src_stride * sizeof(float),
-                         packed, util_format_get_stride(format, w),
-                         0, 0, w, h);
-
-   pipe_put_tile_raw(pt, dst, x, y, w, h, packed, 0);
-
-   FREE(packed);
-}
-
-void
-pipe_get_tile_ui_format(struct pipe_transfer *pt,
-                        const void *src,
-                        uint x, uint y, uint w, uint h,
-                        enum pipe_format format,
-                        unsigned int *p)
+pipe_get_tile_rgba(struct pipe_transfer *pt,
+                   const void *src,
+                   uint x, uint y, uint w, uint h,
+                   enum pipe_format format,
+                   void *dst)
 {
    unsigned dst_stride = w * 4;
    void *packed;
@@ -608,38 +445,58 @@ pipe_get_tile_ui_format(struct pipe_transfer *pt,
 
    pipe_get_tile_raw(pt, src, x, y, w, h, packed, 0);
 
-   pipe_tile_raw_to_unsigned(format, packed, w, h, p, dst_stride);
-
-   FREE(packed);
-}
-
-
-void
-pipe_get_tile_i_format(struct pipe_transfer *pt,
-                       const void *src,
-                       uint x, uint y, uint w, uint h,
-                       enum pipe_format format,
-                       int *p)
-{
-   unsigned dst_stride = w * 4;
-   void *packed;
-
-   if (u_clip_tile(x, y, &w, &h, &pt->box)) {
-      return;
-   }
-
-   packed = MALLOC(util_format_get_nblocks(format, w, h) * util_format_get_blocksize(format));
-   if (!packed) {
-      return;
-   }
-
-   if (format == PIPE_FORMAT_UYVY || format == PIPE_FORMAT_YUYV) {
-      assert((x & 1) == 0);
+   if (util_format_is_pure_uint(format) &&
+       !util_format_is_depth_or_stencil(format)) {
+      util_format_read_4ui(format,
+                           dst, dst_stride * sizeof(float),
+                           packed, util_format_get_stride(format, w),
+                           0, 0, w, h);
+   } else if (util_format_is_pure_sint(format)) {
+      util_format_read_4i(format,
+                          dst, dst_stride * sizeof(float),
+                          packed, util_format_get_stride(format, w),
+                          0, 0, w, h);
+   } else {
+      switch (format) {
+      case PIPE_FORMAT_Z16_UNORM:
+         z16_get_tile_rgba((ushort *) packed, w, h, dst, dst_stride);
+         break;
+      case PIPE_FORMAT_Z32_UNORM:
+         z32_get_tile_rgba((unsigned *) packed, w, h, dst, dst_stride);
+         break;
+      case PIPE_FORMAT_Z24_UNORM_S8_UINT:
+      case PIPE_FORMAT_Z24X8_UNORM:
+         s8z24_get_tile_rgba((unsigned *) packed, w, h, dst, dst_stride);
+         break;
+      case PIPE_FORMAT_S8_UINT:
+         s8_get_tile_rgba((unsigned char *) packed, w, h, dst, dst_stride);
+         break;
+      case PIPE_FORMAT_X24S8_UINT:
+         s8x24_get_tile_rgba((unsigned *) packed, w, h, dst, dst_stride);
+         break;
+      case PIPE_FORMAT_S8_UINT_Z24_UNORM:
+      case PIPE_FORMAT_X8Z24_UNORM:
+         z24s8_get_tile_rgba((unsigned *) packed, w, h, dst, dst_stride);
+         break;
+      case PIPE_FORMAT_S8X24_UINT:
+         x24s8_get_tile_rgba((unsigned *) packed, w, h, dst, dst_stride);
+         break;
+      case PIPE_FORMAT_Z32_FLOAT:
+         z32f_get_tile_rgba((float *) packed, w, h, dst, dst_stride);
+         break;
+      case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
+         z32f_x24s8_get_tile_rgba((float *) packed, w, h, dst, dst_stride);
+         break;
+      case PIPE_FORMAT_X32_S8X24_UINT:
+         x32_s8_get_tile_rgba((unsigned *) packed, w, h, dst, dst_stride);
+         break;
+      default:
+         util_format_read_4f(format,
+                             dst, dst_stride * sizeof(float),
+                             packed, util_format_get_stride(format, w),
+                             0, 0, w, h);
+      }
    }
 
-   pipe_get_tile_raw(pt, src, x, y, w, h, packed, 0);
-
-   pipe_tile_raw_to_signed(format, packed, w, h, p, dst_stride);
-
    FREE(packed);
 }
index d042a6018ac225c1dffb4008c33994dbd0dfb4eb..3dc087d5efbafcaf61efdee7ee02ff1356bf708e 100644 (file)
@@ -77,55 +77,15 @@ void
 pipe_get_tile_rgba(struct pipe_transfer *pt,
                    const void *src,
                    uint x, uint y, uint w, uint h,
-                   float *p);
-
-void
-pipe_get_tile_rgba_format(struct pipe_transfer *pt,
-                          const void *src,
-                          uint x, uint y, uint w, uint h,
-                          enum pipe_format format,
-                          float *p);
+                   enum pipe_format format,
+                   void *dst);
 
 void
 pipe_put_tile_rgba(struct pipe_transfer *pt,
                    void *dst,
                    uint x, uint y, uint w, uint h,
-                   const float *p);
-
-void
-pipe_put_tile_rgba_format(struct pipe_transfer *pt,
-                          void *dst,
-                          uint x, uint y, uint w, uint h,
-                          enum pipe_format format,
-                          const float *p);
-
-void
-pipe_get_tile_ui_format(struct pipe_transfer *pt,
-                        const void *src,
-                        uint x, uint y, uint w, uint h,
-                        enum pipe_format format,
-                        unsigned int *p);
-
-void
-pipe_get_tile_i_format(struct pipe_transfer *pt,
-                       const void *src,
-                       uint x, uint y, uint w, uint h,
-                       enum pipe_format format,
-                       int *p);
-
-void
-pipe_put_tile_ui_format(struct pipe_transfer *pt,
-                        void *dst,
-                        uint x, uint y, uint w, uint h,
-                        enum pipe_format format,
-                        const unsigned *p);
-
-void
-pipe_put_tile_i_format(struct pipe_transfer *pt,
-                       void *dst,
-                       uint x, uint y, uint w, uint h,
-                       enum pipe_format format,
-                       const int *p);
+                   enum pipe_format format,
+                   const void *src);
 
 #ifdef __cplusplus
 }
index 29801e7638e5e89a705b50f38891cc522d8735b0..18b0331bceaf56ee16af8fd62a2f2c14873d35ac 100644 (file)
@@ -205,7 +205,6 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc,
                         union tex_tile_address addr )
 {
    struct softpipe_tex_cached_tile *tile;
-   boolean zs = util_format_is_depth_or_stencil(tc->format);
 
    tile = tc->entries + tex_cache_pos( addr );
 
@@ -260,31 +259,13 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc,
       /* Get tile from the transfer (view into texture), explicitly passing
        * the image format.
        */
-      if (!zs && util_format_is_pure_uint(tc->format)) {
-         pipe_get_tile_ui_format(tc->tex_trans, tc->tex_trans_map,
-                                 addr.bits.x * TEX_TILE_SIZE,
-                                 addr.bits.y * TEX_TILE_SIZE,
-                                 TEX_TILE_SIZE,
-                                 TEX_TILE_SIZE,
-                                 tc->format,
-                                 (unsigned *) tile->data.colorui);
-      } else if (!zs && util_format_is_pure_sint(tc->format)) {
-         pipe_get_tile_i_format(tc->tex_trans, tc->tex_trans_map,
-                                addr.bits.x * TEX_TILE_SIZE,
-                                addr.bits.y * TEX_TILE_SIZE,
-                                TEX_TILE_SIZE,
-                                TEX_TILE_SIZE,
-                                tc->format,
-                                (int *) tile->data.colori);
-      } else {
-         pipe_get_tile_rgba_format(tc->tex_trans, tc->tex_trans_map,
-                                   addr.bits.x * TEX_TILE_SIZE,
-                                   addr.bits.y * TEX_TILE_SIZE,
-                                   TEX_TILE_SIZE,
-                                   TEX_TILE_SIZE,
-                                   tc->format,
-                                   (float *) tile->data.color);
-      }
+      pipe_get_tile_rgba(tc->tex_trans, tc->tex_trans_map,
+                         addr.bits.x * TEX_TILE_SIZE,
+                         addr.bits.y * TEX_TILE_SIZE,
+                         TEX_TILE_SIZE,
+                         TEX_TILE_SIZE,
+                         tc->format,
+                         (float *) tile->data.color);
       tile->addr = addr;
    }
 
index f3637538269f927a09eff023fa879e58b249cb1f..7617add03f657094310aa327cea0711dfd47bf17 100644 (file)
@@ -367,22 +367,10 @@ sp_tile_cache_flush_clear(struct softpipe_tile_cache *tc, int layer)
                                  tc->tile->data.any, 0/*STRIDE*/);
             }
             else {
-               if (util_format_is_pure_uint(tc->surface->format)) {
-                  pipe_put_tile_ui_format(pt, tc->transfer_map[layer],
-                                          x, y, TILE_SIZE, TILE_SIZE,
-                                          tc->surface->format,
-                                          (unsigned *) tc->tile->data.colorui128);
-               } else if (util_format_is_pure_sint(tc->surface->format)) {
-                  pipe_put_tile_i_format(pt, tc->transfer_map[layer],
-                                         x, y, TILE_SIZE, TILE_SIZE,
-                                         tc->surface->format,
-                                         (int *) tc->tile->data.colori128);
-               } else {
-                  pipe_put_tile_rgba_format(pt, tc->transfer_map[layer],
-                                            x, y, TILE_SIZE, TILE_SIZE,
-                                            tc->surface->format,
-                                            (float *) tc->tile->data.color);
-               }
+               pipe_put_tile_rgba(pt, tc->transfer_map[layer],
+                                  x, y, TILE_SIZE, TILE_SIZE,
+                                  tc->surface->format,
+                                  tc->tile->data.color);
             }
             numCleared++;
          }
@@ -408,28 +396,12 @@ sp_flush_tile(struct softpipe_tile_cache* tc, unsigned pos)
                            tc->entries[pos]->data.depth32, 0/*STRIDE*/);
       }
       else {
-         if (util_format_is_pure_uint(tc->surface->format)) {
-            pipe_put_tile_ui_format(tc->transfer[layer], tc->transfer_map[layer],
-                                    tc->tile_addrs[pos].bits.x * TILE_SIZE,
-                                    tc->tile_addrs[pos].bits.y * TILE_SIZE,
-                                    TILE_SIZE, TILE_SIZE,
-                                    tc->surface->format,
-                                    (unsigned *) tc->entries[pos]->data.colorui128);
-         } else if (util_format_is_pure_sint(tc->surface->format)) {
-            pipe_put_tile_i_format(tc->transfer[layer], tc->transfer_map[layer],
-                                   tc->tile_addrs[pos].bits.x * TILE_SIZE,
-                                   tc->tile_addrs[pos].bits.y * TILE_SIZE,
-                                   TILE_SIZE, TILE_SIZE,
-                                   tc->surface->format,
-                                   (int *) tc->entries[pos]->data.colori128);
-         } else {
-            pipe_put_tile_rgba_format(tc->transfer[layer], tc->transfer_map[layer],
-                                      tc->tile_addrs[pos].bits.x * TILE_SIZE,
-                                      tc->tile_addrs[pos].bits.y * TILE_SIZE,
-                                      TILE_SIZE, TILE_SIZE,
-                                      tc->surface->format,
-                                      (float *) tc->entries[pos]->data.color);
-         }
+         pipe_put_tile_rgba(tc->transfer[layer], tc->transfer_map[layer],
+                            tc->tile_addrs[pos].bits.x * TILE_SIZE,
+                            tc->tile_addrs[pos].bits.y * TILE_SIZE,
+                            TILE_SIZE, TILE_SIZE,
+                            tc->surface->format,
+                            tc->entries[pos]->data.color);
       }
       tc->tile_addrs[pos].bits.invalid = 1;  /* mark as empty */
    }
@@ -538,28 +510,12 @@ sp_find_cached_tile(struct softpipe_tile_cache *tc,
                               tile->data.depth32, 0/*STRIDE*/);
          }
          else {
-            if (util_format_is_pure_uint(tc->surface->format)) {
-               pipe_put_tile_ui_format(tc->transfer[layer], tc->transfer_map[layer],
-                                      tc->tile_addrs[pos].bits.x * TILE_SIZE,
-                                      tc->tile_addrs[pos].bits.y * TILE_SIZE,
-                                      TILE_SIZE, TILE_SIZE,
-                                      tc->surface->format,
-                                      (unsigned *) tile->data.colorui128);
-            } else if (util_format_is_pure_sint(tc->surface->format)) {
-               pipe_put_tile_i_format(tc->transfer[layer], tc->transfer_map[layer],
-                                      tc->tile_addrs[pos].bits.x * TILE_SIZE,
-                                      tc->tile_addrs[pos].bits.y * TILE_SIZE,
-                                      TILE_SIZE, TILE_SIZE,
-                                      tc->surface->format,
-                                      (int *) tile->data.colori128);
-            } else {
-               pipe_put_tile_rgba_format(tc->transfer[layer], tc->transfer_map[layer],
-                                         tc->tile_addrs[pos].bits.x * TILE_SIZE,
-                                         tc->tile_addrs[pos].bits.y * TILE_SIZE,
-                                         TILE_SIZE, TILE_SIZE,
-                                         tc->surface->format,
-                                         (float *) tile->data.color);
-            }
+            pipe_put_tile_rgba(tc->transfer[layer], tc->transfer_map[layer],
+                               tc->tile_addrs[pos].bits.x * TILE_SIZE,
+                               tc->tile_addrs[pos].bits.y * TILE_SIZE,
+                               TILE_SIZE, TILE_SIZE,
+                               tc->surface->format,
+                               tile->data.color);
          }
       }
 
@@ -589,28 +545,12 @@ sp_find_cached_tile(struct softpipe_tile_cache *tc,
                               tile->data.depth32, 0/*STRIDE*/);
          }
          else {
-            if (util_format_is_pure_uint(tc->surface->format)) {
-               pipe_get_tile_ui_format(tc->transfer[layer], tc->transfer_map[layer],
-                                         tc->tile_addrs[pos].bits.x * TILE_SIZE,
-                                         tc->tile_addrs[pos].bits.y * TILE_SIZE,
-                                         TILE_SIZE, TILE_SIZE,
-                                         tc->surface->format,
-                                         (unsigned *) tile->data.colorui128);
-            } else if (util_format_is_pure_sint(tc->surface->format)) {
-               pipe_get_tile_i_format(tc->transfer[layer], tc->transfer_map[layer],
-                                         tc->tile_addrs[pos].bits.x * TILE_SIZE,
-                                         tc->tile_addrs[pos].bits.y * TILE_SIZE,
-                                         TILE_SIZE, TILE_SIZE,
-                                         tc->surface->format,
-                                         (int *) tile->data.colori128);
-            } else {
-               pipe_get_tile_rgba_format(tc->transfer[layer], tc->transfer_map[layer],
-                                         tc->tile_addrs[pos].bits.x * TILE_SIZE,
-                                         tc->tile_addrs[pos].bits.y * TILE_SIZE,
-                                         TILE_SIZE, TILE_SIZE,
-                                         tc->surface->format,
-                                         (float *) tile->data.color);
-            }
+            pipe_get_tile_rgba(tc->transfer[layer], tc->transfer_map[layer],
+                               tc->tile_addrs[pos].bits.x * TILE_SIZE,
+                               tc->tile_addrs[pos].bits.y * TILE_SIZE,
+                               TILE_SIZE, TILE_SIZE,
+                               tc->surface->format,
+                               tile->data.color);
          }
       }
    }
index 3eb4ef62df3afac1a30c17d44f0d6f05ae87ffe5..88951f5059d70cb2d3ccbf8acdb9bf9cf3e6c2ca 100644 (file)
@@ -2235,8 +2235,8 @@ st_GetTexSubImage(struct gl_context * ctx,
                                           slice, 0, 0);
 
          /* get float[4] rgba row from surface */
-         pipe_get_tile_rgba_format(tex_xfer, map, 0, 0, width, height,
-                                   dst_format, rgba);
+         pipe_get_tile_rgba(tex_xfer, map, 0, 0, width, height, dst_format,
+                            rgba);
 
          _mesa_format_convert(dest, dstMesaFormat, dstStride,
                               rgba, RGBA32_FLOAT, srcStride,
@@ -2392,9 +2392,9 @@ fallback_copy_texsubimage(struct gl_context *ctx,
          /* XXX this usually involves a lot of int/float conversion.
           * try to avoid that someday.
           */
-         pipe_get_tile_rgba_format(src_trans, map, 0, 0, width, height,
-                                   util_format_linear(strb->texture->format),
-                                   tempSrc);
+         pipe_get_tile_rgba(src_trans, map, 0, 0, width, height,
+                            util_format_linear(strb->texture->format),
+                            tempSrc);
 
          /* Store into texture memory.
           * Note that this does some special things such as pixel transfer