Commit e8a35314 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Recognize SM4 resinfo opcode.

parent 1333f15b
......@@ -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,
......
......@@ -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,
......
......@@ -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)
{
......
......@@ -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])))
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment