Philip Rebohle : vkd3d-shader: Don't fetch output variable id before writing output info.

Alexandre Julliard julliard at winehq.org
Sun Oct 27 14:21:20 CDT 2019


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

Author: Philip Rebohle <philip.rebohle at tu-dortmund.de>
Date:   Thu Oct 24 21:16:12 2019 +0330

vkd3d-shader: Don't fetch output variable id before writing output info.

Otherwise, if a private variable is used for the given output,
vkd3d_dxbc_compiler_emit_store_shader_output will write to the
private variable again instead of the actual output, and some
outputs may never be emitted. This is common in hull shaders.

Signed-off-by: Philip Rebohle <philip.rebohle at tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 libs/vkd3d-shader/spirv.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index 4b93e01..0fdfdcd 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -4340,13 +4340,8 @@ 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 ((entry = rb_get(&compiler->symbol_table, &reg_symbol)))
-    {
-        id = RB_ENTRY_VALUE(entry, const struct vkd3d_symbol, entry)->id;
-    }
     else
     {
         if (builtin)
@@ -4393,7 +4388,7 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler
     if (use_private_variable)
         storage_class = SpvStorageClassPrivate;
 
-    if (entry)
+    if ((entry = rb_get(&compiler->symbol_table, &reg_symbol)))
         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