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

wined3d: Recognize SM5 dcl_gsinstances opcode.

parent 86f9eab8
......@@ -5054,6 +5054,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_DCL_FUNCTION_BODY */ NULL,
/* WINED3DSIH_DCL_FUNCTION_TABLE */ NULL,
/* WINED3DSIH_DCL_GLOBAL_FLAGS */ NULL,
/* WINED3DSIH_DCL_GS_INSTANCES */ NULL,
/* WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT */ NULL,
/* WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT */ NULL,
/* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ NULL,
......
......@@ -10049,6 +10049,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_FUNCTION_BODY */ NULL,
/* WINED3DSIH_DCL_FUNCTION_TABLE */ NULL,
/* WINED3DSIH_DCL_GLOBAL_FLAGS */ shader_glsl_nop,
/* WINED3DSIH_DCL_GS_INSTANCES */ NULL,
/* WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT */ NULL,
/* WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT */ NULL,
/* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ NULL,
......
......@@ -74,6 +74,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_DCL_FUNCTION_BODY */ "dcl_function_body",
/* WINED3DSIH_DCL_FUNCTION_TABLE */ "dcl_function_table",
/* WINED3DSIH_DCL_GLOBAL_FLAGS */ "dcl_globalFlags",
/* WINED3DSIH_DCL_GS_INSTANCES */ "dcl_gs_instances",
/* WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT */ "dcl_hs_fork_phase_instance_count",
/* WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT */ "dcl_hs_join_phase_instance_count",
/* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ "dcl_hs_max_tessfactor",
......@@ -1019,6 +1020,14 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
else
reg_maps->cb_sizes[reg->idx[0].offset] = reg->idx[1].offset;
}
else if (ins.handler_idx == WINED3DSIH_DCL_GS_INSTANCES)
{
if (shader_version.type == WINED3D_SHADER_TYPE_GEOMETRY)
shader->u.gs.instance_count = ins.declaration.count;
else
FIXME("Invalid instruction %#x for shader type %#x.\n",
ins.handler_idx, shader_version.type);
}
else if (ins.handler_idx == WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER)
{
if (reg_maps->icb)
......@@ -2648,11 +2657,12 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
shader_addline(&buffer, ", comparisonMode");
}
else if (ins.handler_idx == WINED3DSIH_DCL_TEMPS
|| ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT
|| ins.handler_idx == WINED3DSIH_DCL_GS_INSTANCES
|| ins.handler_idx == WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT
|| ins.handler_idx == WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT
|| ins.handler_idx == WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT
|| ins.handler_idx == WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT)
|| ins.handler_idx == WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT
|| ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT)
{
shader_addline(&buffer, "%s %u", shader_opcode_names[ins.handler_idx], ins.declaration.count);
}
......
......@@ -294,6 +294,7 @@ enum wined3d_sm4_opcode
WINED3D_SM5_OP_IMM_ATOMIC_UMAX = 0xbc,
WINED3D_SM5_OP_IMM_ATOMIC_UMIN = 0xbd,
WINED3D_SM5_OP_SYNC = 0xbe,
WINED3D_SM5_OP_DCL_GS_INSTANCES = 0xce,
};
enum wined3d_sm4_register_type
......@@ -1053,6 +1054,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
{WINED3D_SM5_OP_IMM_ATOMIC_UMIN, WINED3DSIH_IMM_ATOMIC_UMIN, "uU", "iu"},
{WINED3D_SM5_OP_SYNC, WINED3DSIH_SYNC, "", "",
shader_sm5_read_sync},
{WINED3D_SM5_OP_DCL_GS_INSTANCES, WINED3DSIH_DCL_GS_INSTANCES, "", "",
shader_sm4_read_declaration_count},
};
static const enum wined3d_shader_register_type register_type_table[] =
......
......@@ -700,6 +700,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_DCL_FUNCTION_BODY,
WINED3DSIH_DCL_FUNCTION_TABLE,
WINED3DSIH_DCL_GLOBAL_FLAGS,
WINED3DSIH_DCL_GS_INSTANCES,
WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT,
WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT,
WINED3DSIH_DCL_HS_MAX_TESSFACTOR,
......@@ -3681,7 +3682,8 @@ struct wined3d_geometry_shader
{
enum wined3d_primitive_type input_type;
enum wined3d_primitive_type output_type;
UINT vertices_out;
unsigned int vertices_out;
unsigned int instance_count;
struct wined3d_stream_output_desc so_desc;
};
......
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