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

wined3d: Recognize SM4 dcl_index_range opcode.

parent 2059beda
......@@ -5058,6 +5058,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT */ NULL,
/* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ NULL,
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL,
/* WINED3DSIH_DCL_INDEX_RANGE */ NULL,
/* WINED3DSIH_DCL_INDEXABLE_TEMP */ NULL,
/* WINED3DSIH_DCL_INPUT */ NULL,
/* WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT */ NULL,
......
......@@ -9641,6 +9641,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT */ NULL,
/* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ NULL,
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ shader_glsl_nop,
/* WINED3DSIH_DCL_INDEX_RANGE */ NULL,
/* WINED3DSIH_DCL_INDEXABLE_TEMP */ shader_glsl_nop,
/* WINED3DSIH_DCL_INPUT */ shader_glsl_nop,
/* WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT */ NULL,
......
......@@ -78,6 +78,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT */ "dcl_hs_join_phase_instance_count",
/* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ "dcl_hs_max_tessfactor",
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ "dcl_immediateConstantBuffer",
/* WINED3DSIH_DCL_INDEX_RANGE */ "dcl_index_range",
/* WINED3DSIH_DCL_INDEXABLE_TEMP */ "dcl_indexableTemp",
/* WINED3DSIH_DCL_INPUT */ "dcl_input",
/* WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT */ "dcl_input_control_point_count",
......@@ -2555,6 +2556,12 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
}
shader_addline(&buffer, "}");
}
else if (ins.handler_idx == WINED3DSIH_DCL_INDEX_RANGE)
{
shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
shader_dump_dst_param(&buffer, &ins.declaration.index_range.first_register, &shader_version);
shader_addline(&buffer, " %u", ins.declaration.index_range.last_register);
}
else if (ins.handler_idx == WINED3DSIH_DCL_INDEXABLE_TEMP)
{
shader_addline(&buffer, "%s x[%u][%u], %u", shader_opcode_names[ins.handler_idx],
......
......@@ -200,6 +200,7 @@ enum wined3d_sm4_opcode
WINED3D_SM4_OP_DCL_RESOURCE = 0x58,
WINED3D_SM4_OP_DCL_CONSTANT_BUFFER = 0x59,
WINED3D_SM4_OP_DCL_SAMPLER = 0x5a,
WINED3D_SM4_OP_DCL_INDEX_RANGE = 0x5b,
WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY = 0x5c,
WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE = 0x5d,
WINED3D_SM4_OP_DCL_VERTICES_OUT = 0x5e,
......@@ -571,6 +572,14 @@ static void shader_sm4_read_dcl_sampler(struct wined3d_shader_instruction *ins,
shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_SAMPLER, &ins->declaration.dst);
}
static void shader_sm4_read_dcl_index_range(struct wined3d_shader_instruction *ins,
DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
struct wined3d_sm4_data *priv)
{
shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_OPAQUE, &ins->declaration.index_range.first_register);
ins->declaration.index_range.last_register = *tokens;
}
static void shader_sm4_read_dcl_output_topology(struct wined3d_shader_instruction *ins,
DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
struct wined3d_sm4_data *priv)
......@@ -909,6 +918,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
shader_sm4_read_dcl_constant_buffer},
{WINED3D_SM4_OP_DCL_SAMPLER, WINED3DSIH_DCL_SAMPLER, "", "",
shader_sm4_read_dcl_sampler},
{WINED3D_SM4_OP_DCL_INDEX_RANGE, WINED3DSIH_DCL_INDEX_RANGE, "", "",
shader_sm4_read_dcl_index_range},
{WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY, WINED3DSIH_DCL_OUTPUT_TOPOLOGY, "", "",
shader_sm4_read_dcl_output_topology},
{WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE, WINED3DSIH_DCL_INPUT_PRIMITIVE, "", "",
......
......@@ -695,6 +695,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT,
WINED3DSIH_DCL_HS_MAX_TESSFACTOR,
WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER,
WINED3DSIH_DCL_INDEX_RANGE,
WINED3DSIH_DCL_INDEXABLE_TEMP,
WINED3DSIH_DCL_INPUT,
WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT,
......@@ -1070,6 +1071,12 @@ struct wined3d_shader_src_param
enum wined3d_shader_src_modifier modifiers;
};
struct wined3d_shader_index_range
{
struct wined3d_shader_dst_param first_register;
unsigned int last_register;
};
struct wined3d_shader_semantic
{
enum wined3d_decl_usage usage;
......@@ -1158,6 +1165,7 @@ struct wined3d_shader_instruction
enum wined3d_tessellator_output_primitive tessellator_output_primitive;
enum wined3d_tessellator_partitioning tessellator_partitioning;
float max_tessellation_factor;
struct wined3d_shader_index_range index_range;
struct wined3d_shader_indexable_temp indexable_temp;
struct wined3d_shader_function_table_pointer fp;
} 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