X-Git-Url: https://eleni.mutantstargoat.com/git/?p=demo;a=blobdiff_plain;f=src%2Fvulkan%2Fvk.cc;fp=src%2Fvulkan%2Fvk.cc;h=654165be411025b83915710d973621be8f9734ee;hp=8ddea099f798d508de95fdd547121770493c2584;hb=dbce2a319517c09fcf1a9be60ae46a0ff20c423e;hpb=86c912d603be75ac8b2fdb2229f1696e9c0c01d9 diff --git a/src/vulkan/vk.cc b/src/vulkan/vk.cc index 8ddea09..654165b 100644 --- a/src/vulkan/vk.cc +++ b/src/vulkan/vk.cc @@ -32,8 +32,6 @@ static const VkFormat dformat = VK_FORMAT_D32_SFLOAT_S8_UINT; static VkImage *images; static VkImageView *iviews; static uint32_t num_images; -//renderpass -static VkRenderPass rpass; static VkFramebuffer fbs[2]; //semaphores-drawing-presentation static uint32_t curr_img; // current sc image @@ -433,8 +431,8 @@ static bool create_renderpass() rinf.subpassCount = 1; rinf.pSubpasses = &sd; - if(vkCreateRenderPass(vk_device, &rinf, 0, &rpass) != VK_SUCCESS) { - fprintf(stderr, "Failed to create rpass.\n"); + if(vkCreateRenderPass(vk_device, &rinf, 0, &vk_renderpass) != VK_SUCCESS) { + fprintf(stderr, "Failed to create render pass.\n"); return false; } @@ -450,7 +448,7 @@ static bool create_framebuffers() VkFramebufferCreateInfo fbinf; memset(&fbinf, 0, sizeof fbinf); fbinf.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; - fbinf.renderPass = rpass; + fbinf.renderPass = vk_renderpass; fbinf.attachmentCount = 2; fbinf.pAttachments = fb_att; fbinf.width = win_w; @@ -551,7 +549,7 @@ static bool begin_rendering_command_buffers(VkCommandBuffer *bufs, int count) VkRenderPassBeginInfo rbinf; memset(&rbinf, 0, sizeof rbinf); rbinf.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; - rbinf.renderPass = rpass; + rbinf.renderPass = vk_renderpass; rbinf.framebuffer = fbs[i]; rbinf.renderArea.extent.width = win_w; rbinf.renderArea.extent.height = win_h;