mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 11:00:11 +01:00
amd/common: Handle alignment of 96-bit formats.
addrlib doesn't quite do it right, so do it ourselves. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2162 CC: <mesa-stable@lists.freedesktop.org> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
b0203b561c
commit
88f567b5ce
1 changed files with 11 additions and 0 deletions
|
|
@ -206,6 +206,17 @@ static int gfx6_compute_level(ADDR_HANDLE addrlib,
|
|||
AddrSurfInfoIn->width = align(AddrSurfInfoIn->width, alignment);
|
||||
}
|
||||
|
||||
/* addrlib assumes the bytes/pixel is a divisor of 64, which is not
|
||||
* true for r32g32b32 formats. */
|
||||
if (AddrSurfInfoIn->bpp == 96) {
|
||||
assert(config->info.levels == 1);
|
||||
assert(AddrSurfInfoIn->tileMode == ADDR_TM_LINEAR_ALIGNED);
|
||||
|
||||
/* The least common multiple of 64 bytes and 12 bytes/pixel is
|
||||
* 192 bytes, or 16 pixels. */
|
||||
AddrSurfInfoIn->width = align(AddrSurfInfoIn->width, 16);
|
||||
}
|
||||
|
||||
if (config->is_3d)
|
||||
AddrSurfInfoIn->numSlices = u_minify(config->info.depth, level);
|
||||
else if (config->is_cube)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue