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>
(cherry picked from commit 822dc384b1)
This commit is contained in:
Karmjit Mahil 2023-06-15 15:47:38 +01:00 committed by Eric Engestrom
parent 5f3317ec1c
commit 9d31e05b8a
2 changed files with 5 additions and 1 deletions

View file

@ -1939,7 +1939,7 @@
"description": "pvr: Fix seg fault on empty descriptor set",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "ce67f5ac944bdc6ebf27e3b115706bec5b63f002"
},

View file

@ -3571,6 +3571,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_bo *new_desc_set_bo;