=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: vkd3d-shader: Unset r# registers state while leaving current shader phase.

Alexandre Julliard julliard at winehq.org
Thu Feb 7 16:08:54 CST 2019


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Feb  7 09:59:19 2019 +0100

vkd3d-shader: Unset r# registers state while leaving current shader phase.

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-shader/spirv.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index 3a80925..8f9fff7 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -3980,6 +3980,7 @@ static void vkd3d_dxbc_compiler_emit_dcl_temps(struct vkd3d_dxbc_compiler *compi
     function_location = vkd3d_dxbc_compiler_get_current_function_location(compiler);
     vkd3d_spirv_begin_function_stream_insertion(builder, function_location);
 
+    assert(!compiler->temp_count);
     compiler->temp_count = instruction->declaration.count;
     for (i = 0; i < compiler->temp_count; ++i)
     {
@@ -4810,15 +4811,24 @@ static void vkd3d_dxbc_compiler_emit_dcl_thread_group(struct vkd3d_dxbc_compiler
             SpvExecutionModeLocalSize, local_size, ARRAY_SIZE(local_size));
 }
 
+static void vkd3d_dxbc_compiler_leave_shader_phase(struct vkd3d_dxbc_compiler *compiler)
+{
+    struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
+
+    vkd3d_spirv_build_op_function_end(builder);
+
+    compiler->temp_id = 0;
+    compiler->temp_count = 0;
+}
+
 static void vkd3d_dxbc_compiler_enter_shader_phase(struct vkd3d_dxbc_compiler *compiler,
         const struct vkd3d_shader_instruction *instruction)
 {
-    struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
     struct vkd3d_shader_phase *phase;
     unsigned int idx;
 
     if ((idx = compiler->shader_phase_count))
-        vkd3d_spirv_build_op_function_end(builder);
+        vkd3d_dxbc_compiler_leave_shader_phase(compiler);
 
     if (!vkd3d_array_reserve((void **)&compiler->shader_phases, &compiler->shader_phases_size,
             compiler->shader_phase_count + 1, sizeof(*compiler->shader_phases)))




More information about the wine-cvs mailing list