Comment for array_len field states: "Indicates the number of array elements starting at Base Array Layer."
And most usages of array_len expect it to be equal or less than total layers - base layer Fixes: 5a8c8903 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107856 Signed-off-by: Danylo Piliaiev <danylo.pilia...@globallogic.com> --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 42af41aca3..6adf4a5836 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -1539,6 +1539,8 @@ update_image_surface(struct brw_context *brw, } else { struct intel_texture_object *intel_obj = intel_texture_object(obj); struct intel_mipmap_tree *mt = intel_obj->mt; + + const unsigned base_layer = obj->MinLayer + u->_Layer; const unsigned num_layers = u->Layered ? get_image_num_layers(mt, obj->Target, u->Level) : 1; @@ -1546,8 +1548,8 @@ update_image_surface(struct brw_context *brw, .format = format, .base_level = obj->MinLevel + u->Level, .levels = 1, - .base_array_layer = obj->MinLayer + u->_Layer, - .array_len = num_layers, + .base_array_layer = base_layer, + .array_len = num_layers - base_layer, .swizzle = ISL_SWIZZLE_IDENTITY, .usage = ISL_SURF_USAGE_STORAGE_BIT, }; -- 2.18.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev