nil: Fix image array layer alignments

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand
2023-01-30 20:11:50 -06:00
committed by Marge Bot
parent f3ef6f2ee1
commit e13a64d286
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -188,8 +188,11 @@ nil_image_init(struct nouveau_ws_device *dev,
(uint64_t)lvl_ext_B.d;
}
/* Align the image and array stride to a single level0 tile */
image->align_B = nil_tiling_size_B(image->levels[0].tiling);
/* I have no idea why but hardware seems to align layer strides */
image->array_stride_B = ALIGN(layer_size_B, 0x800);
image->array_stride_B = ALIGN(layer_size_B, image->align_B);
image->size_B = (uint64_t)image->array_stride_B * image->extent_px.a;
+1
View File
@@ -101,6 +101,7 @@ struct nil_image {
uint32_t array_stride_B;
uint32_t align_B;
uint64_t size_B;
};