From: Philip Rebohle Subject: [PATCH vkd3d 02/11] vkd3d-shader: Don't fetch output variable id before writing output info. Message-Id: <20191016195544.23720-3-philip.rebohle@tu-dortmund.de> Date: Wed, 16 Oct 2019 21:55:36 +0200 In-Reply-To: <20191016195544.23720-1-philip.rebohle@tu-dortmund.de> References: <20191016195544.23720-1-philip.rebohle@tu-dortmund.de> 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 --- libs/vkd3d-shader/spirv.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 4b93e01..1598ae0 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -4343,10 +4343,6 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler entry = rb_get(&compiler->symbol_table, ®_symbol); } } - else if ((entry = rb_get(&compiler->symbol_table, ®_symbol))) - { - id = RB_ENTRY_VALUE(entry, const struct vkd3d_symbol, entry)->id; - } else { if (builtin) @@ -4393,7 +4389,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, ®_symbol))) var_id = RB_ENTRY_VALUE(entry, const struct vkd3d_symbol, entry)->id; else if (!use_private_variable) var_id = id; -- 2.23.0