diff options
author | Jonathan Marek <[email protected]> | 2019-02-26 12:00:01 -0500 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2019-03-05 12:03:05 -0800 |
commit | 548893d5f54e8ff14db099012cff3450e81cd7ab (patch) | |
tree | 32ca9485d3624eaf9b033e18c482abef4b724267 | |
parent | 84effbe02c135c03e06689b95c5ffa49312476e9 (diff) |
freedreno: a2xx: fix mipmapping for NPOT textures
Fixes: 3a273a4a
Signed-off-by: Jonathan Marek <[email protected]>
(cherry picked from commit 6c0fefb448f0b72971c96a60907c77ce0512d590)
-rw-r--r-- | src/gallium/drivers/freedreno/a2xx/fd2_resource.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_resource.c b/src/gallium/drivers/freedreno/a2xx/fd2_resource.c index 1bd1f103ccd..2c813804689 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_resource.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_resource.c @@ -55,6 +55,12 @@ fd2_setup_slices(struct fd_resource *rsc) break; } + /* mipmaps have power of two sizes in memory */ + if (level) { + width = util_next_power_of_two(width); + height = util_next_power_of_two(height); + } + slice->pitch = width; slice->offset = size; |