radv/gfx9: set mip0-depth correctly for 2d arrays/3d images
authorDave Airlie <airlied@redhat.com>
Mon, 21 Aug 2017 20:02:03 +0000 (21:02 +0100)
committerDave Airlie <airlied@redhat.com>
Wed, 13 Sep 2017 07:16:52 +0000 (17:16 +1000)
This field covers the whole resource.

Fixes:
dEQP-VK.pipeline.image.suballocation.sampling_type.combined.view_type.3d.format.*
dEQP-VK.texture.filtering.3d.combinations.*

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

index 6b96a3da4a307b6ca4c5f71cc23ac09e441c17ce..3c512bd263b770ac54a2eb9e639ef6978a6e31d2 100644 (file)
@@ -3094,8 +3094,8 @@ radv_initialise_color_surface(struct radv_device *device,
        }
 
        if (device->physical_device->rad_info.chip_class >= GFX9) {
-               uint32_t max_slice = radv_surface_layer_count(iview);
-               unsigned mip0_depth = iview->base_layer + max_slice - 1;
+               unsigned mip0_depth = iview->image->type == VK_IMAGE_TYPE_3D ?
+                 (iview->extent.depth - 1) : (iview->image->info.array_size - 1);
 
                cb->cb_color_view |= S_028C6C_MIP_LEVEL(iview->base_mip);
                cb->cb_color_attrib |= S_028C74_MIP0_DEPTH(mip0_depth) |