=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Recognize SM4.1 sampleinfo opcode.

Alexandre Julliard julliard at winehq.org
Fri Jul 15 09:07:05 CDT 2016


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Fri Jul 15 11:16:22 2016 +0200

wined3d: Recognize SM4.1 sampleinfo 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             | 12 ++++++++++--
 dlls/wined3d/shader_sm4.c         |  2 ++
 dlls/wined3d/wined3d_private.h    |  2 ++
 5 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index ab3c793..1760d6f 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5359,6 +5359,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
     /* WINED3DSIH_SAMPLE_C                         */ NULL,
     /* WINED3DSIH_SAMPLE_C_LZ                      */ NULL,
     /* WINED3DSIH_SAMPLE_GRAD                      */ NULL,
+    /* WINED3DSIH_SAMPLE_INFO                      */ NULL,
     /* WINED3DSIH_SAMPLE_LOD                       */ NULL,
     /* WINED3DSIH_SAMPLE_POS                       */ NULL,
     /* WINED3DSIH_SETP                             */ NULL,
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 2099d6e..ef3adbd 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -8777,6 +8777,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
     /* WINED3DSIH_SAMPLE_C                         */ shader_glsl_sample_c,
     /* WINED3DSIH_SAMPLE_C_LZ                      */ shader_glsl_sample_c,
     /* WINED3DSIH_SAMPLE_GRAD                      */ shader_glsl_sample,
+    /* WINED3DSIH_SAMPLE_INFO                      */ NULL,
     /* WINED3DSIH_SAMPLE_LOD                       */ shader_glsl_sample,
     /* WINED3DSIH_SAMPLE_POS                       */ NULL,
     /* WINED3DSIH_SETP                             */ NULL,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 5b6c22a..7ccc1d4 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -189,6 +189,7 @@ static const char * const shader_opcode_names[] =
     /* WINED3DSIH_SAMPLE_C                         */ "sample_c",
     /* WINED3DSIH_SAMPLE_C_LZ                      */ "sample_c_lz",
     /* WINED3DSIH_SAMPLE_GRAD                      */ "sample_d",
+    /* WINED3DSIH_SAMPLE_INFO                      */ "sample_info",
     /* WINED3DSIH_SAMPLE_LOD                       */ "sample_l",
     /* WINED3DSIH_SAMPLE_POS                       */ "sample_pos",
     /* WINED3DSIH_SETP                             */ "setp",
@@ -2420,8 +2421,7 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
             {
                 shader_addline(&buffer, "p");
             }
-            else if (ins.handler_idx == WINED3DSIH_RESINFO
-                    && ins.flags)
+            else if (ins.handler_idx == WINED3DSIH_RESINFO && ins.flags)
             {
                 switch (ins.flags)
                 {
@@ -2430,6 +2430,14 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
                     default: shader_addline(&buffer, "_unrecognized(%#x)", ins.flags);
                 }
             }
+            else if (ins.handler_idx == WINED3DSIH_SAMPLE_INFO && ins.flags)
+            {
+                switch (ins.flags)
+                {
+                    case WINED3DSI_SAMPLE_INFO_UINT: shader_addline(&buffer, "_uint"); break;
+                    default: shader_addline(&buffer, "_unrecognized(%#x)", ins.flags);
+                }
+            }
 
             if (wined3d_shader_instruction_has_texel_offset(&ins))
                 shader_addline(&buffer, "(%d,%d,%d)", ins.texel_offset.u, ins.texel_offset.v, ins.texel_offset.w);
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c
index 063770e..7b82bbb 100644
--- a/dlls/wined3d/shader_sm4.c
+++ b/dlls/wined3d/shader_sm4.c
@@ -206,6 +206,7 @@ enum wined3d_sm4_opcode
     WINED3D_SM4_OP_LOD                              = 0x6c,
     WINED3D_SM4_OP_GATHER4                          = 0x6d,
     WINED3D_SM4_OP_SAMPLE_POS                       = 0x6e,
+    WINED3D_SM4_OP_SAMPLE_INFO                      = 0x6f,
     WINED3D_SM5_OP_HS_DECLS                         = 0x71,
     WINED3D_SM5_OP_HS_CONTROL_POINT_PHASE           = 0x72,
     WINED3D_SM5_OP_HS_FORK_PHASE                    = 0x73,
@@ -806,6 +807,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
     {WINED3D_SM4_OP_LOD,                              WINED3DSIH_LOD,                              "f",    "fRS"},
     {WINED3D_SM4_OP_GATHER4,                          WINED3DSIH_GATHER4,                          "u",    "fRS"},
     {WINED3D_SM4_OP_SAMPLE_POS,                       WINED3DSIH_SAMPLE_POS,                       "f",    "Ru"},
+    {WINED3D_SM4_OP_SAMPLE_INFO,                      WINED3DSIH_SAMPLE_INFO,                      "f",    "R"},
     {WINED3D_SM5_OP_HS_DECLS,                         WINED3DSIH_HS_DECLS,                         "",     ""},
     {WINED3D_SM5_OP_HS_CONTROL_POINT_PHASE,           WINED3DSIH_HS_CONTROL_POINT_PHASE,           "",     ""},
     {WINED3D_SM5_OP_HS_FORK_PHASE,                    WINED3DSIH_HS_FORK_PHASE,                    "",     ""},
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 0cbae86..0450181 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -495,6 +495,7 @@ enum wined3d_tessellator_partitioning
 #define WINED3DSI_INDEXED_DYNAMIC   0x4
 #define WINED3DSI_RESINFO_RCP_FLOAT 0x1
 #define WINED3DSI_RESINFO_UINT      0x2
+#define WINED3DSI_SAMPLE_INFO_UINT  0x1
 #define WINED3DSI_SAMPLER_COMPARISON_MODE 0x1
 
 enum wined3d_shader_rel_op
@@ -705,6 +706,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
     WINED3DSIH_SAMPLE_C,
     WINED3DSIH_SAMPLE_C_LZ,
     WINED3DSIH_SAMPLE_GRAD,
+    WINED3DSIH_SAMPLE_INFO,
     WINED3DSIH_SAMPLE_LOD,
     WINED3DSIH_SAMPLE_POS,
     WINED3DSIH_SETP,




More information about the wine-cvs mailing list