=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: libs/vkd3d: Validate PrimitiveTopologyType for PSO with tessellation shaders.

Alexandre Julliard julliard at winehq.org
Wed Jul 18 10:57:19 CDT 2018


Module: vkd3d
Branch: master
Commit: b7d2278f5706737cfed34a3557827ace6be8e62c
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=b7d2278f5706737cfed34a3557827ace6be8e62c

Author: Józef Kucia <jkucia at 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 at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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;
     }
 




More information about the wine-cvs mailing list