fixed some validation bugs
authorJohn Tsiombikas <nuclear@member.fsf.org>
Fri, 7 Apr 2023 18:22:25 +0000 (21:22 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Fri, 7 Apr 2023 18:22:25 +0000 (21:22 +0300)
src/app.c
src/vk.c

index 7fc68bd..bc931d1 100644 (file)
--- a/src/app.c
+++ b/src/app.c
@@ -92,7 +92,7 @@ void app_display(void)
                rpbegin.framebuffer = vk_fb(fb[imgid]);
                vk_rect(&rpbegin.renderArea, 0, 0, win_width, win_height);
                rpbegin.pClearValues = clear;
-               rpbegin.clearValueCount = 2;
+               rpbegin.clearValueCount = 1;
 
                vkCmdBeginRenderPass(cmdbuf, &rpbegin, VK_SUBPASS_CONTENTS_INLINE);
 
@@ -107,18 +107,23 @@ void app_display(void)
 
        /* swap buffers after drawing is finished */
        vk_present(queue, imgid, sem_draw);
+
+       usleep(10000);
 }
 
 void app_reshape(int x, int y)
 {
        int i;
 
+       return; /* XXX */
+
        if(vk_reshape(x, y) == -1) {
                abort();
        }
 
        for(i=0; i<vk_num_swap_images(); i++) {
                vk_fb_size(fb[i], x, y);
+               vk_fb_images(fb[i], 1, vk_swap_image(i));
        }
 }
 
index 29628f9..3ea0060 100644 (file)
--- a/src/vk.c
+++ b/src/vk.c
@@ -511,6 +511,7 @@ VkRenderPass vk_rpass(int rp)
                        att[i].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
                        att[i].finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
                }
+               /*
                att[zidx].format = r->zfmt;
                att[zidx].samples = 1;
                att[zidx].loadOp = r->clear ? VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_DONT_CARE;
@@ -519,23 +520,26 @@ VkRenderPass vk_rpass(int rp)
                att[zidx].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
                att[zidx].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
                att[zidx].finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
+               */
 
                for(i=0; i<r->num_colbuf; i++) {
                        catref[i].attachment = i;
                        catref[i].layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
                }
+               /*
                zatref.attachment = zidx;
                zatref.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
+               */
 
                memset(&subpass, 0, sizeof subpass);
                subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
                subpass.colorAttachmentCount = r->num_colbuf;
                subpass.pColorAttachments = catref;
-               subpass.pDepthStencilAttachment = &zatref;
+               subpass.pDepthStencilAttachment = 0;//&zatref;
 
                memset(&pinf, 0, sizeof pinf);
                pinf.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
-               pinf.attachmentCount = r->num_colbuf + 1;
+               pinf.attachmentCount = r->num_colbuf;// + 1;
                pinf.pAttachments = att;
                pinf.subpassCount = 1;
                pinf.pSubpasses = &subpass;
@@ -660,6 +664,7 @@ VkFramebuffer vk_fb(int fb)
                fbinf.pAttachments = f->imgv;
                fbinf.width = f->width;
                fbinf.height = f->height;
+               fbinf.layers = 1;
 
                if(vkCreateFramebuffer(vkdev, &fbinf, 0, &f->vkobj) != 0) {
                        fprintf(stderr, "vk_fb: failed to create framebuffer\n");
@@ -1079,6 +1084,7 @@ void vk_rect(VkRect2D *r, int x, int y, int w, int h)
 
 #define ARRSZ(arr)     (sizeof arr / sizeof *arr)
 static const char *known_layer_list[] = {
+       "VK_LAYER_KHRONOS_validation",
        "VK_LAYER_GOOGLE_threading",
        "VK_LAYER_LUNARG_parameter_validation",
        "VK_LAYER_LUNARG_object_tracker",