radv/gfx10: fix maximum number of mip levels for 3D images
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 11 Jul 2019 12:24:37 +0000 (14:24 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 11 Jul 2019 12:44:47 +0000 (14:44 +0200)
The dimensions also have to be adjusted if the number of supported
mip levels is changed.

This fixes dEQP-VK.api.info.image_format_properties.3d.*.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_formats.c

index 26fc4b9ba1837c06919cb0f94305b3952ffc64f7..98c84edbdc15f6e42f230564923e583ea7c3ef28 100644 (file)
@@ -1150,10 +1150,16 @@ static VkResult radv_get_image_format_properties(struct radv_physical_device *ph
                maxArraySize = chip_class >= GFX10 ? 8192 : 2048;
                break;
        case VK_IMAGE_TYPE_3D:
-               maxExtent.width = 2048;
-               maxExtent.height = 2048;
-               maxExtent.depth = 2048;
-               maxMipLevels = chip_class >= GFX10 ? 14 : 12; /* log2(maxWidth) + 1 */
+               if (chip_class >= GFX10) {
+                       maxExtent.width = 8192;
+                       maxExtent.height = 8192;
+                       maxExtent.depth = 8192;
+               } else {
+                       maxExtent.width = 2048;
+                       maxExtent.height = 2048;
+                       maxExtent.depth = 2048;
+               }
+               maxMipLevels = util_logbase2(maxExtent.width) + 1;
                maxArraySize = 1;
                break;
        }