intel/isl: Take 3D surfaces into account in image params
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Tue, 18 Jul 2017 05:53:16 +0000 (08:53 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Tue, 18 Jul 2017 18:35:44 +0000 (21:35 +0300)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/isl/isl_storage_image.c

index 4c56e787b51e9fd15bcabb10cbaa49de74ebdaa7..a8aebce6d49c468b7ef2f137f49702d8a850d0ce 100644 (file)
@@ -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;