Mesa (master): anv: don't advertise mipmaps for linear 3D surfaces on BDW
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Mar 5 00:31:58 UTC 2021
Module: Mesa
Branch: master
Commit: 194e4776156f7d04baf335673654113339c5c9f2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=194e4776156f7d04baf335673654113339c5c9f2
Author: Iván Briano <ivan.briano at intel.com>
Date: Thu Mar 4 14:55:35 2021 -0800
anv: don't advertise mipmaps for linear 3D surfaces on BDW
Prior to SKL, the mipmaps for 3D surfaces are laid out in a way
that make it impossible to represent in the way that
VkSubresourceLayout expects. Since we can't tell users how to make
sense of them, don't report them as available.
"Fixes" dEQP-VK.image.subresource_layout.3d.*
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9419>
---
src/intel/vulkan/anv_formats.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 9d09e6bf016..ebe71a5525d 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -978,7 +978,15 @@ anv_get_image_format_properties(
maxExtent.width = 2048;
maxExtent.height = 2048;
maxExtent.depth = 2048;
- maxMipLevels = 12; /* log2(maxWidth) + 1 */
+ /* Prior to SKL, the mipmaps for 3D surfaces are laid out in a way
+ * that make it impossible to represent in the way that
+ * VkSubresourceLayout expects. Since we can't tell users how to make
+ * sense of them, don't report them as available.
+ */
+ if (devinfo->gen < 9 && info->tiling == VK_IMAGE_TILING_LINEAR)
+ maxMipLevels = 1;
+ else
+ maxMipLevels = 12; /* log2(maxWidth) + 1 */
maxArraySize = 1;
sampleCounts = VK_SAMPLE_COUNT_1_BIT;
break;
More information about the mesa-commit
mailing list