Revert "amd/common: Always initialize gfx9 mipmap offset/pitch."
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 3 Jan 2020 10:19:35 +0000 (11:19 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 4 Jan 2020 12:04:40 +0000 (13:04 +0100)
This reverts commit 973181c06cca3fe232c3a435abde31f2fc1b81ef.

Requested by Marek.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_surface.c
src/amd/common/ac_surface.h

index 5e524ceb7b6b0a98389989bd496a7616d9c05e2b..92aab57920a35feda4c678389f177c3f63a74aeb 100644 (file)
@@ -1061,9 +1061,11 @@ static int gfx9_compute_miptree(ADDR_HANDLE addrlib,
        surf->surf_size = out.surfSize;
        surf->surf_alignment = out.baseAlign;
 
-       for (unsigned i = 0; i < in->numMipLevels; i++) {
-               surf->u.gfx9.offset[i] = mip_info[i].offset;
-               surf->u.gfx9.pitch[i] = mip_info[i].pitch;
+       if (in->swizzleMode == ADDR_SW_LINEAR) {
+               for (unsigned i = 0; i < in->numMipLevels; i++) {
+                       surf->u.gfx9.offset[i] = mip_info[i].offset;
+                       surf->u.gfx9.pitch[i] = mip_info[i].pitch;
+               }
        }
 
        if (in->flags.depth) {
index dec7b206a6a7dd16db8a2f084117ffe6ca3d0f17..1e90c08b2e53337c62d873dc08dcd869f02ba781 100644 (file)
@@ -152,9 +152,9 @@ struct gfx9_surf_layout {
     uint64_t                    surf_offset; /* 0 unless imported with an offset */
     /* The size of the 2D plane containing all mipmap levels. */
     uint64_t                    surf_slice_size;
-    /* Mipmap level offset within the slice in bytes. */
+    /* Mipmap level offset within the slice in bytes. Only valid for LINEAR. */
     uint32_t                    offset[RADEON_SURF_MAX_LEVELS];
-    /* Mipmap level pitch in elements. */
+    /* Mipmap level pitch in elements. Only valid for LINEAR. */
     uint32_t                    pitch[RADEON_SURF_MAX_LEVELS];
 
     uint64_t                    stencil_offset; /* separate stencil */