fucking finally "raw" parity master
authorJohn Tsiombikas <nuclear@member.fsf.org>
Thu, 19 Sep 2024 07:06:56 +0000 (10:06 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Thu, 19 Sep 2024 07:06:56 +0000 (10:06 +0300)
src/app.c
src/vk.c

index 4bece43..41779d6 100644 (file)
--- a/src/app.c
+++ b/src/app.c
@@ -74,6 +74,7 @@ int app_init(void)
        pipeln = vk_create_pipeln();
        vk_pipeln_rpass(pipeln, vk_rpass(rpass));
        vk_pipeln_viewport(pipeln, 0, 0, win_width, win_height);
+       vk_pipeln_scissor(pipeln, 0, 0, win_width, win_height);
 
        if(!(vsdr = vk_load_shader("sdr/sdr.v.spv")) || !(psdr = vk_load_shader("sdr/sdr.p.spv"))) {
                fprintf(stderr, "failed to load shaders\n");
@@ -81,6 +82,8 @@ int app_init(void)
        }
        vk_pipeln_shader(pipeln, VKSDR_VERTEX, vsdr);
        vk_pipeln_shader(pipeln, VKSDR_PIXEL, psdr);
+       vk_pipeln_zbuffer(pipeln, 0);
+       vk_pipeln_frontface(pipeln, VK_FRONT_FACE_CLOCKWISE);
 
        sem_draw = vk_create_sem();
        return 0;
@@ -134,9 +137,9 @@ void app_display(void)
                        abort();
                }
 
-               clear[0].color.float32[0] = 0.5f;
-               clear[0].color.float32[1] = 0.1f;
-               clear[0].color.float32[2] = 0.2f;
+               clear[0].color.float32[0] = 0.16f;
+               clear[0].color.float32[1] = 0.16f;
+               clear[0].color.float32[2] = 0.16f;
                clear[0].color.float32[3] = 1.0f;
                clear[1].depthStencil.depth = 1.0f;
                clear[1].depthStencil.stencil = 0;
index e10cce1..c6c5c4b 100644 (file)
--- a/src/vk.c
+++ b/src/vk.c
@@ -951,10 +951,10 @@ VkPipeline vk_pipeln(int pp)
        memset(ssinf, 0, sizeof ssinf);
        idx = 0;
        for(i=0; i<VKSDR_MAX; i++) {
-               if(p->sdr[idx]) {
+               if(p->sdr[i]) {
                        ssinf[idx].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
                        ssinf[idx].stage = VKSDR_STAGE(i);
-                       ssinf[idx].module = p->sdr[idx];
+                       ssinf[idx].module = p->sdr[i];
                        ssinf[idx].pName = "main";
                        idx++;
                }
@@ -1185,15 +1185,15 @@ static int create_instance(void)
        const char *ext[ARRSZ(known_instext_list)];
        uint32_t apiver;
 
-       vkEnumerateInstanceVersion(&apiver);
+       /*vkEnumerateInstanceVersion(&apiver);
        printf("Vulkan API version: %d.%d.%d\n", (apiver >> 22) & 0x7f,
-                       (apiver >> 12) & 0x3ff, apiver & 0xfff);
+                       (apiver >> 12) & 0x3ff, apiver & 0xfff);*/
 
        memset(&appinf, 0, sizeof appinf);
        appinf.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
        appinf.pApplicationName = "vkray";
        appinf.pEngineName = "vkray";
-       appinf.apiVersion = apiver;
+       appinf.apiVersion = VK_API_VERSION_1_2;
 
        vkEnumerateInstanceLayerProperties(&inst_layers_count, 0);
        inst_layers = malloc_nf(inst_layers_count * sizeof *inst_layers);