radv: rename ac_surf_nbc_view::max_mip to num_levels
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 19 Jan 2023 07:45:27 +0000 (08:45 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 19 Jan 2023 12:46:07 +0000 (12:46 +0000)
For readability.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>

src/amd/common/ac_surface.c
src/amd/common/ac_surface.h
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_image.c

index 966e0e6..1819f9e 100644 (file)
@@ -3094,7 +3094,7 @@ ac_surface_compute_nbc_view(struct ac_addrlib *addrlib, const struct radeon_info
       out->tile_swizzle = output.pipeBankXor;
       out->width = output.unalignedWidth;
       out->height = output.unalignedHeight;
-      out->max_mip = output.numMipLevels;
+      out->num_levels = output.numMipLevels;
       out->level = output.mipId;
       out->valid = true;
    } else {
index 48a8c4c..61dde25 100644 (file)
@@ -421,7 +421,7 @@ struct ac_surf_nbc_view {
    uint32_t width;
    uint32_t height;
    uint32_t level;
-   uint32_t max_mip; /* Used for max_mip in the resource descriptor */
+   uint32_t num_levels; /* Used for max_mip in the resource descriptor */
    uint8_t tile_swizzle;
    uint64_t base_address_offset;
 };
index bc52201..dd2bb5d 100644 (file)
@@ -7142,7 +7142,7 @@ radv_initialise_color_surface(struct radv_device *device, struct radv_color_buff
 
          if (iview->nbc_view.valid) {
             base_level = iview->nbc_view.level;
-            max_mip = iview->nbc_view.max_mip - 1;
+            max_mip = iview->nbc_view.num_levels - 1;
          }
 
          cb->cb_color_view |= S_028C6C_MIP_LEVEL_GFX10(base_level);
index 57f639f..c8f4988 100644 (file)
@@ -1048,7 +1048,7 @@ gfx10_make_texture_descriptor(struct radv_device *device, struct radv_image *ima
    unsigned max_mip =
       image->info.samples > 1 ? util_logbase2(image->info.samples) : image->info.levels - 1;
    if (nbc_view && nbc_view->valid)
-      max_mip = nbc_view->max_mip - 1;
+      max_mip = nbc_view->num_levels - 1;
 
    unsigned min_lod_clamped = radv_float_to_ufixed(CLAMP(min_lod, 0, 15), 8);
    if (device->physical_device->rad_info.gfx_level >= GFX11) {