[Mesa-dev] [PATCH] i965: Fix calculation of layers array length for isl_view
Ilia Mirkin
imirkin at alum.mit.edu
Fri Sep 7 16:44:37 UTC 2018
On Fri, Sep 7, 2018 at 12:35 PM, Józef Kucia <joseph.kucia at gmail.com> wrote:
> On Fri, Sep 7, 2018 at 4:42 PM Danylo Piliaiev
> <danylo.piliaiev at gmail.com> wrote:
>
>> @@ -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,
>> };
>
> This sets the "array_len" to the number of layers remaining in the
> original texture. Shouldn't it take into account the number of layers
> in the GL texture view?
Errr, right. Here is the logic in st/mesa, which I believe is correct.
(But convoluted. Because there are so many bits to it.)
https://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/state_tracker/st_atom_image.c#n101
-ilia
More information about the mesa-dev
mailing list