diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-03-18 18:33:20 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-09-13 17:04:58 +0300 |
commit | 473c5df34d18213254f010b90a2023405b014914 (patch) | |
tree | 6df97bbbf42ced04a9928261904691409b5e915e | |
parent | 787a46fe64c1b1b45f0d85caef17a444836f3db9 (diff) |
vkd3d: Ensure shader interface is set up per vkd3d_create_shader_stage.
Prepares for a situation where we can move this code into
vkd3d_create_shader_stage itself.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
-rw-r--r-- | libs/vkd3d/state.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index cace2b20..d4296932 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -3136,7 +3136,6 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s uint32_t instance_divisors[D3D12_VS_INPUT_REGISTER_COUNT]; uint32_t aligned_offsets[D3D12_VS_INPUT_REGISTER_COUNT]; struct vkd3d_shader_transform_feedback_info xfb_info; - struct vkd3d_shader_interface_info shader_interface; bool have_attachment, can_compile_pipeline_early; struct vkd3d_shader_stage_io_map ms_ps_interface; struct vkd3d_shader_signature output_signature; @@ -3376,9 +3375,6 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s xfb_stage = VK_SHADER_STAGE_VERTEX_BIT; } - /* Stage / XFB info are overridden later. */ - d3d12_pipeline_state_init_shader_interface(state, device, VK_SHADER_STAGE_ALL, &shader_interface); - graphics->patch_vertex_count = 0; for (i = 0; i < ARRAY_SIZE(shader_stages); ++i) @@ -3466,11 +3462,15 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s for (i = 0; i < ARRAY_SIZE(shader_stages); i++) { const D3D12_SHADER_BYTECODE *b = (const void *)((uintptr_t)desc + shader_stages[i].offset); + struct vkd3d_shader_interface_info shader_interface; struct vkd3d_shader_compile_arguments compile_args; if (!(graphics->stage_flags & shader_stages[i].stage)) continue; + /* TODO: Move this to vkd3d_create_shader_stage itself. */ + d3d12_pipeline_state_init_shader_interface(state, device, shader_stages[i].stage, &shader_interface); + if (shader_stages[i].stage == VK_SHADER_STAGE_MESH_BIT_EXT) { shader_interface.stage_output_map = &ms_ps_interface; @@ -3489,8 +3489,6 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s } shader_interface.xfb_info = shader_stages[i].stage == xfb_stage ? &xfb_info : NULL; - shader_interface.stage = shader_stages[i].stage; - d3d12_pipeline_state_init_compile_arguments(state, device, shader_interface.stage, &compile_args); if (FAILED(hr = vkd3d_create_shader_stage(device, |