From b2a2cf492decf35e1e2c622e3c45e98333ec15d7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 8 Nov 2019 13:39:09 -0800 Subject: [PATCH] softpipe: Refactor pipe_get/put_tile_rgba_* paths. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Part-of: --- src/gallium/auxiliary/util/u_debug_image.c | 1 + src/gallium/auxiliary/util/u_tests.c | 2 +- src/gallium/auxiliary/util/u_tile.c | 335 +++++------------- src/gallium/auxiliary/util/u_tile.h | 48 +-- .../drivers/softpipe/sp_tex_tile_cache.c | 33 +- src/gallium/drivers/softpipe/sp_tile_cache.c | 104 ++---- src/mesa/state_tracker/st_cb_texture.c | 10 +- 7 files changed, 136 insertions(+), 397 deletions(-) diff --git a/src/gallium/auxiliary/util/u_debug_image.c b/src/gallium/auxiliary/util/u_debug_image.c index 9eb5e1836b3..550fc86ce81 100644 --- a/src/gallium/auxiliary/util/u_debug_image.c +++ b/src/gallium/auxiliary/util/u_debug_image.c @@ -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, diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c index efd290f89b4..9751d9bcd6f 100644 --- a/src/gallium/auxiliary/util/u_tests.c +++ b/src/gallium/auxiliary/util/u_tests.c @@ -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++) { diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index ed76a7ef83d..ca2ccb0b9a8 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -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); } diff --git a/src/gallium/auxiliary/util/u_tile.h b/src/gallium/auxiliary/util/u_tile.h index d042a6018ac..3dc087d5efb 100644 --- a/src/gallium/auxiliary/util/u_tile.h +++ b/src/gallium/auxiliary/util/u_tile.h @@ -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 } diff --git a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c index 29801e7638e..18b0331bcea 100644 --- a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c @@ -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; } diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c index f3637538269..7617add03f6 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tile_cache.c @@ -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); } } } diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 3eb4ef62df3..88951f5059d 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -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 -- 2.30.2