diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2018-03-01 13:55:09 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2018-03-01 14:43:16 +0000 |
commit | 031baef75930430617fc14fe415621d7d9683859 (patch) | |
tree | b245a52d4aceee70f7745460eff6bd31c15a8863 | |
parent | 78783f5a641e4429a61cf13251777502427db510 (diff) | |
download | vulkan-031baef75930430617fc14fe415621d7d9683859.tar.gz vulkan-031baef75930430617fc14fe415621d7d9683859.tar.xz vulkan-031baef75930430617fc14fe415621d7d9683859.zip |
swapchain: store format and pass extent to fix creation
The swapchain creation omitted setting the swp->format field. The
swapchain was also not being given an image extent.
-rw-r--r-- | vulkan.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -351,6 +351,7 @@ static void createswp(struct swp *swp, VkSurfaceKHR surf, VkDevice dev, const in assert(sdtl != NULL); fmt = getswpfmt(&sdtl->fmts); + swp->format = fmt.format; pmode = getswppmode(&sdtl->pmodes); swp->extent = getswpextent(&sdtl->caps); swp->imgs.count = sdtl->caps.minImageCount + 1; @@ -363,8 +364,9 @@ static void createswp(struct swp *swp, VkSurfaceKHR surf, VkDevice dev, const in .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, .surface = surf, .minImageCount = swp->imgs.count, - .imageFormat = fmt.format, + .imageFormat = swp->format, .imageColorSpace = fmt.colorSpace, + .imageExtent = swp->extent, .imageArrayLayers = 1, .imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, .imageSharingMode = qf[QF_GRAPHICS] == qf[QF_PRESENT] |