Skip to content

Commit be4d563

Browse files
vkd3d: Use vk_prepend_struct for PSO pNext.
Signed-off-by: Hans-Kristian Arntzen <[email protected]>
1 parent ea18f1f commit be4d563

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

libs/vkd3d/state.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -5311,7 +5311,6 @@ static VkResult d3d12_pipeline_state_link_pipeline_variant(struct d3d12_pipeline
53115311

53125312
memset(&create_info, 0, sizeof(create_info));
53135313
create_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
5314-
create_info.pNext = &library_info;
53155314
create_info.flags = graphics->library_create_flags;
53165315
create_info.layout = graphics->pipeline_layout;
53175316
create_info.basePipelineIndex = -1;
@@ -5325,6 +5324,8 @@ static VkResult d3d12_pipeline_state_link_pipeline_variant(struct d3d12_pipeline
53255324
if (!key)
53265325
create_info.flags |= VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT;
53275326

5327+
vk_prepend_struct(&create_info, &library_info);
5328+
53285329
vr = VK_CALL(vkCreateGraphicsPipelines(state->device->vk_device,
53295330
vk_cache, 1, &create_info, NULL, vk_pipeline));
53305331

@@ -5404,7 +5405,7 @@ VkPipeline d3d12_pipeline_state_create_pipeline_variant(struct d3d12_pipeline_st
54045405

54055406
memset(&pipeline_desc, 0, sizeof(pipeline_desc));
54065407
pipeline_desc.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
5407-
pipeline_desc.pNext = &fragment_output_desc.rt_info;
5408+
vk_prepend_struct(&pipeline_desc, &fragment_output_desc.rt_info);
54085409
pipeline_desc.stageCount = graphics->stage_count;
54095410
pipeline_desc.pStages = graphics->stages;
54105411
pipeline_desc.pViewportState = &vp_desc;
@@ -5437,15 +5438,13 @@ VkPipeline d3d12_pipeline_state_create_pipeline_variant(struct d3d12_pipeline_st
54375438
TRACE("Compiling pipeline library for %p with flags %#x.\n", state, library_flags);
54385439

54395440
library_create_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT;
5440-
/* Explicit cast to silence a constness warning, this seems to be a Vulkan header bug */
5441-
library_create_info.pNext = (void*)pipeline_desc.pNext;
54425441
library_create_info.flags = library_flags;
54435442

5444-
pipeline_desc.pNext = &library_create_info;
54455443
pipeline_desc.flags |= VK_PIPELINE_CREATE_LIBRARY_BIT_KHR |
54465444
VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT;
54475445

54485446
graphics->library_flags = library_flags;
5447+
vk_prepend_struct(&pipeline_desc, &library_create_info);
54495448
}
54505449

54515450
/* 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
55045503
if (vkd3d_config_flags & VKD3D_CONFIG_FLAG_PIPELINE_LIBRARY_LOG)
55055504
{
55065505
feedback_info.sType = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT;
5507-
feedback_info.pNext = pipeline_desc.pNext;
55085506
feedback_info.pPipelineStageCreationFeedbacks = feedbacks;
55095507
feedback_info.pipelineStageCreationFeedbackCount = pipeline_desc.stageCount;
55105508
feedback_info.pPipelineCreationFeedback = &feedback;
5511-
pipeline_desc.pNext = &feedback_info;
5509+
5510+
vk_prepend_struct(&pipeline_desc, &feedback_info);
55125511
}
55135512
else
55145513
feedback_info.pipelineStageCreationFeedbackCount = 0;

0 commit comments

Comments
 (0)