Module: wine Branch: master Commit: e8a35314ab5921b8de5b91701144751f3cd35940 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e8a35314ab5921b8de5b917011...
Author: Józef Kucia jkucia@codeweavers.com Date: Sun Jan 17 22:48:48 2016 +0100
wined3d: Recognize SM4 resinfo opcode.
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/arb_program_shader.c | 1 + dlls/wined3d/glsl_shader.c | 1 + dlls/wined3d/shader.c | 11 +++++++++++ dlls/wined3d/shader_sm4.c | 7 +++++++ dlls/wined3d/wined3d_private.h | 3 +++ 5 files changed, 23 insertions(+)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 074b74f..84b85c4 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -5295,6 +5295,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_POW */ shader_hw_pow, /* WINED3DSIH_RCP */ shader_hw_scalar_op, /* WINED3DSIH_REP */ shader_hw_rep, + /* WINED3DSIH_RESINFO */ NULL, /* WINED3DSIH_RET */ shader_hw_ret, /* WINED3DSIH_ROUND_NI */ NULL, /* WINED3DSIH_RSQ */ shader_hw_scalar_op, diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index b7d30ca..0b29378 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -7948,6 +7948,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB /* WINED3DSIH_POW */ shader_glsl_pow, /* WINED3DSIH_RCP */ shader_glsl_scalar_op, /* WINED3DSIH_REP */ shader_glsl_rep, + /* WINED3DSIH_RESINFO */ NULL, /* WINED3DSIH_RET */ shader_glsl_ret, /* WINED3DSIH_ROUND_NI */ shader_glsl_map2gl, /* WINED3DSIH_RSQ */ shader_glsl_scalar_op, diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index d747816..cb421ee 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -123,6 +123,7 @@ static const char * const shader_opcode_names[] = /* WINED3DSIH_POW */ "pow", /* WINED3DSIH_RCP */ "rcp", /* WINED3DSIH_REP */ "rep", + /* WINED3DSIH_RESINFO */ "resinfo", /* WINED3DSIH_RET */ "ret", /* WINED3DSIH_ROUND_NI */ "round_ni", /* WINED3DSIH_RSQ */ "rsq", @@ -1873,6 +1874,16 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe { TRACE("p"); } + else if (ins.handler_idx == WINED3DSIH_RESINFO + && ins.flags) + { + switch (ins.flags) + { + case WINED3DSI_RESINFO_RCP_FLOAT: TRACE("_rcpFloat"); break; + case WINED3DSI_RESINFO_UINT: TRACE("_uint"); break; + default: TRACE("_unrecognized(%#x)", ins.flags); + } + }
for (i = 0; i < ins.dst_count; ++i) { diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index 6e02352..710434b 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -29,6 +29,9 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode); #define WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT 24 #define WINED3D_SM4_INSTRUCTION_LENGTH_MASK (0x1fu << WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT)
+#define WINED3D_SM4_INSTRUCTION_FLAGS_SHIFT 11 +#define WINED3D_SM4_INSTRUCTION_FLAGS_MASK (0x3u << WINED3D_SM4_INSTRUCTION_FLAGS_SHIFT) + #define WINED3D_SM4_RESOURCE_TYPE_SHIFT 11 #define WINED3D_SM4_RESOURCE_TYPE_MASK (0xfu << WINED3D_SM4_RESOURCE_TYPE_SHIFT)
@@ -120,6 +123,7 @@ enum wined3d_sm4_opcode WINED3D_SM4_OP_MUL = 0x38, WINED3D_SM4_OP_NE = 0x39, WINED3D_SM4_OP_OR = 0x3c, + WINED3D_SM4_OP_RESINFO = 0x3d, WINED3D_SM4_OP_RET = 0x3e, WINED3D_SM4_OP_ROUND_NI = 0x41, WINED3D_SM4_OP_RSQ = 0x44, @@ -296,6 +300,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = {WINED3D_SM4_OP_MUL, WINED3DSIH_MUL, "F", "FF"}, {WINED3D_SM4_OP_NE, WINED3DSIH_NE, "U", "FF"}, {WINED3D_SM4_OP_OR, WINED3DSIH_OR, "U", "UU"}, + {WINED3D_SM4_OP_RESINFO, WINED3DSIH_RESINFO, "F", "IR"}, {WINED3D_SM4_OP_RET, WINED3DSIH_RET, "", ""}, {WINED3D_SM4_OP_ROUND_NI, WINED3DSIH_ROUND_NI, "F", "F"}, {WINED3D_SM4_OP_RSQ, WINED3DSIH_RSQ, "F", "F"}, @@ -888,6 +893,8 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi } else { + ins->flags = (opcode_token & WINED3D_SM4_INSTRUCTION_FLAGS_MASK) >> WINED3D_SM4_INSTRUCTION_FLAGS_SHIFT; + for (i = 0; i < ins->dst_count; ++i) { if (!(shader_sm4_read_dst_param(priv, &p, map_data_type(opcode_info->dst_info[i]), &priv->dst_param[i]))) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 07007c0..3393d62 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -407,6 +407,8 @@ enum wined3d_shader_dst_modifier #define WINED3DSI_TEXLD_PROJECT 0x1 #define WINED3DSI_TEXLD_BIAS 0x2 #define WINED3DSI_INDEXED_DYNAMIC 0x4 +#define WINED3DSI_RESINFO_RCP_FLOAT 0x1 +#define WINED3DSI_RESINFO_UINT 0x2
enum wined3d_shader_rel_op { @@ -538,6 +540,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER WINED3DSIH_POW, WINED3DSIH_RCP, WINED3DSIH_REP, + WINED3DSIH_RESINFO, WINED3DSIH_RET, WINED3DSIH_ROUND_NI, WINED3DSIH_RSQ,