backup
[demo] / src / vulkan / vk.cc
index 8ddea09..654165b 100644 (file)
@@ -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;