Ben Widawsky <b...@bwidawsk.net> writes:

>> +      if (mt->target == GL_TEXTURE_3D)
>> +         depth = minify(depth, 1);
>>     }
>>  }
>
> assert(brw->gen >= 9)? (up to you, I'm very assert happy)

Yes, that seems like a good idea.

>>  
>> @@ -263,7 +266,7 @@ brw_miptree_layout_texture_array(struct brw_context *brw,
>>        if (mt->compressed)
>>           img_height /= mt->align_h;
>>  
>> -      for (int q = 0; q < mt->physical_depth0; q++) {
>> +      for (int q = 0; q < mt->level[level].depth; q++) {
>>           if (mt->array_layout == ALL_SLICES_AT_EACH_LOD) {
>>              intel_miptree_set_image_offset(mt, level, q, 0, q * img_height);
>>           } else {
>
> Can you remind me how you can have different depths per level? Assuming 
> they're
> the same, I prefer this hunk removed because it's much clearer the old way in 
> my
> opinion.

With 3D textures, unlike array textures, the depth is halved at each
mipmap level as well as the width and height so each mipmap level has a
different depth. I'm attaching an SVG which might make it clearer. I
guess that means that using the same layout for array textures and 3D
textures means that 3D textures will now have more unused space, but
that is what the hardware now wants so that's the way it has to be.

I originally didn't make this change and I thought maybe you could get
away with allocating the depth to be the same for each level even though
some of them won't be used but some later code gets very confused and
asserts.

Thanks for the review.

Regards,
- Neil

Attachment: pgpxxtknrqENs.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to