Commit d574d639 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Recognize the SM4 dcl_maxOutputVertexCount opcode.

parent 0a17173b
......@@ -5099,6 +5099,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_CRS */ shader_hw_map2gl,
/* WINED3DSIH_CUT */ NULL,
/* WINED3DSIH_DCL */ shader_hw_nop,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop,
/* WINED3DSIH_DEF */ shader_hw_nop,
/* WINED3DSIH_DEFB */ shader_hw_nop,
/* WINED3DSIH_DEFI */ shader_hw_nop,
......
......@@ -5031,6 +5031,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_CRS */ shader_glsl_cross,
/* WINED3DSIH_CUT */ NULL,
/* WINED3DSIH_DCL */ shader_glsl_nop,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop,
/* WINED3DSIH_DEF */ shader_glsl_nop,
/* WINED3DSIH_DEFB */ shader_glsl_nop,
/* WINED3DSIH_DEFI */ shader_glsl_nop,
......
......@@ -50,6 +50,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_CRS */ "crs",
/* WINED3DSIH_CUT */ "cut",
/* WINED3DSIH_DCL */ "dcl",
/* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount",
/* WINED3DSIH_DEF */ "def",
/* WINED3DSIH_DEFB */ "defb",
/* WINED3DSIH_DEFI */ "defi",
......@@ -1321,6 +1322,10 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
TRACE(" ");
shader_dump_dst_param(&ins.declaration.semantic.reg, &shader_version);
}
else if (ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT)
{
TRACE("%s %u", shader_opcode_names[ins.handler_idx], ins.declaration.count);
}
else if (ins.handler_idx == WINED3DSIH_DEF)
{
TRACE("def c%u = %f, %f, %f, %f", shader_get_float_offset(ins.dst[0].reg.type, ins.dst[0].reg.idx),
......
......@@ -98,6 +98,7 @@ enum wined3d_sm4_opcode
WINED3D_SM4_OP_USHR = 0x55,
WINED3D_SM4_OP_UTOF = 0x56,
WINED3D_SM4_OP_XOR = 0x57,
WINED3D_SM4_OP_DCL_VERTICES_OUT = 0x5e,
};
enum wined3d_sm4_register_type
......@@ -192,13 +193,14 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
{WINED3D_SM4_OP_RSQ, WINED3DSIH_RSQ, "F", "F"},
{WINED3D_SM4_OP_SAMPLE, WINED3DSIH_SAMPLE, "U", "FRS"},
{WINED3D_SM4_OP_SAMPLE_LOD, WINED3DSIH_SAMPLE_LOD, "U", "FRSF"},
{WINED3D_SM4_OP_SAMPLE_GRAD,WINED3DSIH_SAMPLE_GRAD, "U", "FRSFF"},
{WINED3D_SM4_OP_SAMPLE_GRAD, WINED3DSIH_SAMPLE_GRAD, "U", "FRSFF"},
{WINED3D_SM4_OP_SQRT, WINED3DSIH_SQRT, "F", "F"},
{WINED3D_SM4_OP_SINCOS, WINED3DSIH_SINCOS, "FF", "F"},
{WINED3D_SM4_OP_UDIV, WINED3DSIH_UDIV, "UU", "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"},
{WINED3D_SM4_OP_DCL_VERTICES_OUT, WINED3DSIH_DCL_VERTICES_OUT, "", ""},
};
static const enum wined3d_shader_register_type register_type_table[] =
......@@ -534,6 +536,12 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
FIXME("Skipping modifier 0x%08x.\n", modifier);
}
if (opcode == WINED3D_SM4_OP_DCL_VERTICES_OUT)
{
ins->declaration.count = *p++;
}
else
{
for (i = 0; i < ins->dst_count; ++i)
{
shader_sm4_read_dst_param(priv, &p, map_data_type(opcode_info->dst_info[i]),
......@@ -545,6 +553,7 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
shader_sm4_read_src_param(priv, &p, map_data_type(opcode_info->src_info[i]),
&priv->src_param[i], &priv->src_rel_addr[i]);
}
}
}
static void shader_sm4_read_comment(const DWORD **ptr, const char **comment, UINT *comment_size)
......
......@@ -439,6 +439,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_CRS,
WINED3DSIH_CUT,
WINED3DSIH_DCL,
WINED3DSIH_DCL_VERTICES_OUT,
WINED3DSIH_DEF,
WINED3DSIH_DEFB,
WINED3DSIH_DEFI,
......@@ -666,6 +667,7 @@ struct wined3d_shader_instruction
union
{
struct wined3d_shader_semantic semantic;
UINT count;
} declaration;
};
......
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