Module: Mesa
Branch: staging/23.0
Commit: 1f47f7dd4bad3216983e7dd9e74212fb87684ca6
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1f47f7dd4bad3216983e7dd9e74212fb87684ca6

Author: Lionel Landwerlin <[email protected]>
Date:   Wed Mar 22 13:39:42 2023 +0200

anv: take care of maxStorageBufferRange being uint32_t

Not fixing anything, but required for another fix.

Signed-off-by: Lionel Landwerlin <[email protected]>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22066>
(cherry picked from commit 00fc927e52cf9dcbfadb9e3d6c44475ea1cc0742)

---

 .pick_status.json                   | 2 +-
 src/intel/vulkan/anv_device.c       | 2 +-
 src/intel/vulkan_hasvk/anv_device.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 44ccaeff8dd..4b109cd03a6 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -130,7 +130,7 @@
         "description": "anv: take care of maxStorageBufferRange being 
uint32_t",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index a1fc836f98f..8c7f0b07c96 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -1875,7 +1875,7 @@ void anv_GetPhysicalDeviceProperties(
       .maxImageArrayLayers                      = (1 << 11),
       .maxTexelBufferElements                   = 128 * 1024 * 1024,
       .maxUniformBufferRange                    = 
pdevice->compiler->indirect_ubos_use_sampler ? (1u << 27) : (1u << 30),
-      .maxStorageBufferRange                    = 
pdevice->isl_dev.max_buffer_size,
+      .maxStorageBufferRange                    = 
MIN2(pdevice->isl_dev.max_buffer_size, UINT32_MAX),
       .maxPushConstantsSize                     = MAX_PUSH_CONSTANTS_SIZE,
       .maxMemoryAllocationCount                 = UINT32_MAX,
       .maxSamplerAllocationCount                = 64 * 1024,
diff --git a/src/intel/vulkan_hasvk/anv_device.c 
b/src/intel/vulkan_hasvk/anv_device.c
index a530ed64c3e..e54fa3ec493 100644
--- a/src/intel/vulkan_hasvk/anv_device.c
+++ b/src/intel/vulkan_hasvk/anv_device.c
@@ -1624,7 +1624,7 @@ void anv_GetPhysicalDeviceProperties(
       .maxImageArrayLayers                      = (1 << 11),
       .maxTexelBufferElements                   = 128 * 1024 * 1024,
       .maxUniformBufferRange                    = 
pdevice->compiler->indirect_ubos_use_sampler ? (1u << 27) : (1u << 30),
-      .maxStorageBufferRange                    = 
pdevice->isl_dev.max_buffer_size,
+      .maxStorageBufferRange                    = 
MIN2(pdevice->isl_dev.max_buffer_size, UINT32_MAX),
       .maxPushConstantsSize                     = MAX_PUSH_CONSTANTS_SIZE,
       .maxMemoryAllocationCount                 = UINT32_MAX,
       .maxSamplerAllocationCount                = 64 * 1024,

Reply via email to