From: Jonathan Marek Date: Wed, 8 Apr 2020 02:23:27 +0000 (-0400) Subject: turnip: save attachment samples in renderpass state X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ed83281f0cd1d4c60106410c0b897d6db3280e50;p=mesa.git turnip: save attachment samples in renderpass state This is needed to be able to know the number of samples during CmdClearAttachments which can be used while the framebuffer is unknown. Signed-off-by: Jonathan Marek Part-of: --- diff --git a/src/freedreno/vulkan/tu_pass.c b/src/freedreno/vulkan/tu_pass.c index dd792762822..e8d47b8f20b 100644 --- a/src/freedreno/vulkan/tu_pass.c +++ b/src/freedreno/vulkan/tu_pass.c @@ -115,8 +115,8 @@ tu_CreateRenderPass(VkDevice _device, struct tu_render_pass_attachment *att = &pass->attachments[i]; att->format = pCreateInfo->pAttachments[i].format; - att->cpp = vk_format_get_blocksize(att->format) * - pCreateInfo->pAttachments[i].samples; + att->samples = pCreateInfo->pAttachments[i].samples; + att->cpp = vk_format_get_blocksize(att->format) * att->samples; att->load_op = pCreateInfo->pAttachments[i].loadOp; att->stencil_load_op = pCreateInfo->pAttachments[i].stencilLoadOp; att->store_op = pCreateInfo->pAttachments[i].storeOp; @@ -243,8 +243,8 @@ tu_CreateRenderPass2(VkDevice _device, struct tu_render_pass_attachment *att = &pass->attachments[i]; att->format = pCreateInfo->pAttachments[i].format; - att->cpp = vk_format_get_blocksize(att->format) * - pCreateInfo->pAttachments[i].samples; + att->samples = pCreateInfo->pAttachments[i].samples; + att->cpp = vk_format_get_blocksize(att->format) * att->samples; att->load_op = pCreateInfo->pAttachments[i].loadOp; att->stencil_load_op = pCreateInfo->pAttachments[i].stencilLoadOp; att->store_op = pCreateInfo->pAttachments[i].storeOp; diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h index 1c4f978029d..583c38a0a04 100644 --- a/src/freedreno/vulkan/tu_private.h +++ b/src/freedreno/vulkan/tu_private.h @@ -1577,6 +1577,7 @@ struct tu_subpass struct tu_render_pass_attachment { VkFormat format; + uint32_t samples; uint32_t cpp; VkAttachmentLoadOp load_op; VkAttachmentLoadOp stencil_load_op;