pvr: skip setting up SPM consts buffer when no const shared regs are used
authorFrank Binns <frank.binns@imgtec.com>
Thu, 13 Jul 2023 12:35:39 +0000 (13:35 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 14 Jul 2023 07:37:16 +0000 (07:37 +0000)
This is a temporary measure until the zeroed shaders are replaced with the real
ones. This avoids a VK_ERROR_OUT_OF_DEVICE_MEMORY error due to a zero sized
allocation.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Fixes: 1dfd5351249 ("pvr: Setup SPM background object")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24139>

src/imagination/vulkan/pvr_spm.c

index 92abaa4..e5654c4 100644 (file)
@@ -981,6 +981,14 @@ pvr_spm_init_bgobj_state(struct pvr_device *device,
 
    consts_buffer_size = info->const_shared_regs * sizeof(uint32_t);
 
+   /* TODO: Remove this check, along with the pvr_finishme(), once the zeroed
+    * shaders are replaced by the real shaders.
+    */
+   if (!consts_buffer_size)
+      return VK_SUCCESS;
+
+   pvr_finishme("Remove consts buffer size check");
+
    result = pvr_bo_alloc(device,
                          device->heaps.general_heap,
                          consts_buffer_size,