pvr: Only setup the bgobj to load if we have a load_op
authorKarmjit Mahil <Karmjit.Mahil@imgtec.com>
Tue, 3 Oct 2023 13:15:43 +0000 (14:15 +0100)
committerMarge Bot <emma+marge@anholt.net>
Mon, 23 Oct 2023 08:18:33 +0000 (08:18 +0000)
We only need to setup the background object if we have a load_op,
to perform the loads/clears.

This fixes segfaults for cases where we don't have a load_op.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25703>

src/imagination/vulkan/pvr_cmd_buffer.c

index c1690e7..2bdc2f7 100644 (file)
@@ -1458,7 +1458,7 @@ static VkResult pvr_sub_cmd_gfx_job_init(const struct pvr_device_info *dev_info,
       typed_memcpy(job->pds_bgnd_reg_values,
                    spm_bgobj_state->pds_reg_values,
                    ARRAY_SIZE(spm_bgobj_state->pds_reg_values));
-   } else if (render_pass_info->enable_bg_tag) {
+   } else if (hw_render->load_op) {
       const struct pvr_load_op *load_op = hw_render->load_op;
       struct pvr_pds_upload load_op_program;