=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Recognize SM5 dcl_uav_raw opcode.

Alexandre Julliard julliard at winehq.org
Wed Nov 30 16:56:57 CST 2016


Module: wine
Branch: master
Commit: 17c7cbeb887d4f91ff06c58b807b2c4da1c004e5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=17c7cbeb887d4f91ff06c58b807b2c4da1c004e5

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Wed Nov 30 12:47:31 2016 +0100

wined3d: Recognize SM5 dcl_uav_raw opcode.

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>

---

 dlls/wined3d/arb_program_shader.c |  1 +
 dlls/wined3d/glsl_shader.c        |  1 +
 dlls/wined3d/shader.c             | 20 ++++++++++++++++++++
 dlls/wined3d/shader_sm4.c         | 14 ++++++++++++++
 dlls/wined3d/wined3d_private.h    |  6 ++++++
 5 files changed, 42 insertions(+)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index fe5b5c8..f8665dd 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5248,6 +5248,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
     /* WINED3DSIH_DCL_TGSM_RAW                     */ NULL,
     /* WINED3DSIH_DCL_TGSM_STRUCTURED              */ NULL,
     /* WINED3DSIH_DCL_THREAD_GROUP                 */ NULL,
+    /* WINED3DSIH_DCL_UAV_RAW                      */ NULL,
     /* WINED3DSIH_DCL_UAV_TYPED                    */ NULL,
     /* WINED3DSIH_DCL_VERTICES_OUT                 */ shader_hw_nop,
     /* WINED3DSIH_DEF                              */ shader_hw_nop,
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index ee5b6c3..3afed69 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -8911,6 +8911,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
     /* WINED3DSIH_DCL_TGSM_RAW                     */ NULL,
     /* WINED3DSIH_DCL_TGSM_STRUCTURED              */ NULL,
     /* WINED3DSIH_DCL_THREAD_GROUP                 */ NULL,
+    /* WINED3DSIH_DCL_UAV_RAW                      */ NULL,
     /* WINED3DSIH_DCL_UAV_TYPED                    */ shader_glsl_nop,
     /* WINED3DSIH_DCL_VERTICES_OUT                 */ shader_glsl_nop,
     /* WINED3DSIH_DEF                              */ shader_glsl_nop,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index e6eb351..05ab24d 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -89,6 +89,7 @@ static const char * const shader_opcode_names[] =
     /* WINED3DSIH_DCL_TGSM_RAW                     */ "dcl_tgsm_raw",
     /* WINED3DSIH_DCL_TGSM_STRUCTURED              */ "dcl_tgsm_structured",
     /* WINED3DSIH_DCL_THREAD_GROUP                 */ "dcl_thread_group",
+    /* WINED3DSIH_DCL_UAV_RAW                      */ "dcl_uav_raw",
     /* WINED3DSIH_DCL_UAV_TYPED                    */ "dcl_uav_typed",
     /* WINED3DSIH_DCL_VERTICES_OUT                 */ "dcl_maxOutputVertexCount",
     /* WINED3DSIH_DEF                              */ "def",
@@ -1457,6 +1458,18 @@ static void shader_dump_sync_flags(struct wined3d_string_buffer *buffer, DWORD s
         shader_addline(buffer, "_unknown_flags(%#x)", sync_flags);
 }
 
+static void shader_dump_uav_flags(struct wined3d_string_buffer *buffer, DWORD uav_flags)
+{
+    if (uav_flags & WINED3DSUF_GLOBALLY_COHERENT)
+    {
+        shader_addline(buffer, "_glc");
+        uav_flags &= ~WINED3DSUF_GLOBALLY_COHERENT;
+    }
+
+    if (uav_flags)
+        shader_addline(buffer, "_unknown_flags(%#x)", uav_flags);
+}
+
 static void shader_dump_tessellator_domain(struct wined3d_string_buffer *buffer,
         enum wined3d_tessellator_domain domain)
 {
@@ -2417,6 +2430,13 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
                     ins.declaration.thread_group_size.y,
                     ins.declaration.thread_group_size.z);
         }
