pvr: Fix seg fault on empty descriptor set

Vulkan allows empty descriptor sets to be created. When we setup
the descriptor set addresses table we fill in the address of the
`bo` for each valid/currently bound desc set. For empty desc sets
there is no `bo` which was causing a seg fault. Now skip them,
leaving their address set to `~0`.

Reported-by: Simon Perretta <simon.perretta@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Fixes: ce67f5ac94 ("pvr: Write descriptor set addrs table dev addr into shareds")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23692>
This commit is contained in:
Karmjit Mahil 2023-06-15 15:47:38 +01:00 committed by Marge Bot
parent 9d75795087
commit 822dc384b1

View file

@ -3906,6 +3906,10 @@ pvr_cmd_buffer_upload_desc_set_table(struct pvr_cmd_buffer *const cmd_buffer,
desc_set = desc_state->descriptor_sets[set];
/* TODO: Is it better if we don't set the valid_mask for empty sets? */
if (desc_set->layout->descriptor_count == 0)
continue;
if (desc_set->layout->dynamic_buffer_count > 0) {
struct pvr_suballoc_bo *new_desc_set_bo;