[PATCH 7/7] wined3d: Recognize SM4 sample_b opcode.

Józef Kucia jkucia at codeweavers.com
Wed Jan 27 16:43:46 CST 2016


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/wined3d/arb_program_shader.c | 1 +
 dlls/wined3d/glsl_shader.c        | 1 +
 dlls/wined3d/shader.c             | 2 ++
 dlls/wined3d/shader_sm4.c         | 2 ++
 dlls/wined3d/wined3d_private.h    | 1 +
 5 files changed, 7 insertions(+)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 6c1e048..ea542b9 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5304,6 +5304,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
     /* WINED3DSIH_ROUND_Z               */ NULL,
     /* WINED3DSIH_RSQ                   */ shader_hw_scalar_op,
     /* WINED3DSIH_SAMPLE                */ NULL,
+    /* WINED3DSIH_SAMPLE_B              */ NULL,
     /* WINED3DSIH_SAMPLE_C_LZ           */ NULL,
     /* WINED3DSIH_SAMPLE_GRAD           */ NULL,
     /* WINED3DSIH_SAMPLE_LOD            */ NULL,
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 23680ea..5e983f9 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -8080,6 +8080,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
     /* WINED3DSIH_ROUND_Z               */ shader_glsl_map2gl,
     /* WINED3DSIH_RSQ                   */ shader_glsl_scalar_op,
     /* WINED3DSIH_SAMPLE                */ shader_glsl_sample,
+    /* WINED3DSIH_SAMPLE_B              */ NULL,
     /* WINED3DSIH_SAMPLE_C_LZ           */ NULL,
     /* WINED3DSIH_SAMPLE_GRAD           */ NULL,
     /* WINED3DSIH_SAMPLE_LOD            */ shader_glsl_sample_lod,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 7df4d1d..4c42d2f 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -132,6 +132,7 @@ static const char * const shader_opcode_names[] =
     /* WINED3DSIH_ROUND_Z               */ "round_z",
     /* WINED3DSIH_RSQ                   */ "rsq",
     /* WINED3DSIH_SAMPLE                */ "sample",
+    /* WINED3DSIH_SAMPLE_B              */ "sample_b",
     /* WINED3DSIH_SAMPLE_C_LZ           */ "sample_c_lz",
     /* WINED3DSIH_SAMPLE_GRAD           */ "sample_d",
     /* WINED3DSIH_SAMPLE_LOD            */ "sample_l",
@@ -1073,6 +1074,7 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
                 --cur_loop_depth;
             }
             else if (ins.handler_idx == WINED3DSIH_SAMPLE
+                    || ins.handler_idx == WINED3DSIH_SAMPLE_B
                     || ins.handler_idx == WINED3DSIH_SAMPLE_C_LZ
                     || ins.handler_idx == WINED3DSIH_SAMPLE_GRAD
                     || ins.handler_idx == WINED3DSIH_SAMPLE_LOD)
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c
index dde341b..11de59c 100644
--- a/dlls/wined3d/shader_sm4.c
+++ b/dlls/wined3d/shader_sm4.c
@@ -137,6 +137,7 @@ enum wined3d_sm4_opcode
     WINED3D_SM4_OP_SAMPLE_C_LZ          = 0x47,
     WINED3D_SM4_OP_SAMPLE_LOD           = 0x48,
     WINED3D_SM4_OP_SAMPLE_GRAD          = 0x49,
+    WINED3D_SM4_OP_SAMPLE_B             = 0x4a,
     WINED3D_SM4_OP_SQRT                 = 0x4b,
     WINED3D_SM4_OP_SINCOS               = 0x4d,
     WINED3D_SM4_OP_UDIV                 = 0x4e,
@@ -322,6 +323,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
     {WINED3D_SM4_OP_SAMPLE_C_LZ,            WINED3DSIH_SAMPLE_C_LZ,         "F",    "FRSF"},
     {WINED3D_SM4_OP_SAMPLE_LOD,             WINED3DSIH_SAMPLE_LOD,          "U",    "FRSF"},
     {WINED3D_SM4_OP_SAMPLE_GRAD,            WINED3DSIH_SAMPLE_GRAD,         "U",    "FRSFF"},
+    {WINED3D_SM4_OP_SAMPLE_B,               WINED3DSIH_SAMPLE_B,            "U",    "FRSF"},
     {WINED3D_SM4_OP_SQRT,                   WINED3DSIH_SQRT,                "F",    "F"},
     {WINED3D_SM4_OP_SINCOS,                 WINED3DSIH_SINCOS,              "FF",   "F"},
     {WINED3D_SM4_OP_UDIV,                   WINED3DSIH_UDIV,                "UU",   "UU"},
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 461a1fe..5f91dc4 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -560,6 +560,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
     WINED3DSIH_ROUND_Z,
     WINED3DSIH_RSQ,
     WINED3DSIH_SAMPLE,
+    WINED3DSIH_SAMPLE_B,
     WINED3DSIH_SAMPLE_C_LZ,
     WINED3DSIH_SAMPLE_GRAD,
     WINED3DSIH_SAMPLE_LOD,
-- 
2.4.10




More information about the wine-patches mailing list