Module: Mesa Branch: staging/23.2 Commit: 340d8511acad02f3c5b0c1557bcf53c01af34011 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=340d8511acad02f3c5b0c1557bcf53c01af34011
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> (cherry picked from commit b470d931dc2da66a4d6d726891bf2e508025f99d) --- .pick_status.json | 2 +- src/imagination/vulkan/pvr_spm.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 583d1f098c9..8675b6de378 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -444,7 +444,7 @@ "description": "pvr: skip setting up SPM consts buffer when no const shared regs are used", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "1dfd5351249c957edab895bdf3f667106eaaa39a", "notes": null 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,
