[Mesa-dev] [7.5/16] intel/isl: Take 3D surfaces into account in image params

Topi Pohjolainen topi.pohjolainen at gmail.com
Tue Jul 18 07:23:46 UTC 2017


CC: Jason Ekstrand <jason at jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 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 4c56e787b5..a8aebce6d4 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, &param->offset[0],  &param->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,
+                                &param->offset[0],  &param->offset[1]);
 
    const int cpp = isl_format_get_layout(surf->format)->bpb / 8;
    param->stride[0] = cpp;
-- 
2.11.0



More information about the mesa-dev mailing list