summaryrefslogtreecommitdiffstats
path: root/src/isl
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2016-01-22 08:32:00 -0800
committerChad Versace <[email protected]>2016-01-22 09:45:22 -0800
commitf9d4d0954992e367992fca3c017b5720cb213ded (patch)
treeba5b237b1ba1d5c7741ecce007c943a545a83c42 /src/isl
parent891ed5ca8c794dac3cffd7a91e8c3c7f2e02fc93 (diff)
isl: Fix isl_surf_get_image_offset_sa for gen4_3d layout
Bug found by unit test test_bdw_3d_r8g8b8a8_unorm_256x256x256_levels09_tiley0.
Diffstat (limited to 'src/isl')
-rw-r--r--src/isl/isl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/isl/isl.c b/src/isl/isl.c
index bb3d59576e0..40663ca18af 100644
--- a/src/isl/isl.c
+++ b/src/isl/isl.c
@@ -1200,10 +1200,9 @@ get_image_offset_sa_gen4_3d(const struct isl_surf *surf,
const uint32_t level_d = isl_align_npot(isl_minify(D0, level), image_align_sa.d);
const uint32_t max_layers_horiz = MIN(level_d, 1u << level);
- const uint32_t max_layers_vert = isl_align_div(level_d, 1u << level);
x += level_w * (logical_z_offset_px % max_layers_horiz);
- y += level_h * (logical_z_offset_px / max_layers_vert);
+ y += level_h * (logical_z_offset_px / max_layers_horiz);
*x_offset_sa = x;
*y_offset_sa = y;