328 VkDescriptorSetLayout desc_set_layouts[] = {
332 .setLayoutCount =
LENGTH(desc_set_layouts),
333 .pSetLayouts = desc_set_layouts
339 .setLayoutCount =
LENGTH(desc_set_layouts),
340 .pSetLayouts = desc_set_layouts
343 VkPipelineShaderStageCreateInfo shader_info[] = {
344 SHADER_STAGE(QVK_MOD_STRETCH_PIC_VERT, VK_SHADER_STAGE_VERTEX_BIT),
345 SHADER_STAGE(QVK_MOD_STRETCH_PIC_FRAG, VK_SHADER_STAGE_FRAGMENT_BIT)
348 VkPipelineVertexInputStateCreateInfo vertex_input_info = {
349 .sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
350 .vertexBindingDescriptionCount = 0,
351 .pVertexBindingDescriptions = NULL,
352 .vertexAttributeDescriptionCount = 0,
353 .pVertexAttributeDescriptions = NULL,
356 VkPipelineInputAssemblyStateCreateInfo input_assembly_info = {
357 .sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,
358 .topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP,
359 .primitiveRestartEnable = VK_FALSE,
362 VkViewport viewport = {
376 VkPipelineViewportStateCreateInfo viewport_state = {
377 .sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,
379 .pViewports = &viewport,
381 .pScissors = &scissor,
384 VkPipelineRasterizationStateCreateInfo rasterizer_state = {
385 .sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
386 .depthClampEnable = VK_FALSE,
387 .rasterizerDiscardEnable = VK_FALSE,
388 .polygonMode = VK_POLYGON_MODE_FILL,
390 .cullMode = VK_CULL_MODE_BACK_BIT,
391 .frontFace = VK_FRONT_FACE_CLOCKWISE,
392 .depthBiasEnable = VK_FALSE,
393 .depthBiasConstantFactor = 0.0f,
394 .depthBiasClamp = 0.0f,
395 .depthBiasSlopeFactor = 0.0f,
398 VkPipelineMultisampleStateCreateInfo multisample_state = {
399 .sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
400 .sampleShadingEnable = VK_FALSE,
401 .rasterizationSamples = VK_SAMPLE_COUNT_1_BIT,
402 .minSampleShading = 1.0f,
404 .alphaToCoverageEnable = VK_FALSE,
405 .alphaToOneEnable = VK_FALSE,
408 VkPipelineColorBlendAttachmentState color_blend_attachment = {
409 .colorWriteMask = VK_COLOR_COMPONENT_R_BIT
410 | VK_COLOR_COMPONENT_G_BIT
411 | VK_COLOR_COMPONENT_B_BIT
412 | VK_COLOR_COMPONENT_A_BIT,
413 .blendEnable = VK_TRUE,
414 .srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA,
415 .dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
416 .colorBlendOp = VK_BLEND_OP_ADD,
417 .srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE,
418 .dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO,
419 .alphaBlendOp = VK_BLEND_OP_ADD,
422 VkPipelineColorBlendStateCreateInfo color_blend_state = {
423 .sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
424 .logicOpEnable = VK_FALSE,
425 .logicOp = VK_LOGIC_OP_COPY,
426 .attachmentCount = 1,
427 .pAttachments = &color_blend_attachment,
428 .blendConstants = { 0.0f, 0.0f, 0.0f, 0.0f },
431 VkGraphicsPipelineCreateInfo pipeline_info = {
432 .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
433 .stageCount =
LENGTH(shader_info),
434 .pStages = shader_info,
436 .pVertexInputState = &vertex_input_info,
437 .pInputAssemblyState = &input_assembly_info,
438 .pViewportState = &viewport_state,
439 .pRasterizationState = &rasterizer_state,
440 .pMultisampleState = &multisample_state,
441 .pDepthStencilState = NULL,
442 .pColorBlendState = &color_blend_state,
443 .pDynamicState = NULL,
449 .basePipelineHandle = VK_NULL_HANDLE,
450 .basePipelineIndex = -1,
457 VkPipelineShaderStageCreateInfo shader_info_final_blit[] = {
458 SHADER_STAGE(QVK_MOD_FINAL_BLIT_VERT, VK_SHADER_STAGE_VERTEX_BIT),
459 SHADER_STAGE(QVK_MOD_FINAL_BLIT_LANCZOS_FRAG, VK_SHADER_STAGE_FRAGMENT_BIT)
462 pipeline_info.pStages = shader_info_final_blit;
470 VkImageView attachments[] = {
474 VkFramebufferCreateInfo fb_create_info = {
475 .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,
477 .attachmentCount = 1,
478 .pAttachments = attachments,