radv/gfx9: handle GFX9 opaque metadata
authorDavid Airlie <airlied@dhcp-40-204.bne.redhat.com>
Tue, 15 Aug 2017 04:02:54 +0000 (14:02 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 15 Aug 2017 19:54:15 +0000 (05:54 +1000)
port the opaque metadata changes from radeonsi for gfx9.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_image.c

index 8d3ff1a515ea416ac7d8308ee22c02dbb0d1e932..7a4b2d57a513d15324e4f2340694a0234ae79ed7 100644 (file)
@@ -555,10 +555,11 @@ radv_query_opaque_metadata(struct radv_device *device,
        memcpy(&md->metadata[2], desc, sizeof(desc));
 
        /* Dwords [10:..] contain the mipmap level offsets. */
-       for (i = 0; i <= image->info.levels - 1; i++)
-               md->metadata[10+i] = image->surface.u.legacy.level[i].offset >> 8;
-
-       md->size_metadata = (11 + image->info.levels - 1) * 4;
+       if (device->physical_device->rad_info.chip_class <= VI) {
+               for (i = 0; i <= image->info.levels - 1; i++)
+                       md->metadata[10+i] = image->surface.u.legacy.level[i].offset >> 8;
+               md->size_metadata = (11 + image->info.levels - 1) * 4;
+       }
 }
 
 void