wined3d: Recognize SM5 dcl_thread_group 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:
Józef Kucia 2016-06-21 13:10:02 +02:00 committed by Alexandre Julliard
parent ddb4466d14
commit 0c83f4d5be
5 changed files with 29 additions and 0 deletions

View file

@ -5250,6 +5250,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ NULL,
/* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL,
/* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ NULL,
/* WINED3DSIH_DCL_THREAD_GROUP */ NULL,
/* WINED3DSIH_DCL_UAV_TYPED */ NULL,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop,
/* WINED3DSIH_DEF */ shader_hw_nop,

View file

@ -8588,6 +8588,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ NULL,
/* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL,
/* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ NULL,
/* WINED3DSIH_DCL_THREAD_GROUP */ NULL,
/* WINED3DSIH_DCL_UAV_TYPED */ NULL,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop,
/* WINED3DSIH_DEF */ shader_glsl_nop,

View file

@ -80,6 +80,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ "dcl_tessellator_domain",
/* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ "dcl_tessellator_output_primitive",
/* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ "dcl_tessellator_partitioning",
/* WINED3DSIH_DCL_THREAD_GROUP */ "dcl_thread_group",
/* WINED3DSIH_DCL_UAV_TYPED */ "dcl_uav_typed",
/* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount",
/* WINED3DSIH_DEF */ "def",
@ -2267,6 +2268,13 @@ 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_partitioning(&buffer, ins.declaration.tessellator_partitioning);
}
else if (ins.handler_idx == WINED3DSIH_DCL_THREAD_GROUP)
{
shader_addline(&buffer, "%s %u, %u, %u", shader_opcode_names[ins.handler_idx],
ins.declaration.thread_group_size.x,
ins.declaration.thread_group_size.y,
ins.declaration.thread_group_size.z);
}
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,

View file

@ -219,6 +219,7 @@ enum wined3d_sm4_opcode
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_THREAD_GROUP = 0x9b,
WINED3D_SM5_OP_DCL_UAV_TYPED = 0x9c,
WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED = 0xa2,
WINED3D_SM5_OP_LD_UAV_TYPED = 0xa3,
@ -617,6 +618,15 @@ static void shader_sm5_read_dcl_hs_max_tessfactor(struct wined3d_shader_instruct
ins->declaration.max_tessellation_factor = *(float *)tokens;
}
static void shader_sm5_read_dcl_thread_group(struct wined3d_shader_instruction *ins,
DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
struct wined3d_sm4_data *priv)
{
ins->declaration.thread_group_size.x = *tokens++;
ins->declaration.thread_group_size.y = *tokens++;
ins->declaration.thread_group_size.z = *tokens++;
}
static void shader_sm5_read_dcl_resource_structured(struct wined3d_shader_instruction *ins,
DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
struct wined3d_sm4_data *priv)
@ -773,6 +783,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
shader_sm5_read_dcl_hs_max_tessfactor},
{WINED3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT, WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT, "", "",
shader_sm4_read_declaration_count},
{WINED3D_SM5_OP_DCL_THREAD_GROUP, WINED3DSIH_DCL_THREAD_GROUP, "", "",
shader_sm5_read_dcl_thread_group},
{WINED3D_SM5_OP_DCL_UAV_TYPED, WINED3DSIH_DCL_UAV_TYPED, "", "",
shader_sm4_read_dcl_resource},
{WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED, WINED3DSIH_DCL_RESOURCE_STRUCTURED, "", "",

View file

@ -593,6 +593,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_DCL_TESSELLATOR_DOMAIN,
WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE,
WINED3DSIH_DCL_TESSELLATOR_PARTITIONING,
WINED3DSIH_DCL_THREAD_GROUP,
WINED3DSIH_DCL_UAV_TYPED,
WINED3DSIH_DCL_VERTICES_OUT,
WINED3DSIH_DEF,
@ -911,6 +912,11 @@ struct wined3d_shader_structured_resource
unsigned int byte_stride;
};
struct wined3d_shader_thread_group_size
{
unsigned int x, y, z;
};
struct wined3d_shader_texel_offset
{
signed char u, v, w;
@ -938,6 +944,7 @@ struct wined3d_shader_instruction
UINT count;
const struct wined3d_shader_immediate_constant_buffer *icb;
struct wined3d_shader_structured_resource structured_resource;
struct wined3d_shader_thread_group_size thread_group_size;
enum wined3d_tessellator_domain tessellator_domain;
enum wined3d_tessellator_output_primitive tessellator_output_primitive;
enum wined3d_tessellator_partitioning tessellator_partitioning;