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

wined3d: Recognize SM5 dcl_tessellator_domain opcode.

parent e7003fd2
......@@ -5248,6 +5248,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_DCL_RESOURCE_STRUCTURED */ NULL,
/* WINED3DSIH_DCL_SAMPLER */ NULL,
/* WINED3DSIH_DCL_TEMPS */ NULL,
/* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ NULL,
/* WINED3DSIH_DCL_UAV_TYPED */ NULL,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop,
/* WINED3DSIH_DEF */ shader_hw_nop,
......
......@@ -8162,6 +8162,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_RESOURCE_STRUCTURED */ NULL,
/* WINED3DSIH_DCL_SAMPLER */ shader_glsl_nop,
/* WINED3DSIH_DCL_TEMPS */ shader_glsl_nop,
/* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ NULL,
/* WINED3DSIH_DCL_UAV_TYPED */ NULL,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop,
/* WINED3DSIH_DEF */ shader_glsl_nop,
......
......@@ -74,6 +74,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_DCL_RESOURCE_STRUCTURED */ "dcl_resource_structured",
/* WINED3DSIH_DCL_SAMPLER */ "dcl_sampler",
/* WINED3DSIH_DCL_TEMPS */ "dcl_temps",
/* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ "dcl_tessellator_domain",
/* WINED3DSIH_DCL_UAV_TYPED */ "dcl_uav_typed",
/* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount",
/* WINED3DSIH_DEF */ "def",
......@@ -1297,6 +1298,26 @@ static void shader_dump_global_flags(struct wined3d_string_buffer *buffer, DWORD
shader_addline(buffer, "unknown_flags(%#x)", global_flags);
}
static void shader_dump_tessellator_domain(struct wined3d_string_buffer *buffer,
enum wined3d_tessellator_domain domain)
{
switch (domain)
{
case WINED3D_TESSELLATOR_DOMAIN_LINE:
shader_addline(buffer, "line");
break;
case WINED3D_TESSELLATOR_DOMAIN_TRIANGLE:
shader_addline(buffer, "triangle");
break;
case WINED3D_TESSELLATOR_DOMAIN_QUAD:
shader_addline(buffer, "quad");
break;
default:
shader_addline(buffer, "unknown_tessellator_domain(%#x)", domain);
break;
}
}
static void shader_dump_sysval_semantic(struct wined3d_string_buffer *buffer, enum wined3d_sysval_semantic semantic)
{
unsigned int i;
......@@ -2093,6 +2114,11 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
{
shader_addline(&buffer, "%s %u", shader_opcode_names[ins.handler_idx], ins.declaration.count);
}
else if (ins.handler_idx == WINED3DSIH_DCL_TESSELLATOR_DOMAIN)
{
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_DEF)
{
shader_addline(&buffer, "def c%u = %.8e, %.8e, %.8e, %.8e", shader_get_float_offset(ins.dst[0].reg.type,
......
......@@ -64,6 +64,9 @@ 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_SM4_OPCODE_MASK 0xff
#define WINED3D_SM4_REGISTER_MODIFIER (0x1u << 31)
......@@ -195,6 +198,7 @@ enum wined3d_sm4_opcode
WINED3D_SM5_OP_DERIV_RTY_FINE = 0x7d,
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_HS_MAX_TESSFACTOR = 0x98,
WINED3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT = 0x99,
WINED3D_SM5_OP_DCL_UAV_TYPED = 0x9c,
......@@ -414,6 +418,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
{WINED3D_SM5_OP_DERIV_RTY_FINE, WINED3DSIH_DSY_FINE, "f", "f"},
{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_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, "", ""},
......@@ -1039,6 +1044,11 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
FIXME("Unhandled sampler mode %#x.\n", ins->flags);
shader_sm4_read_dst_param(priv, &p, WINED3D_DATA_SAMPLER, &ins->declaration.dst);
}
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;
}
else if (opcode == WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY)
{
enum wined3d_sm4_output_primitive_type primitive_type;
......
......@@ -439,6 +439,13 @@ enum wined3d_shader_global_flags
WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS = 0x8,
};
enum wined3d_tessellator_domain
{
WINED3D_TESSELLATOR_DOMAIN_LINE = 1,
WINED3D_TESSELLATOR_DOMAIN_TRIANGLE = 2,
WINED3D_TESSELLATOR_DOMAIN_QUAD = 3,
};
/* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */
#define WINED3DSI_TEXLD_PROJECT 0x1
#define WINED3DSI_TEXLD_BIAS 0x2
......@@ -531,6 +538,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_DCL_RESOURCE_STRUCTURED,
WINED3DSIH_DCL_SAMPLER,
WINED3DSIH_DCL_TEMPS,
WINED3DSIH_DCL_TESSELLATOR_DOMAIN,
WINED3DSIH_DCL_UAV_TYPED,
WINED3DSIH_DCL_VERTICES_OUT,
WINED3DSIH_DEF,
......@@ -857,6 +865,7 @@ struct wined3d_shader_instruction
UINT count;
const struct wined3d_shader_immediate_constant_buffer *icb;
struct wined3d_shader_structured_resource structured_resource;
enum wined3d_tessellator_domain tessellator_domain;
float max_tessellation_factor;
} 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