mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-25 01:30:30 +01:00
freedreno/a6xx: Add fd_resource_swap() helper
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2848>
This commit is contained in:
parent
e0ebaa819d
commit
1d7267fc91
4 changed files with 12 additions and 5 deletions
|
|
@ -390,8 +390,8 @@ emit_blit_or_clear_texture(struct fd_context *ctx, struct fd_ringbuffer *ring,
|
|||
/* 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);
|
||||
|
|
|
|||
|
|
@ -487,7 +487,7 @@ fd6_tex_const_0(struct pipe_resource *prsc,
|
|||
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])) |
|
||||
|
|
|
|||
|
|
@ -118,4 +118,11 @@ fd6_ifmt(enum a6xx_color_fmt fmt)
|
|||
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_ */
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ emit_mrt(struct fd_ringbuffer *ring, struct pipe_framebuffer_state *pfb,
|
|||
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);
|
||||
|
||||
|
|
@ -961,7 +961,7 @@ emit_blit(struct fd_batch *batch,
|
|||
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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue