}
uint32_t
-fd6_tex_swiz(struct pipe_resource *prsc, unsigned swizzle_r, unsigned swizzle_g,
- unsigned swizzle_b, unsigned swizzle_a)
+fd6_tex_swiz(struct pipe_resource *prsc, enum pipe_format format,
+ unsigned swizzle_r, unsigned swizzle_g,
+ unsigned swizzle_b, unsigned swizzle_a)
{
const struct util_format_description *desc =
- util_format_description(prsc->format);
+ util_format_description(format);
unsigned char swiz[4] = {
swizzle_r, swizzle_g, swizzle_b, swizzle_a,
}, rswiz[4], *swizp;
/* for tiled modes, we don't get SWAP, so manually apply that
* extra step of swizzle:
*/
- enum a3xx_color_swap swap = fd6_pipe2swap(prsc->format);
+ enum a3xx_color_swap swap = fd6_pipe2swap(format);
unsigned char swapswiz[][4] = {
[WZYX] = { 0, 1, 2, 3 },
[WXYZ] = { 2, 1, 0, 3 },
enum a6xx_depth_format fd6_pipe2depth(enum pipe_format format);
enum a6xx_tex_swiz fd6_pipe2swiz(unsigned swiz);
-uint32_t fd6_tex_swiz(struct pipe_resource *prsc, unsigned swizzle_r,
- unsigned swizzle_g, unsigned swizzle_b, unsigned swizzle_a);
+uint32_t fd6_tex_swiz(struct pipe_resource *prsc, enum pipe_format format,
+ unsigned swizzle_r,
+ unsigned swizzle_g, unsigned swizzle_b, unsigned swizzle_a);
static inline enum a6xx_2d_ifmt
fd6_ifmt(enum a6xx_color_fmt fmt)
OUT_RING(ring, CP_LOAD_STATE6_2_EXT_SRC_ADDR_HI(0));
OUT_RING(ring, A6XX_TEX_CONST_0_FMT(img->fmt) |
- fd6_tex_swiz(img->prsc, PIPE_SWIZZLE_X, PIPE_SWIZZLE_Y,
+ fd6_tex_swiz(img->prsc, img->fmt, PIPE_SWIZZLE_X, PIPE_SWIZZLE_Y,
PIPE_SWIZZLE_Z, PIPE_SWIZZLE_W) |
COND(img->srgb, A6XX_TEX_CONST_0_SRGB));
OUT_RING(ring, A6XX_TEX_CONST_1_WIDTH(img->width) |
so->texconst0 =
A6XX_TEX_CONST_0_FMT(fd6_pipe2tex(format)) |
A6XX_TEX_CONST_0_SAMPLES(fd_msaa_samples(prsc->nr_samples)) |
- fd6_tex_swiz(prsc, cso->swizzle_r, cso->swizzle_g,
+ fd6_tex_swiz(prsc, cso->format, cso->swizzle_r, cso->swizzle_g,
cso->swizzle_b, cso->swizzle_a);
/* NOTE: since we sample z24s8 using 8888_UINT format, the swizzle