/* Linear levels of a tiled resource are always WZYX, so look at
* rsc->tile_mode to determine the swap.
*/
- sswap = src->layout.tile_mode ? WZYX : fd6_pipe2swap(info->src.format);
- dswap = dst->layout.tile_mode ? WZYX : fd6_pipe2swap(info->dst.format);
+ sswap = fd6_resource_swap(src, info->src.format);
+ dswap = fd6_resource_swap(dst, info->dst.format);
if (util_format_is_compressed(info->src.format)) {
debug_assert(info->src.format == info->dst.format);
return
A6XX_TEX_CONST_0_FMT(fd6_pipe2tex(format)) |
A6XX_TEX_CONST_0_SAMPLES(fd_msaa_samples(prsc->nr_samples)) |
- A6XX_TEX_CONST_0_SWAP(rsc->layout.tile_mode ? WZYX : fd6_pipe2swap(format)) |
+ A6XX_TEX_CONST_0_SWAP(fd6_resource_swap(rsc, format)) |
A6XX_TEX_CONST_0_TILE_MODE(fd_resource_tile_mode(prsc, level)) |
COND(util_format_is_srgb(format), A6XX_TEX_CONST_0_SRGB) |
A6XX_TEX_CONST_0_SWIZ_X(fd6_pipe2swiz(swiz[0])) |
return 0;
}
}
+
+static inline uint32_t
+fd6_resource_swap(struct fd_resource *rsc, enum pipe_format format)
+{
+ return rsc->layout.tile_mode ? WZYX : fd6_pipe2swap(format);
+}
+
#endif /* FD6_UTIL_H_ */
psurf->u.tex.first_layer);
stride = slice->pitch * rsc->layout.cpp * pfb->samples;
- swap = rsc->layout.tile_mode ? WZYX : fd6_pipe2swap(pformat);
+ swap = fd6_resource_swap(rsc, pformat);
tile_mode = fd_resource_tile_mode(psurf->texture, psurf->u.tex.level);
enum a6xx_color_fmt format = fd6_pipe2color(pfmt);
uint32_t stride = slice->pitch * rsc->layout.cpp;
uint32_t size = slice->size0;
- enum a3xx_color_swap swap = rsc->layout.tile_mode ? WZYX : fd6_pipe2swap(pfmt);
+ enum a3xx_color_swap swap = fd6_resource_swap(rsc, pfmt);
enum a3xx_msaa_samples samples =
fd_msaa_samples(rsc->base.nr_samples);
uint32_t tile_mode = fd_resource_tile_mode(&rsc->base, psurf->u.tex.level);