ac/surface: trivial non-functional changes
authorMarek Olšák <marek.olsak@amd.com>
Wed, 16 Aug 2023 19:15:00 +0000 (15:15 -0400)
committerMarge Bot <emma+marge@anholt.net>
Sat, 19 Aug 2023 19:36:56 +0000 (19:36 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>

src/amd/common/ac_surface.c
src/amd/common/ac_surface_meta_address_test.c

index 53fe648..ea91713 100644 (file)
@@ -1707,6 +1707,8 @@ static void ac_copy_cmask_equation(const struct radeon_info *info,
                                    ADDR2_COMPUTE_CMASK_INFO_OUTPUT *cmask,
                                    struct gfx9_meta_equation *equation)
 {
+   assert(info->gfx_level < GFX11);
+
    equation->meta_block_width = cmask->metaBlkWidth;
    equation->meta_block_height = cmask->metaBlkHeight;
    equation->meta_block_depth = 1;
@@ -2920,21 +2922,10 @@ static uint32_t ac_surface_get_pitch_align(const struct radeon_info *info,
                                            const struct radeon_surf *surf)
 {
    if (surf->is_linear) {
-      switch (info->gfx_level) {
-      case GFX6:
-      case GFX7:
-      case GFX8:
-         return MAX2(8, 64 / surf->bpe);
-
-      case GFX9:
-      case GFX10:
-      case GFX10_3:
-      case GFX11:
+      if (info->gfx_level >= GFX9)
          return 256 / surf->bpe;
-
-      default:
-         unreachable("unhandled gfx_level");
-      }
+      else
+         return MAX2(8, 64 / surf->bpe);
    }
 
    if (info->gfx_level >= GFX9) {
index 731bfa1..57b5605 100644 (file)
@@ -729,6 +729,9 @@ int main(int argc, char **argv)
    for (unsigned i = 0; i < ARRAY_SIZE(testcases); ++i) {
       struct radeon_info info = get_radeon_info(&testcases[i]);
 
+      if (info.gfx_level >= GFX11)
+         continue;
+
       run_cmask_address_test(testcases[i].name, &info, full);
    }