iris,crocus: Add proper way of assigning num_levels value
Changes miptree_level_range_length function to use correct macro and num_levels value assignment. Closes: mesa/mesa#8256 Signed-off-by: Viktoriia Palianytsia <v.palianytsia@globallogic.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22067>
This commit is contained in:
committed by
Marge Bot
parent
acce5c3fe1
commit
c4e8b1cddb
@@ -760,8 +760,8 @@ miptree_level_range_length(const struct crocus_resource *res,
|
||||
{
|
||||
assert(start_level < res->surf.levels);
|
||||
|
||||
if (num_levels == INTEL_REMAINING_LAYERS)
|
||||
num_levels = res->surf.levels;
|
||||
if (num_levels == INTEL_REMAINING_LEVELS)
|
||||
num_levels = res->surf.levels - start_level;
|
||||
|
||||
/* Check for overflow */
|
||||
assert(start_level + num_levels >= start_level);
|
||||
|
||||
@@ -751,8 +751,8 @@ miptree_level_range_length(const struct iris_resource *res,
|
||||
{
|
||||
assert(start_level < res->surf.levels);
|
||||
|
||||
if (num_levels == INTEL_REMAINING_LAYERS)
|
||||
num_levels = res->surf.levels;
|
||||
if (num_levels == INTEL_REMAINING_LEVELS)
|
||||
num_levels = res->surf.levels - start_level;
|
||||
|
||||
/* Check for overflow */
|
||||
assert(start_level + num_levels >= start_level);
|
||||
|
||||
Reference in New Issue
Block a user