v3dv: pipeline creation feedback may not request all stages

Nothing in the spec seems to require that the number of stages for
which creation feedback is requested must match the number of stages
available in the pipeline. In fact, the spec explicitly mentions
that this number could be 0:

   "If pipelineStageCreationFeedbackCount is not 0,
    pPipelineStageCreationFeedbacks must be a valid pointer to an
    array of pipelineStageCreationFeedbackCount
    VkPipelineCreationFeedback structures"

Fixes an assert crash in:
dEQP-VK.pipeline.monolithic.creation_feedback.graphics_tests.vertex_stage_fragment_stage_no_cache_zero_out_feedback_cout

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20352>
This commit is contained in:
Iago Toral Quiroga
2022-12-16 10:32:15 +01:00
committed by Marge Bot
parent bdcbdfdfcb
commit 3cc863649f
+4 -2
View File
@@ -2057,9 +2057,11 @@ write_creation_feedback(struct v3dv_pipeline *pipeline,
pipeline_feedback,
1);
assert(stage_count == create_feedback->pipelineStageCreationFeedbackCount);
const uint32_t feedback_stage_count =
create_feedback->pipelineStageCreationFeedbackCount;
assert(feedback_stage_count <= stage_count);
for (uint32_t i = 0; i < stage_count; i++) {
for (uint32_t i = 0; i < feedback_stage_count; i++) {
gl_shader_stage s = vk_to_mesa_shader_stage(stages[i].stage);
enum broadcom_shader_stage bs = gl_shader_stage_to_broadcom(s);