From d9e0b9a06a478a21f21f93a3d66a198e42e84c30 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Mon, 25 Jan 2016 19:20:57 -0800 Subject: [PATCH] isl/gen9: Fix slice offset calculation for 1D array images. The X component of the offset is set to the layer index times layer height which is obviously bogus, return the vertical offset of the slice as Y component instead. Fixes a few image load/store tests that use 1D arrays on SKL when forcing it to fall back to untyped reads and writes. --- src/isl/isl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/isl/isl.c b/src/isl/isl.c index acc80eae59c..6015c5c305c 100644 --- a/src/isl/isl.c +++ b/src/isl/isl.c @@ -1260,7 +1260,7 @@ get_image_offset_sa_gen9_1d(const struct isl_surf *surf, const struct isl_extent3d image_align_sa = isl_surf_get_image_alignment_sa(surf); - uint32_t x = layer * isl_surf_get_array_pitch_sa_rows(surf); + uint32_t x = 0; for (uint32_t l = 0; l < level; ++l) { uint32_t W = isl_minify(W0, l); @@ -1270,7 +1270,7 @@ get_image_offset_sa_gen9_1d(const struct isl_surf *surf, } *x_offset_sa = x; - *y_offset_sa = 0; + *y_offset_sa = layer * isl_surf_get_array_pitch_sa_rows(surf); } void -- 2.30.2