Only resolve color attachment (Closes #197, Closes #293)

This commit is contained in:
saschawillems 2017-03-31 17:02:58 +02:00
parent 1d549acf46
commit 3f12714085

View file

@ -25,7 +25,7 @@
#define VERTEX_BUFFER_BIND_ID 0 #define VERTEX_BUFFER_BIND_ID 0
#define ENABLE_VALIDATION false #define ENABLE_VALIDATION false
#define SAMPLE_COUNT VK_SAMPLE_COUNT_4_BIT #define SAMPLE_COUNT VK_SAMPLE_COUNT_8_BIT
struct { struct {
struct { struct {
@ -278,19 +278,17 @@ public:
depthReference.attachment = 2; depthReference.attachment = 2;
depthReference.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; depthReference.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
// Two resolve attachment references for color and depth // Resolve attachment reference for the color attachment
std::array<VkAttachmentReference,2> resolveReferences = {}; VkAttachmentReference resolveReference = {};
resolveReferences[0].attachment = 1; resolveReference.attachment = 1;
resolveReferences[0].layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; resolveReference.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
resolveReferences[1].attachment = 3;
resolveReferences[1].layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
VkSubpassDescription subpass = {}; VkSubpassDescription subpass = {};
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
subpass.colorAttachmentCount = 1; subpass.colorAttachmentCount = 1;
subpass.pColorAttachments = &colorReference; subpass.pColorAttachments = &colorReference;
// Pass our resolve attachments to the sub pass // Pass our resolve attachments to the sub pass
subpass.pResolveAttachments = resolveReferences.data(); subpass.pResolveAttachments = &resolveReference;
subpass.pDepthStencilAttachment = &depthReference; subpass.pDepthStencilAttachment = &depthReference;
std::array<VkSubpassDependency, 2> dependencies; std::array<VkSubpassDependency, 2> dependencies;