turnip: save attachment samples in renderpass state
authorJonathan Marek <jonathan@marek.ca>
Wed, 8 Apr 2020 02:23:27 +0000 (22:23 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 9 Apr 2020 14:43:02 +0000 (14:43 +0000)
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 <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3783>

src/freedreno/vulkan/tu_pass.c
src/freedreno/vulkan/tu_private.h

index dd792762822f63e960affe4d8250ebce275e6c9e..e8d47b8f20b1d41d051920f03f41e60219e9ef4f 100644 (file)
@@ -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;
index 1c4f978029d892a4f745095cf432613d53b531e9..583c38a0a0473915349f7d82a0b277c52b6af5f7 100644 (file)
@@ -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;