+        else if (ins.handler_idx == WINED3DSIH_DCL_UAV_RAW)
+        {
+            shader_addline(&buffer, "%s", shader_opcode_names[ins.handler_idx]);
+            shader_dump_uav_flags(&buffer, ins.flags);
+            shader_addline(&buffer, " ");
+            shader_dump_dst_param(&buffer, &ins.declaration.dst, &shader_version);
+        }
         else if (ins.handler_idx == WINED3DSIH_DEF)
         {
             shader_addline(&buffer, "def c%u = %.8e, %.8e, %.8e, %.8e", shader_get_float_offset(ins.dst[0].reg.type,
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c
index 2775a6e..94b1229 100644
--- a/dlls/wined3d/shader_sm4.c
+++ b/dlls/wined3d/shader_sm4.c
@@ -64,6 +64,9 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode);
 #define WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT   11
 #define WINED3D_SM5_CONTROL_POINT_COUNT_MASK    (0xffu << WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT)
 
+#define WINED3D_SM5_UAV_FLAGS_SHIFT             11
+#define WINED3D_SM5_UAV_FLAGS_MASK              (0xffu << WINED3D_SM5_UAV_FLAGS_SHIFT)
+
 #define WINED3D_SM5_SYNC_FLAGS_SHIFT            11
 #define WINED3D_SM5_SYNC_FLAGS_MASK             (0xffu << WINED3D_SM5_SYNC_FLAGS_SHIFT)
 
@@ -237,6 +240,7 @@ enum wined3d_sm4_opcode
     WINED3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT = 0x99,
     WINED3D_SM5_OP_DCL_THREAD_GROUP                 = 0x9b,
     WINED3D_SM5_OP_DCL_UAV_TYPED                    = 0x9c,
+    WINED3D_SM5_OP_DCL_UAV_RAW                      = 0x9d,
     WINED3D_SM5_OP_DCL_TGSM_RAW                     = 0x9f,
     WINED3D_SM5_OP_DCL_TGSM_STRUCTURED              = 0xa0,
     WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED          = 0xa2,
@@ -660,6 +664,14 @@ static void shader_sm5_read_dcl_thread_group(struct wined3d_shader_instruction *
     ins->declaration.thread_group_size.z = *tokens++;
 }
 
+static void shader_sm5_read_dcl_uav_raw(struct wined3d_shader_instruction *ins,
+        DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
+        struct wined3d_sm4_data *priv)
+{
+    shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_UAV, &ins->declaration.dst);
+    ins->flags = (opcode_token & WINED3D_SM5_UAV_FLAGS_MASK) >> WINED3D_SM5_UAV_FLAGS_SHIFT;
+}
+
 static void shader_sm5_read_dcl_tgsm_raw(struct wined3d_shader_instruction *ins,
         DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
         struct wined3d_sm4_data *priv)
@@ -858,6 +870,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
             shader_sm5_read_dcl_thread_group},
     {WINED3D_SM5_OP_DCL_UAV_TYPED,                    WINED3DSIH_DCL_UAV_TYPED,                    "",     "",
             shader_sm4_read_dcl_resource},
+    {WINED3D_SM5_OP_DCL_UAV_RAW,                      WINED3DSIH_DCL_UAV_RAW,                      "",     "",
+            shader_sm5_read_dcl_uav_raw},
     {WINED3D_SM5_OP_DCL_TGSM_RAW,                     WINED3DSIH_DCL_TGSM_RAW,                     "",     "",
             shader_sm5_read_dcl_tgsm_raw},
     {WINED3D_SM5_OP_DCL_TGSM_STRUCTURED,              WINED3DSIH_DCL_TGSM_STRUCTURED,              "",     "",
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c6acdd1..31ab656 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -469,6 +469,11 @@ enum wined3d_shader_sync_flags
     WINED3DSSF_GROUP_SHARED_MEMORY = 0x2,
 };
 
+enum wined3d_shader_uav_flags
+{
+    WINED3DSUF_GLOBALLY_COHERENT = 0x20,
+};
+
 enum wined3d_tessellator_domain
 {
     WINED3D_TESSELLATOR_DOMAIN_LINE      = 1,
@@ -609,6 +614,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
     WINED3DSIH_DCL_TGSM_RAW,
     WINED3DSIH_DCL_TGSM_STRUCTURED,
     WINED3DSIH_DCL_THREAD_GROUP,
+    WINED3DSIH_DCL_UAV_RAW,
     WINED3DSIH_DCL_UAV_TYPED,
     WINED3DSIH_DCL_VERTICES_OUT,
     WINED3DSIH_DEF,




More information about the wine-cvs mailing list