From 2ac35116d137c31f2d65053cd612fb00b8756b2e Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Thu, 13 Jun 2024 15:18:37 -0700 Subject: [PATCH] anv/sparse: remove obsolete linear tiling code path The code that tries to create a "pretend block shape" for linear tiling surfaces was necessary back when we were going to support sparse residency (non-opaque binds) for non-standard block shapes (since there was uncertainty about TileYs support). That hasn't been the case since before we merged sparse resources upstream, so remove the code and leave an assertion instead, just in case. Reviewed-by: Lionel Landwerlin Signed-off-by: Paulo Zanoni Part-of: --- src/intel/vulkan/anv_sparse.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/intel/vulkan/anv_sparse.c b/src/intel/vulkan/anv_sparse.c index 8aab30d2911..b4ad949f86c 100644 --- a/src/intel/vulkan/anv_sparse.c +++ b/src/intel/vulkan/anv_sparse.c @@ -844,7 +844,6 @@ anv_sparse_calc_block_shape(struct anv_physical_device *pdevice, { const struct isl_format_layout *layout = isl_format_get_layout(surf->format); - const int Bpb = layout->bpb / 8; struct isl_tile_info tile_info; isl_surf_get_tile_info(surf, &tile_info); @@ -856,19 +855,7 @@ anv_sparse_calc_block_shape(struct anv_physical_device *pdevice, }; VkExtent3D block_shape_px = vk_extent3d_el_to_px(block_shape_el, layout); - if (surf->tiling == ISL_TILING_LINEAR) { - uint32_t elements_per_row = surf->row_pitch_B / - (block_shape_el.width * Bpb); - uint32_t rows_per_tile = ANV_SPARSE_BLOCK_SIZE / - (elements_per_row * Bpb); - assert(rows_per_tile * elements_per_row * Bpb == ANV_SPARSE_BLOCK_SIZE); - - block_shape_px = (VkExtent3D) { - .width = elements_per_row * layout->bw, - .height = rows_per_tile * layout->bh, - .depth = layout->bd, - }; - } + assert(surf->tiling != ISL_TILING_LINEAR); return block_shape_px; }