Henri Verbeet : vkd3d-shader: Get rid of the "use_vocp" field in the vkd3d_shader_scan_info structure.

Alexandre Julliard julliard at winehq.org
Tue Jun 30 14:53:05 CDT 2020


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Jun 30 15:20:00 2020 +0430

vkd3d-shader: Get rid of the "use_vocp" field in the vkd3d_shader_scan_info structure.

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

---

 include/vkd3d_shader.h                |  2 --
 libs/vkd3d-shader/spirv.c             |  7 +++++--
 libs/vkd3d-shader/vkd3d_shader_main.c | 12 ------------
 3 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h
index e155663..e7bb925 100644
--- a/include/vkd3d_shader.h
+++ b/include/vkd3d_shader.h
@@ -640,8 +640,6 @@ struct vkd3d_shader_scan_info
 
     struct vkd3d_shader_descriptor_info *descriptors;
     unsigned int descriptor_count;
-
-    bool use_vocp;
 };
 
 enum vkd3d_component_type
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index 0baa191..f058c24 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -2106,6 +2106,7 @@ struct vkd3d_dxbc_compiler
     const struct vkd3d_shader_scan_info *scan_info;
     unsigned int input_control_point_count;
     unsigned int output_control_point_count;
+    bool use_vocp;
 
     unsigned int shader_phase_count;
     struct vkd3d_shader_phase *shader_phases;
@@ -5456,6 +5457,9 @@ static void vkd3d_dxbc_compiler_emit_dcl_input(struct vkd3d_dxbc_compiler *compi
         vkd3d_dxbc_compiler_emit_input(compiler, dst, VKD3D_SIV_NONE, VKD3DSIM_NONE);
     else
         vkd3d_dxbc_compiler_emit_input_register(compiler, dst);
+
+    if (dst->reg.type == VKD3DSPR_OUTCONTROLPOINT)
+        compiler->use_vocp = true;
 }
 
 static void vkd3d_dxbc_compiler_emit_dcl_input_ps(struct vkd3d_dxbc_compiler *compiler,
@@ -5987,7 +5991,6 @@ static void vkd3d_dxbc_compiler_emit_hull_shader_barrier(struct vkd3d_dxbc_compi
 
 static void vkd3d_dxbc_compiler_emit_hull_shader_main(struct vkd3d_dxbc_compiler *compiler)
 {
-    const struct vkd3d_shader_scan_info *scan_info = compiler->scan_info;
     struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
     const struct vkd3d_shader_phase *control_point_phase, *phase;
     uint32_t phase_instance_id;
@@ -6003,7 +6006,7 @@ static void vkd3d_dxbc_compiler_emit_hull_shader_main(struct vkd3d_dxbc_compiler
     else
         vkd3d_dxbc_compiler_emit_default_control_point_phase(compiler);
 
-    if (scan_info->use_vocp)
+    if (compiler->use_vocp)
         vkd3d_dxbc_compiler_emit_hull_shader_barrier(compiler);
 
     for (i = 0; i < compiler->shader_phase_count; ++i)
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c
index ed67350..0ef3035 100644
--- a/libs/vkd3d-shader/vkd3d_shader_main.c
+++ b/libs/vkd3d-shader/vkd3d_shader_main.c
@@ -305,15 +305,6 @@ static void vkd3d_shader_scan_constant_buffer_declaration(struct vkd3d_shader_sc
             cb->register_index, VKD3D_SHADER_RESOURCE_BUFFER, VKD3D_SHADER_RESOURCE_DATA_UINT, 0);
 }
 
-static void vkd3d_shader_scan_input_declaration(struct vkd3d_shader_scan_info *scan_info,
-        const struct vkd3d_shader_instruction *instruction)
-{
-    const struct vkd3d_shader_dst_param *dst = &instruction->declaration.dst;
-
-    if (dst->reg.type == VKD3DSPR_OUTCONTROLPOINT)
-        scan_info->use_vocp = true;
-}
-
 static void vkd3d_shader_scan_sampler_declaration(struct vkd3d_shader_scan_context *context,
         const struct vkd3d_shader_instruction *instruction)
 {
@@ -412,9 +403,6 @@ static void vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *cont
         case VKD3DSIH_DCL_CONSTANT_BUFFER:
             vkd3d_shader_scan_constant_buffer_declaration(context, instruction);
             break;
-        case VKD3DSIH_DCL_INPUT:
-            vkd3d_shader_scan_input_declaration(context->scan_info, instruction);
-            break;
         case VKD3DSIH_DCL_SAMPLER:
             vkd3d_shader_scan_sampler_declaration(context, instruction);
             break;




More information about the wine-cvs mailing list