[Mesa-dev] [PATCH] anv: fix maxResourceSize for pre-gen9

Samuel Iglesias Gonsálvez siglesias at igalia.com
Mon Feb 26 08:58:22 UTC 2018


Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
 src/intel/vulkan/anv_formats.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 9c52ad5acbd..324797b7f10 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -842,6 +842,10 @@ anv_get_image_format_properties(
        */
    }
 
+   /* Pre-gen9 has a 2 GB limitation of the size in bytes */
+   uint64_t maxResourceSize =
+      devinfo->gen < 9 ? (uint64_t)( 1 << 31 ) : UINT32_MAX;
+
    *pImageFormatProperties = (VkImageFormatProperties) {
       .maxExtent = maxExtent,
       .maxMipLevels = maxMipLevels,
@@ -851,7 +855,7 @@ anv_get_image_format_properties(
       /* FINISHME: Accurately calculate
        * VkImageFormatProperties::maxResourceSize.
        */
-      .maxResourceSize = UINT32_MAX,
+      .maxResourceSize = maxResourceSize,
    };
 
    if (pYcbcrImageFormatProperties) {
-- 
2.14.1



More information about the mesa-dev mailing list