From: John Tsiombikas Date: Thu, 19 Sep 2024 07:06:56 +0000 (+0300) Subject: fucking finally "raw" parity X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=2a9bf6a96be9a9f566b7fbedc930558b8528c7e3;p=vktest3 fucking finally "raw" parity --- diff --git a/src/app.c b/src/app.c index 4bece43..41779d6 100644 --- 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; diff --git a/src/vk.c b/src/vk.c index e10cce1..c6c5c4b 100644 --- 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; isdr[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);