r300: don't apply odd macroblock rounding to 3D textures

This is intended only for NPOT 2D textures.

Fixes: 0763fb947 ("r300: align macro-tiled stride-addressed textures in X")
(cherry picked from commit 648dfe88f4)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
This commit is contained in:
Pavel Ondračka 2026-03-27 10:42:42 +01:00 committed by Eric Engestrom
parent e06648d86a
commit 27fec03660
2 changed files with 4 additions and 2 deletions

View file

@ -684,7 +684,7 @@
"description": "r300: don't apply odd macroblock rounding to 3D textures",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "0763fb947a338c50eef69f5af6d9a20204ef4b1b",
"notes": null

View file

@ -140,7 +140,9 @@ static unsigned r300_texture_get_stride(struct r300_screen *screen,
/* NPOT textures use stride addressing (TX_PITCH_EN). Keep macro-tiled
* strides at an even number of macro tiles in X to prevent flakes. */
if (tex->tex.macrotile[level] && tex->tex.uses_stride_addressing) {
if (tex->b.target != PIPE_TEXTURE_3D &&
tex->tex.macrotile[level] &&
tex->tex.uses_stride_addressing) {
width = align(width, tile_width * 2);
}