[PATCH 6/8] wined3d: Implement SM4 default instruction.

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


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

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 7ecf193..c85c917 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5249,6 +5249,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
     /* WINED3DSIH_DCL_UAV_TYPED                    */ NULL,
     /* WINED3DSIH_DCL_VERTICES_OUT                 */ shader_hw_nop,
     /* WINED3DSIH_DEF                              */ shader_hw_nop,
+    /* WINED3DSIH_DEFAULT                          */ NULL,
     /* WINED3DSIH_DEFB                             */ shader_hw_nop,
     /* WINED3DSIH_DEFI                             */ shader_hw_nop,
     /* WINED3DSIH_DIV                              */ NULL,
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index cfd0cfd..97f7fa8 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -4244,6 +4244,11 @@ static void shader_glsl_case(const struct wined3d_shader_instruction *ins)
     shader_addline(ins->ctx->buffer, "case %s:\n", src0_param.param_str);
 }
 
+static void shader_glsl_default(const struct wined3d_shader_instruction *ins)
+{
+    shader_addline(ins->ctx->buffer, "default:\n");
+}
+
 static void shader_glsl_if(const struct wined3d_shader_instruction *ins)
 {
     const char *condition = (ins->flags == WINED3D_SHADER_CONDITIONAL_OP_NZ) ? "bool" : "!bool";
@@ -8578,6 +8583,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
     /* WINED3DSIH_DCL_UAV_TYPED                    */ NULL,
     /* WINED3DSIH_DCL_VERTICES_OUT                 */ shader_glsl_nop,
     /* WINED3DSIH_DEF                              */ shader_glsl_nop,
+    /* WINED3DSIH_DEFAULT                          */ shader_glsl_default,
     /* WINED3DSIH_DEFB                             */ shader_glsl_nop,
     /* WINED3DSIH_DEFI                             */ shader_glsl_nop,
     /* WINED3DSIH_DIV                              */ shader_glsl_binop,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index bf67dbe..27242ae 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -81,6 +81,7 @@ static const char * const shader_opcode_names[] =
     /* WINED3DSIH_DCL_UAV_TYPED                    */ "dcl_uav_typed",
     /* WINED3DSIH_DCL_VERTICES_OUT                 */ "dcl_maxOutputVertexCount",
     /* WINED3DSIH_DEF                              */ "def",
+    /* WINED3DSIH_DEFAULT                          */ "default",
     /* WINED3DSIH_DEFB                             */ "defb",
     /* WINED3DSIH_DEFI                             */ "defi",
     /* WINED3DSIH_DIV                              */ "div",
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c
index 247f9b0..809f39c 100644
--- a/dlls/wined3d/shader_sm4.c
+++ b/dlls/wined3d/shader_sm4.c
@@ -113,6 +113,7 @@ enum wined3d_sm4_opcode
     WINED3D_SM4_OP_BREAKC                           = 0x03,
     WINED3D_SM4_OP_CASE                             = 0x06,
     WINED3D_SM4_OP_CUT                              = 0x09,
+    WINED3D_SM4_OP_DEFAULT                          = 0x0a,
     WINED3D_SM4_OP_DERIV_RTX                        = 0x0b,
     WINED3D_SM4_OP_DERIV_RTY                        = 0x0c,
     WINED3D_SM4_OP_DISCARD                          = 0x0d,
@@ -626,6 +627,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
             shader_sm4_read_conditional_op},
     {WINED3D_SM4_OP_CASE,                             WINED3DSIH_CASE,                             "",     "u"},
     {WINED3D_SM4_OP_CUT,                              WINED3DSIH_CUT,                              "",     ""},
+    {WINED3D_SM4_OP_DEFAULT,                          WINED3DSIH_DEFAULT,                          "",     ""},
     {WINED3D_SM4_OP_DERIV_RTX,                        WINED3DSIH_DSX,                              "f",    "f"},
     {WINED3D_SM4_OP_DERIV_RTY,                        WINED3DSIH_DSY,                              "f",    "f"},
     {WINED3D_SM4_OP_DISCARD,                          WINED3DSIH_TEXKILL,                          "",     "u"},
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e9d5a58..50548a1 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -588,6 +588,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
     WINED3DSIH_DCL_UAV_TYPED,
     WINED3DSIH_DCL_VERTICES_OUT,
     WINED3DSIH_DEF,
+    WINED3DSIH_DEFAULT,
     WINED3DSIH_DEFB,
     WINED3DSIH_DEFI,
     WINED3DSIH_DIV,
-- 
2.7.3




More information about the wine-patches mailing list