mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-15 02:20:29 +01:00
intel/isl: Fix miptail selection for compressed textures
When determining if an LOD can fit within a miptail, we must minify in
pixel space and then convert to elements.
Prevents the following test case from failing when Yf is force-enabled:
dEQP-VK.image.texel_view_compatible.graphic.extended.3d_image.texture_read.astc_8x5_srgb_block.r32g32b32a32_uint
Fixes: 46f45d62d1 ("intel/isl: Start using miptails")
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38063>
This commit is contained in:
parent
fa85978b58
commit
add742fca6
1 changed files with 8 additions and 9 deletions
|
|
@ -2363,12 +2363,6 @@ isl_choose_miptail_start_level(const struct isl_device *dev,
|
|||
/* Account for the specified minimum */
|
||||
min_miptail_start = MAX(min_miptail_start, info->min_miptail_start_level);
|
||||
|
||||
struct isl_extent3d level0_extent_el = {
|
||||
.w = isl_align_div_npot(info->width, fmtl->bw),
|
||||
.h = isl_align_div_npot(info->height, fmtl->bh),
|
||||
.d = isl_align_div_npot(info->depth, fmtl->bd),
|
||||
};
|
||||
|
||||
/* The first miptail slot takes up the entire right side of the tile. So,
|
||||
* the extent is just the distance from the offset of the first level to
|
||||
* the corner of the tile.
|
||||
|
|
@ -2388,9 +2382,14 @@ isl_choose_miptail_start_level(const struct isl_device *dev,
|
|||
/* Now find the first level that fits the maximum miptail size requirement.
|
||||
*/
|
||||
for (uint32_t s = min_miptail_start; s < info->levels; s++) {
|
||||
if (isl_minify(level0_extent_el.w, s) <= miptail_level0_extent_el.w &&
|
||||
isl_minify(level0_extent_el.h, s) <= miptail_level0_extent_el.h &&
|
||||
isl_minify(level0_extent_el.d, s) <= miptail_level0_extent_el.d)
|
||||
struct isl_extent3d level_s_extent_el = {
|
||||
.w = isl_align_div_npot(isl_minify(info->width, s), fmtl->bw),
|
||||
.h = isl_align_div_npot(isl_minify(info->height, s), fmtl->bh),
|
||||
.d = isl_align_div_npot(isl_minify(info->depth, s), fmtl->bd),
|
||||
};
|
||||
if (level_s_extent_el.w <= miptail_level0_extent_el.w &&
|
||||
level_s_extent_el.h <= miptail_level0_extent_el.h &&
|
||||
level_s_extent_el.d <= miptail_level0_extent_el.d)
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue