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

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 28 09:12:36 CDT 2016


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Fri Mar 25 19:53:38 2016 +0100

wined3d: Recognize SM5 dcl_uav_typed 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             | 14 +++++++++++---
 dlls/wined3d/shader_sm4.c         | 13 +++++++++++--
 dlls/wined3d/wined3d_private.h    |  3 +++
 5 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index e42f2b4..8ef944d 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5242,6 +5242,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
     /* WINED3DSIH_DCL_RESOURCE_STRUCTURED       */ NULL,
     /* WINED3DSIH_DCL_SAMPLER                   */ NULL,
     /* WINED3DSIH_DCL_TEMPS                     */ NULL,
+    /* WINED3DSIH_DCL_UAV_TYPED                 */ NULL,
     /* WINED3DSIH_DCL_VERTICES_OUT              */ shader_hw_nop,
     /* WINED3DSIH_DEF                           */ shader_hw_nop,
     /* WINED3DSIH_DEFB                          */ shader_hw_nop,
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 4b0f2a1..716650a 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -8128,6 +8128,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
     /* WINED3DSIH_DCL_RESOURCE_STRUCTURED       */ NULL,
     /* WINED3DSIH_DCL_SAMPLER                   */ shader_glsl_nop,
     /* WINED3DSIH_DCL_TEMPS                     */ shader_glsl_nop,
+    /* WINED3DSIH_DCL_UAV_TYPED                 */ NULL,
     /* WINED3DSIH_DCL_VERTICES_OUT              */ shader_glsl_nop,
     /* WINED3DSIH_DEF                           */ shader_glsl_nop,
     /* WINED3DSIH_DEFB                          */ shader_glsl_nop,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index a0e707c..5aded18 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -70,6 +70,7 @@ static const char * const shader_opcode_names[] =
     /* WINED3DSIH_DCL_RESOURCE_STRUCTURED       */ "dcl_resource_structured",
     /* WINED3DSIH_DCL_SAMPLER                   */ "dcl_sampler",
     /* WINED3DSIH_DCL_TEMPS                     */ "dcl_temps",
+    /* WINED3DSIH_DCL_UAV_TYPED                 */ "dcl_uav_typed",
     /* WINED3DSIH_DCL_VERTICES_OUT              */ "dcl_maxOutputVertexCount",
     /* WINED3DSIH_DEF                           */ "def",
     /* WINED3DSIH_DEFB                          */ "defb",
@@ -1310,9 +1311,12 @@ static void shader_dump_decl_usage(struct wined3d_string_buffer *buffer,
                 break;
         }
     }
-    else if (semantic->reg.reg.type == WINED3DSPR_RESOURCE)
+    else if (semantic->reg.reg.type == WINED3DSPR_RESOURCE || semantic->reg.reg.type == WINED3DSPR_UAV)
     {
-        shader_addline(buffer, "_resource_");
+        if (semantic->reg.reg.type == WINED3DSPR_RESOURCE)
+            shader_addline(buffer, "_resource_");
+        else
+            shader_addline(buffer, "_uav_");
         switch (semantic->resource_type)
         {
             case WINED3D_SHADER_RESOURCE_BUFFER:
@@ -1572,6 +1576,10 @@ static void shader_dump_register(struct wined3d_string_buffer *buffer,
             shader_addline(buffer, "t");
             break;
 
+        case WINED3DSPR_UAV:
+            shader_addline(buffer, "u");
+            break;
+
         default:
             shader_addline(buffer, "<unhandled_rtype(%#x)>", reg->type);
             break;
@@ -1953,7 +1961,7 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
             continue;
         }
 
-        if (ins.handler_idx == WINED3DSIH_DCL)
+        if (ins.handler_idx == WINED3DSIH_DCL || ins.handler_idx == WINED3DSIH_DCL_UAV_TYPED)
         {
             shader_dump_decl_usage(&buffer, &ins.declaration.semantic, &shader_version);
             shader_dump_ins_modifiers(&buffer, &ins.declaration.semantic.reg);
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c
index 0923b63..cb3f18e 100644
--- a/dlls/wined3d/shader_sm4.c
+++ b/dlls/wined3d/shader_sm4.c
@@ -188,6 +188,7 @@ enum wined3d_sm4_opcode
     WINED3D_SM5_OP_DERIV_RTX_FINE            = 0x7b,
     WINED3D_SM5_OP_DERIV_RTY_COARSE          = 0x7c,
     WINED3D_SM5_OP_DERIV_RTY_FINE            = 0x7d,
+    WINED3D_SM5_OP_DCL_UAV_TYPED             = 0x9c,
     WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED   = 0xa2,
     WINED3D_SM5_OP_LD_STRUCTURED             = 0xa7,
 };
@@ -205,6 +206,7 @@ enum wined3d_sm4_register_type
     WINED3D_SM4_RT_PRIMID         = 0xb,
     WINED3D_SM4_RT_DEPTHOUT       = 0xc,
     WINED3D_SM4_RT_NULL           = 0xd,
+    WINED3D_SM5_RT_UAV            = 0xe,
 };
 
 enum wined3d_sm4_output_primitive_type
@@ -304,6 +306,7 @@ struct wined3d_sm4_opcode_info
  * u -> WINED3D_DATA_UINT
  * R -> WINED3D_DATA_RESOURCE
  * S -> WINED3D_DATA_SAMPLER
+ * U -> WINED3D_DATA_UAV
  */
 static const struct wined3d_sm4_opcode_info opcode_table[] =
 {
@@ -396,6 +399,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
     {WINED3D_SM5_OP_DERIV_RTX_FINE,            WINED3DSIH_DSX_FINE,                      "f",    "f"},
     {WINED3D_SM5_OP_DERIV_RTY_COARSE,          WINED3DSIH_DSY_COARSE,                    "f",    "f"},
     {WINED3D_SM5_OP_DERIV_RTY_FINE,            WINED3DSIH_DSY_FINE,                      "f",    "f"},
+    {WINED3D_SM5_OP_DCL_UAV_TYPED,             WINED3DSIH_DCL_UAV_TYPED,                 "",     ""},
     {WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED,   WINED3DSIH_DCL_RESOURCE_STRUCTURED,       "",     ""},
     {WINED3D_SM5_OP_LD_STRUCTURED,             WINED3DSIH_LD_STRUCTURED,                 "u",    "uuR"},
 };
@@ -416,6 +420,7 @@ static const enum wined3d_shader_register_type register_type_table[] =
     /* WINED3D_SM4_RT_PRIMID */         WINED3DSPR_PRIMID,
     /* WINED3D_SM4_RT_DEPTHOUT */       WINED3DSPR_DEPTHOUT,
     /* WINED3D_SM4_RT_NULL */           WINED3DSPR_NULL,
+    /* WINED3D_SM5_RT_UAV */            WINED3DSPR_UAV,
 };
 
 static const enum wined3d_primitive_type output_primitive_type_table[] =
