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");
}
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;
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;
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++;
}
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);