We need to align the size of the slice, not the offset of the next slice.
Fixes KHR-GLES3.texture_repeat_mode.rgba32ui_11x131_2_clamp_to_edge.
Fixes: b4b4ada7616d ("broadcom/vc5: Fix layout of 3D textures.")
slice->padded_height = level_height;
slice->size = level_height * slice->stride;
- offset += slice->size * level_depth;
-
+ uint32_t slice_total_size = slice->size * level_depth;
/* The HW aligns level 1's base to a page if any of level 1 or
* below could be UIF XOR. The lower levels then inherit the
if (i == 1 &&
level_width > 4 * uif_block_w &&
level_height > PAGE_CACHE_MINUS_1_5_UB_ROWS * uif_block_h) {
- offset = align(offset, VC5_UIFCFG_PAGE_SIZE);
+ slice_total_size = align(slice_total_size,
+ VC5_UIFCFG_PAGE_SIZE);
}
+
+ offset += slice_total_size;
+
}
rsc->size = offset;