Mesa (main): intel/blorp: Use isl_surf_get_uncompressed_surf
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jul 6 19:42:51 UTC 2021
Module: Mesa
Branch: main
Commit: 2001a2630907e9be21b380547e47c11652d0350d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2001a2630907e9be21b380547e47c11652d0350d
Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date: Thu Feb 22 14:31:00 2018 -0800
intel/blorp: Use isl_surf_get_uncompressed_surf
Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>
---
src/intel/blorp/blorp_blit.c | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index 1f195e281e7..106cf3169dc 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -2610,23 +2610,29 @@ blorp_surf_convert_to_uncompressed(const struct isl_device *isl_dev,
*y /= fmtl->bh;
}
- /* This is a compressed surface. We need to convert it to a single
- * slice (because compressed layouts don't perfectly match uncompressed
- * ones with the same bpb) and divide x, y, width, and height by the
- * block size.
- */
- blorp_surf_convert_to_single_slice(isl_dev, info);
+ /* We only want one level and slice */
+ info->view.levels = 1;
+ info->view.array_len = 1;
- info->surf.logical_level0_px = isl_surf_get_logical_level0_el(&info->surf);
- info->surf.phys_level0_sa = isl_surf_get_phys_level0_el(&info->surf);
+ if (info->surf.dim == ISL_SURF_DIM_3D) {
+ /* Roll the Z offset into the image view */
+ info->view.base_array_layer += info->z_offset;
+ info->z_offset = 0;
+ }
- assert(info->tile_x_sa % fmtl->bw == 0);
- assert(info->tile_y_sa % fmtl->bh == 0);
- info->tile_x_sa /= fmtl->bw;
- info->tile_y_sa /= fmtl->bh;
+ uint32_t offset_B;
+ isl_surf_get_uncompressed_surf(isl_dev, &info->surf, &info->view,
+ &info->surf, &info->view, &offset_B,
+ &info->tile_x_sa, &info->tile_y_sa);
+ info->addr.offset += offset_B;
- /* It's now an uncompressed surface so we need an uncompressed format */
- info->surf.format = get_copy_format_for_bpb(isl_dev, fmtl->bpb);
+ /* BLORP doesn't use the actual intratile offsets. Instead, it needs the
+ * surface to be a bit bigger and we offset the vertices instead.
+ */
+ info->surf.logical_level0_px.w += info->tile_x_sa;
+ info->surf.logical_level0_px.h += info->tile_y_sa;
+ info->surf.phys_level0_sa.w += info->tile_x_sa;
+ info->surf.phys_level0_sa.h += info->tile_y_sa;
}
void
More information about the mesa-commit
mailing list