Henri Verbeet : vkd3d-shader: Avoid declaring outputs multiple times with incompatible types.

Alexandre Julliard julliard at winehq.org
Fri Dec 6 15:35:39 CST 2019


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Dec  6 22:51:19 2019 +0330

vkd3d-shader: Avoid declaring outputs multiple times with incompatible types.

This would cause CoreValidation-Shader-InterfaceTypeMismatch validation
errors from Wine's test_shader_interstage_interface() d3d11 test. This
reverts parts of commits 1eb7eca411f71d8dec7cfae5c58c1dff9626a7e0 and
04ec461fb4224e126d271760123bb6d756c06582.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 libs/vkd3d-shader/spirv.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index a949e4a..40280eb 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -4438,8 +4438,13 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler
         {
             use_private_variable = true;
             write_mask = VKD3DSP_WRITEMASK_ALL;
+            entry = rb_get(&compiler->symbol_table, &reg_symbol);
         }
     }
+    else if (!use_private_variable && (entry = rb_get(&compiler->symbol_table, &reg_symbol)))
+    {
+        id = RB_ENTRY_VALUE(entry, const struct vkd3d_symbol, entry)->id;
+    }
     else
     {
         if (builtin)
@@ -4487,15 +4492,15 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler
             vkd3d_spirv_build_op_decorate(builder, id, SpvDecorationPatch, NULL, 0);
 
         vkd3d_dxbc_compiler_decorate_xfb_output(compiler, id, output_component_count, signature_element);
-
-        compiler->output_info[signature_idx].id = id;
-        compiler->output_info[signature_idx].component_type = component_type;
     }
 
+    compiler->output_info[signature_idx].id = id;
+    compiler->output_info[signature_idx].component_type = component_type;
+
     if (use_private_variable)
         storage_class = SpvStorageClassPrivate;
 
-    if ((entry = rb_get(&compiler->symbol_table, &reg_symbol)))
+    if (entry)
         var_id = RB_ENTRY_VALUE(entry, const struct vkd3d_symbol, entry)->id;
     else if (!use_private_variable)
         var_id = id;




More information about the wine-cvs mailing list