tu: Fill out maxBufferSize
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 18 Mar 2022 13:36:11 +0000 (14:36 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 5 Apr 2022 17:46:35 +0000 (17:46 +0000)
It seems this is really a workaround for silly issues in
GetBufferMemoryRequirements when you ask for a really large buffer. Just
expose the maximum possible size ATM.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15488>

src/freedreno/vulkan/tu_device.c

index 82883e0..e3522a3 100644 (file)
@@ -1035,8 +1035,12 @@ tu_get_physical_device_properties_1_3(struct tu_physical_device *pdevice,
    p->uniformTexelBufferOffsetAlignmentBytes = 64;
    p->uniformTexelBufferOffsetSingleTexelAlignment = false;
 
-   /* TODO: find out the limit */
-   p->maxBufferSize = 0;
+   /* The address space is 4GB for current kernels, so there's no point
+    * allowing a larger buffer. Our buffer sizes are 64-bit though, so
+    * GetBufferDeviceRequirements won't fall over if someone actually creates
+    * a 4GB buffer.
+    */
+   p->maxBufferSize = 1ull << 32;
 }
 
 VKAPI_ATTR void VKAPI_CALL