wined3d: Recognize SM5 dcl_tessellator_output_primitive 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>
This commit is contained in:
parent
e1a870c6ab
commit
90dcb4db72
|
@ -5249,6 +5249,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
|
|||
/* WINED3DSIH_DCL_SAMPLER */ NULL,
|
||||
/* WINED3DSIH_DCL_TEMPS */ NULL,
|
||||
/* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ NULL,
|
||||
/* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL,
|
||||
/* WINED3DSIH_DCL_UAV_TYPED */ NULL,
|
||||
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop,
|
||||
/* WINED3DSIH_DEF */ shader_hw_nop,
|
||||
|
|
|
@ -8163,6 +8163,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
|
|||
/* WINED3DSIH_DCL_SAMPLER */ shader_glsl_nop,
|
||||
/* WINED3DSIH_DCL_TEMPS */ shader_glsl_nop,
|
||||
/* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ NULL,
|
||||
/* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL,
|
||||
/* WINED3DSIH_DCL_UAV_TYPED */ NULL,
|
||||
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop,
|
||||
/* WINED3DSIH_DEF */ shader_glsl_nop,
|
||||
|
|
|
@ -75,6 +75,7 @@ static const char * const shader_opcode_names[] =
|
|||
/* WINED3DSIH_DCL_SAMPLER */ "dcl_sampler",
|
||||
/* WINED3DSIH_DCL_TEMPS */ "dcl_temps",
|
||||
/* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ "dcl_tessellator_domain",
|
||||
/* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ "dcl_tessellator_output_primitive",
|
||||
/* WINED3DSIH_DCL_UAV_TYPED */ "dcl_uav_typed",
|
||||
/* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount",
|
||||
/* WINED3DSIH_DEF */ "def",
|
||||
|
@ -1318,6 +1319,29 @@ static void shader_dump_tessellator_domain(struct wined3d_string_buffer *buffer,
|
|||
}
|
||||
}
|
||||
|
||||
static void shader_dump_tessellator_output_primitive(struct wined3d_string_buffer *buffer,
|
||||
enum wined3d_tessellator_output_primitive output_primitive)
|
||||
{
|
||||
switch (output_primitive)
|
||||
{
|
||||
case WINED3D_TESSELLATOR_OUTPUT_POINT:
|
||||
shader_addline(buffer, "point");
|
||||
break;
|
||||
case WINED3D_TESSELLATOR_OUTPUT_LINE:
|
||||
shader_addline(buffer, "line");
|
||||
break;
|
||||
case WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CW:
|
||||
shader_addline(buffer, "triangle_cw");
|
||||
break;
|
||||
case WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW:
|
||||
shader_addline(buffer, "triangle_ccw");
|
||||
break;
|
||||
default:
|
||||
shader_addline(buffer, "unknown_tessellator_output_primitive(%#x)", output_primitive);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void shader_dump_sysval_semantic(struct wined3d_string_buffer *buffer, enum wined3d_sysval_semantic semantic)
|
||||
{
|
||||
unsigned int i;
|
||||
|
@ -2119,6 +2143,11 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
|
|||
shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
|
||||
shader_dump_tessellator_domain(&buffer, ins.declaration.tessellator_domain);
|
||||
}
|
||||
else if (ins.handler_idx == WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE)
|
||||
{
|
||||
shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
|
||||
shader_dump_tessellator_output_primitive(&buffer, ins.declaration.tessellator_output_primitive);
|
||||
}
|
||||
else if (ins.handler_idx == WINED3DSIH_DEF)
|
||||
{
|
||||
shader_addline(&buffer, "def c%u = %.8e, %.8e, %.8e, %.8e", shader_get_float_offset(ins.dst[0].reg.type,
|
||||
|
|
|
@ -64,8 +64,8 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode);
|
|||
#define WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT 11
|
||||
#define WINED3D_SM5_CONTROL_POINT_COUNT_MASK (0xffu << WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT)
|
||||
|
||||
#define WINED3D_SM5_TESSELLATOR_DOMAIN_SHIFT 11
|
||||
#define WINED3D_SM5_TESSELLATOR_DOMAIN_MASK (0xfu << WINED3D_SM5_TESSELLATOR_DOMAIN_SHIFT)
|
||||
#define WINED3D_SM5_TESSELLATOR_SHIFT 11
|
||||
#define WINED3D_SM5_TESSELLATOR_MASK (0xfu << WINED3D_SM5_TESSELLATOR_SHIFT)
|
||||
|
||||
#define WINED3D_SM4_OPCODE_MASK 0xff
|
||||
|
||||
|
@ -199,6 +199,7 @@ enum wined3d_sm4_opcode
|
|||
WINED3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT = 0x93,
|
||||
WINED3D_SM5_OP_DCL_OUTPUT_CONTROL_POINT_COUNT = 0x94,
|
||||
WINED3D_SM5_OP_DCL_TESSELLATOR_DOMAIN = 0x95,
|
||||
WINED3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE = 0x97,
|
||||
WINED3D_SM5_OP_DCL_HS_MAX_TESSFACTOR = 0x98,
|
||||
WINED3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT = 0x99,
|
||||
WINED3D_SM5_OP_DCL_UAV_TYPED = 0x9c,
|
||||
|
@ -419,6 +420,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
|
|||
{WINED3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT, WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT, "", ""},
|
||||
{WINED3D_SM5_OP_DCL_OUTPUT_CONTROL_POINT_COUNT, WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT, "", ""},
|
||||
{WINED3D_SM5_OP_DCL_TESSELLATOR_DOMAIN, WINED3DSIH_DCL_TESSELLATOR_DOMAIN, "", ""},
|
||||
{WINED3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE, WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE, "", ""},
|
||||
{WINED3D_SM5_OP_DCL_HS_MAX_TESSFACTOR, WINED3DSIH_DCL_HS_MAX_TESSFACTOR, "", ""},
|
||||
{WINED3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT, WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT, "", ""},
|
||||
{WINED3D_SM5_OP_DCL_UAV_TYPED, WINED3DSIH_DCL_UAV_TYPED, "", ""},
|
||||
|
@ -1046,8 +1048,13 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
|
|||
}
|
||||
else if (opcode == WINED3D_SM5_OP_DCL_TESSELLATOR_DOMAIN)
|
||||
{
|
||||
ins->declaration.tessellator_domain = (opcode_token & WINED3D_SM5_TESSELLATOR_DOMAIN_MASK)
|
||||
>> WINED3D_SM5_TESSELLATOR_DOMAIN_SHIFT;
|
||||
ins->declaration.tessellator_domain = (opcode_token & WINED3D_SM5_TESSELLATOR_MASK)
|
||||
>> WINED3D_SM5_TESSELLATOR_SHIFT;
|
||||
}
|
||||
else if (opcode == WINED3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE)
|
||||
{
|
||||
ins->declaration.tessellator_output_primitive = (opcode_token & WINED3D_SM5_TESSELLATOR_MASK)
|
||||
>> WINED3D_SM5_TESSELLATOR_SHIFT;
|
||||
}
|
||||
else if (opcode == WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY)
|
||||
{
|
||||
|
|
|
@ -446,6 +446,14 @@ enum wined3d_tessellator_domain
|
|||
WINED3D_TESSELLATOR_DOMAIN_QUAD = 3,
|
||||
};
|
||||
|
||||
enum wined3d_tessellator_output_primitive
|
||||
{
|
||||
WINED3D_TESSELLATOR_OUTPUT_POINT = 1,
|
||||
WINED3D_TESSELLATOR_OUTPUT_LINE = 2,
|
||||
WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3,
|
||||
WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4,
|
||||
};
|
||||
|
||||
/* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */
|
||||
#define WINED3DSI_TEXLD_PROJECT 0x1
|
||||
#define WINED3DSI_TEXLD_BIAS 0x2
|
||||
|
@ -539,6 +547,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
|
|||
WINED3DSIH_DCL_SAMPLER,
|
||||
WINED3DSIH_DCL_TEMPS,
|
||||
WINED3DSIH_DCL_TESSELLATOR_DOMAIN,
|
||||
WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE,
|
||||
WINED3DSIH_DCL_UAV_TYPED,
|
||||
WINED3DSIH_DCL_VERTICES_OUT,
|
||||
WINED3DSIH_DEF,
|
||||
|
@ -866,6 +875,7 @@ struct wined3d_shader_instruction
|
|||
const struct wined3d_shader_immediate_constant_buffer *icb;
|
||||
struct wined3d_shader_structured_resource structured_resource;
|
||||
enum wined3d_tessellator_domain tessellator_domain;
|
||||
enum wined3d_tessellator_output_primitive tessellator_output_primitive;
|
||||
float max_tessellation_factor;
|
||||
} declaration;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue