[Mesa-dev] [PATCH 07/32] i965/miptree: Make layer_range_length return locical layers
Jason Ekstrand
jason at jlekstrand.net
Thu Jul 20 15:08:55 UTC 2017
On July 20, 2017 2:27:50 AM "Pohjolainen, Topi"
<topi.pohjolainen at gmail.com> wrote:
>
> This still leaves create_aux_state_map() using physical number of layers for
> the actual allocation. I toyed a little with this hoping to put it in front my
> i965-to-isl work. In the end it looks to me that moving away from physical
> is easier/cleaner once the conversion to isl is done. This prevents us from
> addressing both isl-based and native slice table-based leaving just the
> isl-based. Moreover in case of slice table-based we would need to calculate
> a layer-number divider as the slice table itself stores depth as physical.
>
> There are altogether 6 places calling get_num_phys_layers() in the end.
> I think these document nicely all the locations we need to consider. How does
> this sound?
That's fine with me.
> On Wed, Jul 19, 2017 at 02:01:33PM -0700, Jason Ekstrand wrote:
>> ---
>> src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 14 ++++++++++----
>> 1 file changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>> index 3eac077..8d8ea43 100644
>> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
>> @@ -2461,12 +2461,18 @@ miptree_layer_range_length(const struct
>> intel_mipmap_tree *mt, uint32_t level,
>> assert(level <= mt->last_level);
>> uint32_t total_num_layers;
>>
>> - if (mt->surf.size > 0)
>> + if (mt->surf.size > 0) {
>> total_num_layers = mt->surf.dim == ISL_SURF_DIM_3D ?
>> - minify(mt->surf.phys_level0_sa.depth, level) :
>> - mt->surf.phys_level0_sa.array_len;
>> - else
>> + minify(mt->surf.logical_level0_px.depth, level) :
>> + mt->surf.logical_level0_px.array_len;
>> + } else {
>> total_num_layers = mt->level[level].depth;
>> + if (mt->msaa_layout == INTEL_MSAA_LAYOUT_UMS ||
>> + mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {
>> + assert(total_num_layers % mt->num_samples == 0);
>> + total_num_layers /= mt->num_samples;
>> + }
>> + }
>>
>> assert(start_layer < total_num_layers);
>> if (num_layers == INTEL_REMAINING_LAYERS)
>> --
>> 2.5.0.400.gff86faf
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list