@@ -518,6 +523,8 @@ static enum wined3d_data_type map_data_type(char t)
             return WINED3D_DATA_RESOURCE;
         case 'S':
             return WINED3D_DATA_SAMPLER;
+        case 'U':
+            return WINED3D_DATA_UAV;
         default:
             ERR("Invalid data type '%c'.\n", t);
             return WINED3D_DATA_FLOAT;
@@ -937,10 +944,11 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
         memcpy(priv->icb.data, p, sizeof(*p) * icb_size);
         ins->declaration.icb = &priv->icb;
     }
-    else if (opcode == WINED3D_SM4_OP_DCL_RESOURCE)
+    else if (opcode == WINED3D_SM4_OP_DCL_RESOURCE || opcode == WINED3D_SM5_OP_DCL_UAV_TYPED)
     {
         enum wined3d_sm4_resource_type resource_type;
         enum wined3d_sm4_data_type data_type;
+        enum wined3d_data_type reg_data_type;
         DWORD components;
 
         resource_type = (opcode_token & WINED3D_SM4_RESOURCE_TYPE_MASK) >> WINED3D_SM4_RESOURCE_TYPE_SHIFT;
@@ -953,7 +961,8 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
         {
             ins->declaration.semantic.resource_type = resource_type_table[resource_type];
         }
-        shader_sm4_read_dst_param(priv, &p, WINED3D_DATA_RESOURCE, &ins->declaration.semantic.reg);
+        reg_data_type = opcode == WINED3D_SM4_OP_DCL_RESOURCE ? WINED3D_DATA_RESOURCE : WINED3D_DATA_UAV;
+        shader_sm4_read_dst_param(priv, &p, reg_data_type, &ins->declaration.semantic.reg);
 
         components = *p++;
         if ((components & 0xfff0) != (components & 0xf) * 0x1110)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 390c494..d2970c4 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -365,6 +365,7 @@ enum wined3d_shader_register_type
     WINED3DSPR_PRIMID,
     WINED3DSPR_NULL,
     WINED3DSPR_RESOURCE,
+    WINED3DSPR_UAV,
 };
 
 enum wined3d_data_type
@@ -373,6 +374,7 @@ enum wined3d_data_type
     WINED3D_DATA_INT,
     WINED3D_DATA_RESOURCE,
     WINED3D_DATA_SAMPLER,
+    WINED3D_DATA_UAV,
     WINED3D_DATA_UINT,
     WINED3D_DATA_UNORM,
     WINED3D_DATA_SNORM,
@@ -522,6 +524,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
     WINED3DSIH_DCL_RESOURCE_STRUCTURED,
     WINED3DSIH_DCL_SAMPLER,
     WINED3DSIH_DCL_TEMPS,
+    WINED3DSIH_DCL_UAV_TYPED,
     WINED3DSIH_DCL_VERTICES_OUT,
     WINED3DSIH_DEF,
     WINED3DSIH_DEFB,




More information about the wine-cvs mailing list