mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 13:20:14 +01:00
ac/surface: fix hybrid graphics where APU=GFX9, dGPU=older
v2: don't do it for compressed textures (bpp = 0) Cc: 17.2 <mesa-stable@lists.freedesktop.org> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1) Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
This commit is contained in:
parent
ed2b3f5c81
commit
5e81df0f10
1 changed files with 12 additions and 0 deletions
|
|
@ -257,6 +257,18 @@ static int gfx6_compute_level(ADDR_HANDLE addrlib,
|
||||||
AddrSurfInfoIn->width = u_minify(config->info.width, level);
|
AddrSurfInfoIn->width = u_minify(config->info.width, level);
|
||||||
AddrSurfInfoIn->height = u_minify(config->info.height, level);
|
AddrSurfInfoIn->height = u_minify(config->info.height, level);
|
||||||
|
|
||||||
|
/* Make GFX6 linear surfaces compatible with GFX9 for hybrid graphics,
|
||||||
|
* because GFX9 needs linear alignment of 256 bytes.
|
||||||
|
*/
|
||||||
|
if (config->info.levels == 1 &&
|
||||||
|
AddrSurfInfoIn->tileMode == ADDR_TM_LINEAR_ALIGNED &&
|
||||||
|
AddrSurfInfoIn->bpp) {
|
||||||
|
unsigned alignment = 256 / (AddrSurfInfoIn->bpp / 8);
|
||||||
|
|
||||||
|
assert(util_is_power_of_two(AddrSurfInfoIn->bpp));
|
||||||
|
AddrSurfInfoIn->width = align(AddrSurfInfoIn->width, alignment);
|
||||||
|
}
|
||||||
|
|
||||||
if (config->is_3d)
|
if (config->is_3d)
|
||||||
AddrSurfInfoIn->numSlices = u_minify(config->info.depth, level);
|
AddrSurfInfoIn->numSlices = u_minify(config->info.depth, level);
|
||||||
else if (config->is_cube)
|
else if (config->is_cube)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue