Use swapchain colorformat instead of fixed format (Refs #238, Fixes #254)

This commit is contained in:
saschawillems 2017-01-25 18:54:09 +01:00
parent 127ed7b483
commit 9a59b24c8d
6 changed files with 11 additions and 14 deletions

View file

@ -183,7 +183,7 @@ void VulkanExampleBase::prepare()
vulkanDevice,
queue,
frameBuffers,
colorformat,
swapChain.colorFormat,
depthFormat,
&width,
&height,
@ -1466,7 +1466,7 @@ void VulkanExampleBase::setupRenderPass()
{
std::array<VkAttachmentDescription, 2> attachments = {};
// Color attachment
attachments[0].format = colorformat;
attachments[0].format = swapChain.colorFormat;
attachments[0].samples = VK_SAMPLE_COUNT_1_BIT;
attachments[0].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
attachments[0].storeOp = VK_ATTACHMENT_STORE_OP_STORE;