mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02: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> (cherry picked from commitadd742fca6) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39745>
This commit is contained in:
parent
28e38d3331
commit
bca0d20d57
2 changed files with 9 additions and 10 deletions
|
|
@ -1194,7 +1194,7 @@
|
|||
"description": "intel/isl: Fix miptail selection for compressed textures",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "46f45d62d1bc78dfdd8bf9300584a01541f7660f",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -2349,12 +2349,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.
|
||||
|
|
@ -2374,9 +2368,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