radv: fix pipelineStageCreationFeedbackCount when it's 0

From the Vulkan spec 1.3.227:

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

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18513>
(cherry picked from commit 28af93ace7b4a5d7dfd1cbfa6ab14ffcb86ad6ba)
This commit is contained in:
Samuel Pitoiset 2022-09-09 09:55:49 +02:00 committed by Dylan Baker
parent f0dc4ee1cd
commit d30ddb0406
2 changed files with 4 additions and 3 deletions

View File

@ -1507,7 +1507,7 @@
"description": "radv: fix pipelineStageCreationFeedbackCount when it's 0",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@ -4999,8 +4999,9 @@ done:
if (creation_feedback) {
*creation_feedback->pPipelineCreationFeedback = pipeline_feedback;
assert(stageCount == creation_feedback->pipelineStageCreationFeedbackCount);
for (uint32_t i = 0; i < stageCount; i++) {
uint32_t stage_count = creation_feedback->pipelineStageCreationFeedbackCount;
assert(stage_count == 0 || stageCount == stage_count);
for (uint32_t i = 0; i < stage_count; i++) {
gl_shader_stage s = vk_to_mesa_shader_stage(pStages[i].stage);
creation_feedback->pPipelineStageCreationFeedbacks[i] = stages[s].feedback;
}