From 4733891e51dc31ca12671abd531a00263d3053e2 Mon Sep 17 00:00:00 2001 From: Topi Pohjolainen Date: Tue, 18 Jul 2017 08:53:16 +0300 Subject: [PATCH] intel/isl: Take 3D surfaces into account in image params Reviewed-by: Jason Ekstrand Signed-off-by: Topi Pohjolainen --- src/intel/isl/isl_storage_image.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/intel/isl/isl_storage_image.c b/src/intel/isl/isl_storage_image.c index 4c56e787b51..a8aebce6d49 100644 --- a/src/intel/isl/isl_storage_image.c +++ b/src/intel/isl/isl_storage_image.c @@ -226,8 +226,12 @@ isl_surf_fill_image_param(const struct isl_device *dev, view->base_array_layer; } - isl_surf_get_image_offset_el(surf, view->base_level, view->base_array_layer, - 0, ¶m->offset[0], ¶m->offset[1]); + isl_surf_get_image_offset_el(surf, view->base_level, + surf->dim == ISL_SURF_DIM_3D ? + 0 : view->base_array_layer, + surf->dim == ISL_SURF_DIM_3D ? + view->base_array_layer : 0, + ¶m->offset[0], ¶m->offset[1]); const int cpp = isl_format_get_layout(surf->format)->bpb / 8; param->stride[0] = cpp; -- 2.30.2