pvr: Don't allocate/upload 0 size coeff programs

Fixes assert seen in dEQP-Vk.api.smoke.triangle

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22051>
This commit is contained in:
Jarred Davies
2023-03-06 00:08:04 +00:00
committed by Marge Bot
parent 49ed1e55d8
commit a7b34ad8f2
+8
View File
@@ -78,6 +78,14 @@ static VkResult pvr_pds_coeff_program_create_and_upload(
/* Get the size of the program and then allocate that much memory. */
pvr_pds_coefficient_loading(&program, NULL, PDS_GENERATE_SIZES);
if (!program.code_size) {
pds_upload_out->pvr_bo = NULL;
pds_upload_out->code_size = 0;
pds_upload_out->data_size = 0;
return VK_SUCCESS;
}
staging_buffer_size =
(program.code_size + program.data_size) * sizeof(*staging_buffer);