mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
ac/surface: add ac_surface::is_displayable
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
c3f3685fd6
commit
5f2073be32
2 changed files with 13 additions and 0 deletions
|
|
@ -795,6 +795,9 @@ static int gfx6_compute_surface(ADDR_HANDLE addrlib,
|
||||||
surf->htile_size *= 2;
|
surf->htile_size *= 2;
|
||||||
|
|
||||||
surf->is_linear = surf->u.legacy.level[0].mode == RADEON_SURF_MODE_LINEAR_ALIGNED;
|
surf->is_linear = surf->u.legacy.level[0].mode == RADEON_SURF_MODE_LINEAR_ALIGNED;
|
||||||
|
surf->is_displayable = surf->is_linear ||
|
||||||
|
surf->micro_tile_mode == RADEON_MICRO_MODE_DISPLAY ||
|
||||||
|
surf->micro_tile_mode == RADEON_MICRO_MODE_ROTATED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1156,6 +1159,14 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib,
|
||||||
|
|
||||||
surf->is_linear = surf->u.gfx9.surf.swizzle_mode == ADDR_SW_LINEAR;
|
surf->is_linear = surf->u.gfx9.surf.swizzle_mode == ADDR_SW_LINEAR;
|
||||||
|
|
||||||
|
/* Query whether the surface is displayable. */
|
||||||
|
bool displayable = false;
|
||||||
|
r = Addr2IsValidDisplaySwizzleMode(addrlib, surf->u.gfx9.surf.swizzle_mode,
|
||||||
|
surf->bpe * 8, &displayable);
|
||||||
|
if (r)
|
||||||
|
return r;
|
||||||
|
surf->is_displayable = displayable;
|
||||||
|
|
||||||
switch (surf->u.gfx9.surf.swizzle_mode) {
|
switch (surf->u.gfx9.surf.swizzle_mode) {
|
||||||
/* S = standard. */
|
/* S = standard. */
|
||||||
case ADDR_SW_256B_S:
|
case ADDR_SW_256B_S:
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,8 @@ struct radeon_surf {
|
||||||
unsigned num_dcc_levels:4;
|
unsigned num_dcc_levels:4;
|
||||||
unsigned is_linear:1;
|
unsigned is_linear:1;
|
||||||
unsigned has_stencil:1;
|
unsigned has_stencil:1;
|
||||||
|
/* This might be true even if micro_tile_mode isn't displayable or rotated. */
|
||||||
|
unsigned is_displayable:1;
|
||||||
/* Displayable, thin, depth, rotated. AKA D,S,Z,R swizzle modes. */
|
/* Displayable, thin, depth, rotated. AKA D,S,Z,R swizzle modes. */
|
||||||
unsigned micro_tile_mode:3;
|
unsigned micro_tile_mode:3;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue