diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index e8aa9eb526..a43849aa76 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -5311,7 +5311,6 @@ static VkResult d3d12_pipeline_state_link_pipeline_variant(struct d3d12_pipeline memset(&create_info, 0, sizeof(create_info)); create_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; - create_info.pNext = &library_info; create_info.flags = graphics->library_create_flags; create_info.layout = graphics->pipeline_layout; create_info.basePipelineIndex = -1; @@ -5325,6 +5324,8 @@ static VkResult d3d12_pipeline_state_link_pipeline_variant(struct d3d12_pipeline if (!key) create_info.flags |= VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT; + vk_prepend_struct(&create_info, &library_info); + vr = VK_CALL(vkCreateGraphicsPipelines(state->device->vk_device, vk_cache, 1, &create_info, NULL, vk_pipeline)); @@ -5404,7 +5405,7 @@ VkPipeline d3d12_pipeline_state_create_pipeline_variant(struct d3d12_pipeline_st memset(&pipeline_desc, 0, sizeof(pipeline_desc)); pipeline_desc.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; - pipeline_desc.pNext = &fragment_output_desc.rt_info; + vk_prepend_struct(&pipeline_desc, &fragment_output_desc.rt_info); pipeline_desc.stageCount = graphics->stage_count; pipeline_desc.pStages = graphics->stages; pipeline_desc.pViewportState = &vp_desc; @@ -5437,15 +5438,13 @@ VkPipeline d3d12_pipeline_state_create_pipeline_variant(struct d3d12_pipeline_st TRACE("Compiling pipeline library for %p with flags %#x.\n", state, library_flags); library_create_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT; - /* Explicit cast to silence a constness warning, this seems to be a Vulkan header bug */ - library_create_info.pNext = (void*)pipeline_desc.pNext; library_create_info.flags = library_flags; - pipeline_desc.pNext = &library_create_info; pipeline_desc.flags |= VK_PIPELINE_CREATE_LIBRARY_BIT_KHR | VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT; graphics->library_flags = library_flags; + vk_prepend_struct(&pipeline_desc, &library_create_info); } /* A workaround for SottR, which creates pipelines with DSV_UNKNOWN, but still insists on using a depth buffer. @@ -5504,11 +5503,11 @@ VkPipeline d3d12_pipeline_state_create_pipeline_variant(struct d3d12_pipeline_st if (vkd3d_config_flags & VKD3D_CONFIG_FLAG_PIPELINE_LIBRARY_LOG) { feedback_info.sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT; - feedback_info.pNext = pipeline_desc.pNext; feedback_info.pPipelineStageCreationFeedbacks = feedbacks; feedback_info.pipelineStageCreationFeedbackCount = pipeline_desc.stageCount; feedback_info.pPipelineCreationFeedback = &feedback; - pipeline_desc.pNext = &feedback_info; + + vk_prepend_struct(&pipeline_desc, &feedback_info); } else feedback_info.pipelineStageCreationFeedbackCount = 0;