tu: Fix layer_count with dynamic rendering + multiview

With "classic" renderpasses, the VkFramebuffer's layerCount must be 1 if
multiview is enabled. We accidentally rely on this to not disable GMEM
for multiview, and possibly for other things too. Apparently the dynamic
rendering equivalent, VkRenderingInfo::layerCount, can be anything when
multiview is enabled, and some CTS tests set it to the number of views.
Sanitize it when constructing the internal framebuffer for dynamic
rendering.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34080>
(cherry picked from commit 15660caa90)
This commit is contained in:
Connor Abbott 2025-03-14 17:40:28 -04:00 committed by Eric Engestrom
parent 0a63b3db7a
commit 773a873c5f
2 changed files with 3 additions and 2 deletions

View file

@ -954,7 +954,7 @@
"description": "tu: Fix layer_count with dynamic rendering + multiview",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -3319,7 +3319,8 @@ tu_setup_dynamic_framebuffer(struct tu_cmd_buffer *cmd_buffer,
pRenderingInfo->renderArea.extent.width;
framebuffer->height = pRenderingInfo->renderArea.offset.y +
pRenderingInfo->renderArea.extent.height;
framebuffer->layers = pRenderingInfo->layerCount;
framebuffer->layers =
pRenderingInfo->viewMask != 0 ? 1 : pRenderingInfo->layerCount;
tu_framebuffer_tiling_config(framebuffer, cmd_buffer->device, pass);
}