[PATCH 3/8] wined3d: Implement SM4 umax instruction.

Józef Kucia jkucia at codeweavers.com
Fri Jun 3 04:33:02 CDT 2016


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/wined3d/arb_program_shader.c | 1 +
 dlls/wined3d/glsl_shader.c        | 2 ++
 dlls/wined3d/shader.c             | 1 +
 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 6096555..7b395e9 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5370,6 +5370,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
     /* WINED3DSIH_UDIV                             */ NULL,
     /* WINED3DSIH_UGE                              */ NULL,
     /* WINED3DSIH_ULT                              */ NULL,
+    /* WINED3DSIH_UMAX                             */ NULL,
     /* WINED3DSIH_USHR                             */ NULL,
     /* WINED3DSIH_UTOF                             */ NULL,
     /* WINED3DSIH_XOR                              */ NULL,
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index a60244b..517435d 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -3465,6 +3465,7 @@ static void shader_glsl_map2gl(const struct wined3d_shader_instruction *ins)
         case WINED3DSIH_ROUND_PI: instruction = "ceil"; break;
         case WINED3DSIH_ROUND_Z: instruction = "trunc"; break;
         case WINED3DSIH_SQRT: instruction = "sqrt"; break;
+        case WINED3DSIH_UMAX: instruction = "max"; break;
         default: instruction = "";
             FIXME("Opcode %s not yet handled in GLSL.\n", debug_d3dshaderinstructionhandler(ins->handler_idx));
             break;
@@ -8682,6 +8683,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
     /* WINED3DSIH_UDIV                             */ shader_glsl_udiv,
     /* WINED3DSIH_UGE                              */ shader_glsl_relop,
     /* WINED3DSIH_ULT                              */ shader_glsl_relop,
+    /* WINED3DSIH_UMAX                             */ shader_glsl_map2gl,
     /* WINED3DSIH_USHR                             */ shader_glsl_binop,
     /* WINED3DSIH_UTOF                             */ shader_glsl_to_float,
     /* WINED3DSIH_XOR                              */ shader_glsl_binop,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 6dffe33..8c41afb 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -202,6 +202,7 @@ static const char * const shader_opcode_names[] =
     /* WINED3DSIH_UDIV                             */ "udiv",
     /* WINED3DSIH_UGE                              */ "uge",
     /* WINED3DSIH_ULT                              */ "ult",
+    /* WINED3DSIH_UMAX                             */ "umax",
     /* WINED3DSIH_USHR                             */ "ushr",
     /* WINED3DSIH_UTOF                             */ "utof",
     /* WINED3DSIH_XOR                              */ "xor",
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c
index e9aa22a..62b5d65 100644
--- a/dlls/wined3d/shader_sm4.c
+++ b/dlls/wined3d/shader_sm4.c
@@ -176,6 +176,7 @@ enum wined3d_sm4_opcode
     WINED3D_SM4_OP_UDIV                             = 0x4e,
     WINED3D_SM4_OP_ULT                              = 0x4f,
     WINED3D_SM4_OP_UGE                              = 0x50,
+    WINED3D_SM4_OP_UMAX                             = 0x53,
     WINED3D_SM4_OP_USHR                             = 0x55,
     WINED3D_SM4_OP_UTOF                             = 0x56,
     WINED3D_SM4_OP_XOR                              = 0x57,
@@ -688,6 +689,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
     {WINED3D_SM4_OP_UDIV,                             WINED3DSIH_UDIV,                             "uu",   "uu"},
     {WINED3D_SM4_OP_ULT,                              WINED3DSIH_ULT,                              "u",    "uu"},
     {WINED3D_SM4_OP_UGE,                              WINED3DSIH_UGE,                              "u",    "uu"},
+    {WINED3D_SM4_OP_UMAX,                             WINED3DSIH_UMAX,                             "u",    "uu"},
     {WINED3D_SM4_OP_USHR,                             WINED3DSIH_USHR,                             "u",    "uu"},
     {WINED3D_SM4_OP_UTOF,                             WINED3DSIH_UTOF,                             "f",    "u"},
     {WINED3D_SM4_OP_XOR,                              WINED3DSIH_XOR,                              "u",    "uu"},
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 879ea0b..473a4b8 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -709,6 +709,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
     WINED3DSIH_UDIV,
     WINED3DSIH_UGE,
     WINED3DSIH_ULT,
+    WINED3DSIH_UMAX,
     WINED3DSIH_USHR,
     WINED3DSIH_UTOF,
     WINED3DSIH_XOR,
-- 
2.7.3




More information about the wine-patches mailing list