Merge pull request #499 from AndreasReiten/patch-1
Fix for multisample depth resolve attachment and storeOp for the MSAA color attachment
This commit is contained in:
commit
dd0ec84481
1 changed files with 3 additions and 14 deletions
|
|
@ -211,13 +211,13 @@ public:
|
||||||
{
|
{
|
||||||
// Overrides the virtual function of the base class
|
// Overrides the virtual function of the base class
|
||||||
|
|
||||||
std::array<VkAttachmentDescription, 4> attachments = {};
|
std::array<VkAttachmentDescription, 3> attachments = {};
|
||||||
|
|
||||||
// Multisampled attachment that we render to
|
// Multisampled attachment that we render to
|
||||||
attachments[0].format = swapChain.colorFormat;
|
attachments[0].format = swapChain.colorFormat;
|
||||||
attachments[0].samples = sampleCount;
|
attachments[0].samples = sampleCount;
|
||||||
attachments[0].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
attachments[0].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
||||||
attachments[0].storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
attachments[0].storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
||||||
attachments[0].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
attachments[0].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||||
attachments[0].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
attachments[0].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
||||||
attachments[0].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
attachments[0].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||||
|
|
@ -244,16 +244,6 @@ public:
|
||||||
attachments[2].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
attachments[2].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||||
attachments[2].finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
attachments[2].finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||||
|
|
||||||
// Depth resolve attachment
|
|
||||||
attachments[3].format = depthFormat;
|
|
||||||
attachments[3].samples = VK_SAMPLE_COUNT_1_BIT;
|
|
||||||
attachments[3].loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
|
||||||
attachments[3].storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
|
||||||
attachments[3].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
|
||||||
attachments[3].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
|
||||||
attachments[3].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
|
||||||
attachments[3].finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
|
||||||
|
|
||||||
VkAttachmentReference colorReference = {};
|
VkAttachmentReference colorReference = {};
|
||||||
colorReference.attachment = 0;
|
colorReference.attachment = 0;
|
||||||
colorReference.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
colorReference.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||||
|
|
@ -311,14 +301,13 @@ public:
|
||||||
{
|
{
|
||||||
// Overrides the virtual function of the base class
|
// Overrides the virtual function of the base class
|
||||||
|
|
||||||
std::array<VkImageView, 4> attachments;
|
std::array<VkImageView, 3> attachments;
|
||||||
|
|
||||||
setupMultisampleTarget();
|
setupMultisampleTarget();
|
||||||
|
|
||||||
attachments[0] = multisampleTarget.color.view;
|
attachments[0] = multisampleTarget.color.view;
|
||||||
// attachment[1] = swapchain image
|
// attachment[1] = swapchain image
|
||||||
attachments[2] = multisampleTarget.depth.view;
|
attachments[2] = multisampleTarget.depth.view;
|
||||||
attachments[3] = depthStencil.view;
|
|
||||||
|
|
||||||
VkFramebufferCreateInfo frameBufferCreateInfo = {};
|
VkFramebufferCreateInfo frameBufferCreateInfo = {};
|
||||||
frameBufferCreateInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
|
frameBufferCreateInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue