Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net> On Fri, Sep 7, 2018 at 10:39 AM Danylo Piliaiev <danylo.pilia...@gmail.com> wrote:
> 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 > > v2: Do not subtract base layer if image unit is not layered (Ilia Mirkin) > > 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..54f62f0396 100644 > --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > @@ -1539,14 +1539,16 @@ 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; > + (get_image_num_layers(mt, obj->Target, u->Level) - > base_layer) : 1; > > struct isl_view view = { > .format = format, > .base_level = obj->MinLevel + u->Level, > .levels = 1, > - .base_array_layer = obj->MinLayer + u->_Layer, > + .base_array_layer = base_layer, > .array_len = num_layers, > .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