Józef Kucia : libs/vkd3d: Validate PrimitiveTopologyType for PSO with tessellation shaders.
Module: vkd3d Branch: master Commit: b7d2278f5706737cfed34a3557827ace6be8e62c URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=b7d2278f5706737cfed34a35... Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Jul 18 12:05:46 2018 +0200 libs/vkd3d: Validate PrimitiveTopologyType for PSO with tessellation shaders. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d/state.c | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 861f5bb..973caee 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -1969,22 +1969,43 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s if (shader_info.uav_counter_mask) FIXME("UAV counters not implemented for graphics pipelines.\n"); - if (shader_stages[i].stage == VK_SHADER_STAGE_FRAGMENT_BIT) - compile_args = &ps_compile_args; - else - compile_args = NULL; + compile_args = NULL; + switch (shader_stages[i].stage) + { + case VK_SHADER_STAGE_VERTEX_BIT: + if ((ret = vkd3d_shader_parse_input_signature(&dxbc, &input_signature)) < 0) + { + hr = hresult_from_vkd3d_result(ret); + goto fail; + } + break; + + case VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT: + case VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT: + if (desc->PrimitiveTopologyType != D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH) + { + WARN("D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH must be used with tessellation shaders.\n"); + hr = E_INVALIDARG; + goto fail; + } + break; + + case VK_SHADER_STAGE_GEOMETRY_BIT: + break; + + case VK_SHADER_STAGE_FRAGMENT_BIT: + compile_args = &ps_compile_args; + break; + + default: + hr = E_INVALIDARG; + goto fail; + } if (FAILED(hr = create_shader_stage(device, &graphics->stages[graphics->stage_count], shader_stages[i].stage, b, &shader_interface, compile_args))) goto fail; - if (shader_stages[i].stage == VK_SHADER_STAGE_VERTEX_BIT - && (ret = vkd3d_shader_parse_input_signature(&dxbc, &input_signature)) < 0) - { - hr = hresult_from_vkd3d_result(ret); - goto fail; - } - ++graphics->stage_count; }
participants (1)
-
Alexandre Julliard