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

wined3d: Recognize the SM4 dcl_outputTopology opcode.

parent 0fbb9842
...@@ -5100,6 +5100,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL ...@@ -5100,6 +5100,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_CUT */ NULL, /* WINED3DSIH_CUT */ NULL,
/* WINED3DSIH_DCL */ shader_hw_nop, /* WINED3DSIH_DCL */ shader_hw_nop,
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_hw_nop, /* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_hw_nop,
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_hw_nop,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop, /* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop,
/* WINED3DSIH_DEF */ shader_hw_nop, /* WINED3DSIH_DEF */ shader_hw_nop,
/* WINED3DSIH_DEFB */ shader_hw_nop, /* WINED3DSIH_DEFB */ shader_hw_nop,
......
...@@ -5032,6 +5032,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB ...@@ -5032,6 +5032,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_CUT */ NULL, /* WINED3DSIH_CUT */ NULL,
/* WINED3DSIH_DCL */ shader_glsl_nop, /* WINED3DSIH_DCL */ shader_glsl_nop,
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_glsl_nop, /* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_glsl_nop,
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_glsl_nop,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop, /* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop,
/* WINED3DSIH_DEF */ shader_glsl_nop, /* WINED3DSIH_DEF */ shader_glsl_nop,
/* WINED3DSIH_DEFB */ shader_glsl_nop, /* WINED3DSIH_DEFB */ shader_glsl_nop,
......
...@@ -51,6 +51,7 @@ static const char * const shader_opcode_names[] = ...@@ -51,6 +51,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_CUT */ "cut", /* WINED3DSIH_CUT */ "cut",
/* WINED3DSIH_DCL */ "dcl", /* WINED3DSIH_DCL */ "dcl",
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ "dcl_inputPrimitive", /* WINED3DSIH_DCL_INPUT_PRIMITIVE */ "dcl_inputPrimitive",
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ "dcl_outputTopology",
/* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount", /* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount",
/* WINED3DSIH_DEF */ "def", /* WINED3DSIH_DEF */ "def",
/* WINED3DSIH_DEFB */ "defb", /* WINED3DSIH_DEFB */ "defb",
...@@ -1366,7 +1367,8 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe ...@@ -1366,7 +1367,8 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
TRACE(" "); TRACE(" ");
shader_dump_dst_param(&ins.declaration.semantic.reg, &shader_version); shader_dump_dst_param(&ins.declaration.semantic.reg, &shader_version);
} }
else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PRIMITIVE) else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PRIMITIVE
|| ins.handler_idx == WINED3DSIH_DCL_OUTPUT_TOPOLOGY)
{ {
TRACE("%s ", shader_opcode_names[ins.handler_idx]); TRACE("%s ", shader_opcode_names[ins.handler_idx]);
shader_dump_primitive_type(ins.declaration.primitive_type); shader_dump_primitive_type(ins.declaration.primitive_type);
......
...@@ -101,6 +101,7 @@ enum wined3d_sm4_opcode ...@@ -101,6 +101,7 @@ enum wined3d_sm4_opcode
WINED3D_SM4_OP_USHR = 0x55, WINED3D_SM4_OP_USHR = 0x55,
WINED3D_SM4_OP_UTOF = 0x56, WINED3D_SM4_OP_UTOF = 0x56,
WINED3D_SM4_OP_XOR = 0x57, WINED3D_SM4_OP_XOR = 0x57,
WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY = 0x5c,
WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE = 0x5d, WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE = 0x5d,
WINED3D_SM4_OP_DCL_VERTICES_OUT = 0x5e, WINED3D_SM4_OP_DCL_VERTICES_OUT = 0x5e,
}; };
...@@ -116,6 +117,13 @@ enum wined3d_sm4_register_type ...@@ -116,6 +117,13 @@ enum wined3d_sm4_register_type
WINED3D_SM4_RT_NULL = 0xd, WINED3D_SM4_RT_NULL = 0xd,
}; };
enum wined3d_sm4_output_primitive_type
{
WINED3D_SM4_OUTPUT_PT_POINTLIST = 0x1,
WINED3D_SM4_OUTPUT_PT_LINELIST = 0x3,
WINED3D_SM4_OUTPUT_PT_TRIANGLESTRIP = 0x5,
};
enum wined3d_sm4_input_primitive_type enum wined3d_sm4_input_primitive_type
{ {
WINED3D_SM4_INPUT_PT_POINT = 0x1, WINED3D_SM4_INPUT_PT_POINT = 0x1,
...@@ -213,6 +221,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = ...@@ -213,6 +221,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
{WINED3D_SM4_OP_USHR, WINED3DSIH_USHR, "U", "UU"}, {WINED3D_SM4_OP_USHR, WINED3DSIH_USHR, "U", "UU"},
{WINED3D_SM4_OP_UTOF, WINED3DSIH_UTOF, "F", "U"}, {WINED3D_SM4_OP_UTOF, WINED3DSIH_UTOF, "F", "U"},
{WINED3D_SM4_OP_XOR, WINED3DSIH_XOR, "U", "UU"}, {WINED3D_SM4_OP_XOR, WINED3DSIH_XOR, "U", "UU"},
{WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY, WINED3DSIH_DCL_OUTPUT_TOPOLOGY, "", ""},
{WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE, WINED3DSIH_DCL_INPUT_PRIMITIVE, "", ""}, {WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE, WINED3DSIH_DCL_INPUT_PRIMITIVE, "", ""},
{WINED3D_SM4_OP_DCL_VERTICES_OUT, WINED3DSIH_DCL_VERTICES_OUT, "", ""}, {WINED3D_SM4_OP_DCL_VERTICES_OUT, WINED3DSIH_DCL_VERTICES_OUT, "", ""},
}; };
...@@ -235,6 +244,16 @@ static const enum wined3d_shader_register_type register_type_table[] = ...@@ -235,6 +244,16 @@ static const enum wined3d_shader_register_type register_type_table[] =
/* WINED3D_SM4_RT_NULL */ WINED3DSPR_NULL, /* WINED3D_SM4_RT_NULL */ WINED3DSPR_NULL,
}; };
static const enum wined3d_primitive_type output_primitive_type_table[] =
{
/* UNKNOWN */ WINED3D_PT_UNDEFINED,
/* WINED3D_SM4_OUTPUT_PT_POINTLIST */ WINED3D_PT_POINTLIST,
/* UNKNOWN */ WINED3D_PT_UNDEFINED,
/* WINED3D_SM4_OUTPUT_PT_LINELIST */ WINED3D_PT_LINELIST,
/* UNKNOWN */ WINED3D_PT_UNDEFINED,
/* WINED3D_SM4_OUTPUT_PT_TRIANGLESTRIP */ WINED3D_PT_TRIANGLESTRIP,
};
static const enum wined3d_primitive_type input_primitive_type_table[] = static const enum wined3d_primitive_type input_primitive_type_table[] =
{ {
/* UNKNOWN */ WINED3D_PT_UNDEFINED, /* UNKNOWN */ WINED3D_PT_UNDEFINED,
...@@ -562,7 +581,22 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi ...@@ -562,7 +581,22 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
FIXME("Skipping modifier 0x%08x.\n", modifier); FIXME("Skipping modifier 0x%08x.\n", modifier);
} }
if (opcode == WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE) if (opcode == WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY)
{
enum wined3d_sm4_output_primitive_type primitive_type;
primitive_type = (opcode_token & WINED3D_SM4_PRIMITIVE_TYPE_MASK) >> WINED3D_SM4_PRIMITIVE_TYPE_SHIFT;
if (primitive_type >= sizeof(output_primitive_type_table) / sizeof(*output_primitive_type_table))
{
FIXME("Unhandled output primitive type %#x.\n", primitive_type);
ins->declaration.primitive_type = WINED3D_PT_UNDEFINED;
}
else
{
ins->declaration.primitive_type = output_primitive_type_table[primitive_type];
}
}
else if (opcode == WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE)
{ {
enum wined3d_sm4_input_primitive_type primitive_type; enum wined3d_sm4_input_primitive_type primitive_type;
......
...@@ -440,6 +440,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER ...@@ -440,6 +440,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_CUT, WINED3DSIH_CUT,
WINED3DSIH_DCL, WINED3DSIH_DCL,
WINED3DSIH_DCL_INPUT_PRIMITIVE, WINED3DSIH_DCL_INPUT_PRIMITIVE,
WINED3DSIH_DCL_OUTPUT_TOPOLOGY,
WINED3DSIH_DCL_VERTICES_OUT, WINED3DSIH_DCL_VERTICES_OUT,
WINED3DSIH_DEF, WINED3DSIH_DEF,
WINED3DSIH_DEFB, WINED3DSIH_DEFB,
......
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