Module: Mesa Branch: main Commit: b470d931dc2da66a4d6d726891bf2e508025f99d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b470d931dc2da66a4d6d726891bf2e508025f99d
Author: Frank Binns <[email protected]> Date: Thu Jul 13 13:35:39 2023 +0100 pvr: skip setting up SPM consts buffer when no const shared regs are used 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 <[email protected]> Reviewed-by: Karmjit Mahil <[email protected]> Fixes: 1dfd5351249 ("pvr: Setup SPM background object") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24139> --- src/imagination/vulkan/pvr_spm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/imagination/vulkan/pvr_spm.c b/src/imagination/vulkan/pvr_spm.c index 92abaa47c03..e5654c48989 100644 --- a/src/imagination/vulkan/pvr_spm.c +++ b/src/imagination/vulkan/pvr_spm.c @@ -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,
