wined3d: Recognize SM4 dcl_input_ps 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-02-02 11:32:27 +01:00 committed by Alexandre Julliard
parent a69d7b29e3
commit 3013125240
5 changed files with 63 additions and 0 deletions

View File

@ -5229,6 +5229,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_DCL_CONSTANT_BUFFER */ shader_hw_nop,
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL,
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_hw_nop,
/* WINED3DSIH_DCL_INPUT_PS */ NULL,
/* WINED3DSIH_DCL_OUTPUT */ NULL,
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_hw_nop,
/* WINED3DSIH_DCL_SAMPLER */ NULL,

View File

@ -8017,6 +8017,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_CONSTANT_BUFFER */ shader_glsl_nop,
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL,
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_glsl_nop,
/* WINED3DSIH_DCL_INPUT_PS */ NULL,
/* WINED3DSIH_DCL_OUTPUT */ shader_glsl_nop,
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_glsl_nop,
/* WINED3DSIH_DCL_SAMPLER */ NULL,

View File

@ -57,6 +57,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_DCL_CONSTANT_BUFFER */ "dcl_constantBuffer",
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ "dcl_immediateConstantBuffer",
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ "dcl_inputPrimitive",
/* WINED3DSIH_DCL_INPUT_PS */ "dcl_input_ps",
/* WINED3DSIH_DCL_OUTPUT */ "dcl_output",
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ "dcl_outputTopology",
/* WINED3DSIH_DCL_SAMPLER */ "dcl_sampler",
@ -1774,6 +1775,37 @@ static void shader_dump_primitive_type(enum wined3d_primitive_type primitive_typ
}
}
static void shader_dump_interpolation_mode(enum wined3d_shader_interpolation_mode interpolation_mode)
{
switch (interpolation_mode)
{
case WINED3DSIM_CONSTANT:
TRACE("constant");
break;
case WINED3DSIM_LINEAR:
TRACE("linear");
break;
case WINED3DSIM_LINEAR_CENTROID:
TRACE("linear centroid");
break;
case WINED3DSIM_LINEAR_NOPERSPECTIVE:
TRACE("linear noperspective");
break;
case WINED3DSIM_LINEAR_SAMPLE:
TRACE("linear sample");
break;
case WINED3DSIM_LINEAR_NOPERSPECTIVE_CENTROID:
TRACE("linear noperspective centroid");
break;
case WINED3DSIM_LINEAR_NOPERSPECTIVE_SAMPLE:
TRACE("linear noperspective sample");
break;
default:
TRACE("<unrecognized_interpolation_mode %#x>", interpolation_mode);
break;
}
}
static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe_data, const DWORD *byte_code)
{
struct wined3d_shader_version shader_version;
@ -1844,6 +1876,13 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
}
TRACE("}");
}
else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PS)
{
TRACE("%s ", shader_opcode_names[ins.handler_idx]);
shader_dump_interpolation_mode(ins.flags);
TRACE(" ");
shader_dump_dst_param(&ins.declaration.dst, &shader_version);
}
else if (ins.handler_idx == WINED3DSIH_DCL_OUTPUT)
{
TRACE("%s ", shader_opcode_names[ins.handler_idx]);

View File

@ -47,6 +47,9 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode);
#define WINED3D_SM4_SHADER_DATA_TYPE_SHIFT 11
#define WINED3D_SM4_SHADER_DATA_TYPE_MASK (0xfu << WINED3D_SM4_SHADER_DATA_TYPE_SHIFT)
#define WINED3D_SM4_INTERPOLATION_MODE_SHIFT 11
#define WINED3D_SM4_INTERPOLATION_MODE_MASK (0xfu << WINED3D_SM4_INTERPOLATION_MODE_SHIFT)
#define WINED3D_SM4_OPCODE_MASK 0xff
#define WINED3D_SM4_REGISTER_MODIFIER (0x1u << 31)
@ -158,6 +161,7 @@ enum wined3d_sm4_opcode
WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY = 0x5c,
WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE = 0x5d,
WINED3D_SM4_OP_DCL_VERTICES_OUT = 0x5e,
WINED3D_SM4_OP_DCL_INPUT_PS = 0x62,
WINED3D_SM4_OP_DCL_OUTPUT = 0x65,
WINED3D_SM4_OP_DCL_TEMPS = 0x68,
};
@ -361,6 +365,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
{WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY, WINED3DSIH_DCL_OUTPUT_TOPOLOGY, "", ""},
{WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE, WINED3DSIH_DCL_INPUT_PRIMITIVE, "", ""},
{WINED3D_SM4_OP_DCL_VERTICES_OUT, WINED3DSIH_DCL_VERTICES_OUT, "", ""},
{WINED3D_SM4_OP_DCL_INPUT_PS, WINED3DSIH_DCL_INPUT_PS, "", ""},
{WINED3D_SM4_OP_DCL_OUTPUT, WINED3DSIH_DCL_OUTPUT, "", ""},
{WINED3D_SM4_OP_DCL_TEMPS, WINED3DSIH_DCL_TEMPS, "", ""},
};
@ -973,6 +978,11 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
ins->declaration.primitive_type = input_primitive_type_table[primitive_type];
}
}
else if (opcode == WINED3D_SM4_OP_DCL_INPUT_PS)
{
ins->flags = (opcode_token & WINED3D_SM4_INTERPOLATION_MODE_MASK) >> WINED3D_SM4_INTERPOLATION_MODE_SHIFT;
shader_sm4_read_dst_param(priv, &p, WINED3D_DATA_FLOAT, &ins->declaration.dst);
}
else if (opcode == WINED3D_SM4_OP_DCL_OUTPUT)
{
shader_sm4_read_dst_param(priv, &p, WINED3D_DATA_FLOAT, &ins->declaration.dst);

View File

@ -416,6 +416,17 @@ enum wined3d_shader_dst_modifier
WINED3DSPDM_MSAMPCENTROID = 4,
};
enum wined3d_shader_interpolation_mode
{
WINED3DSIM_CONSTANT = 1,
WINED3DSIM_LINEAR = 2,
WINED3DSIM_LINEAR_CENTROID = 3,
WINED3DSIM_LINEAR_NOPERSPECTIVE = 4,
WINED3DSIM_LINEAR_NOPERSPECTIVE_CENTROID = 5,
WINED3DSIM_LINEAR_SAMPLE = 6,
WINED3DSIM_LINEAR_NOPERSPECTIVE_SAMPLE = 7,
};
/* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */
#define WINED3DSI_TEXLD_PROJECT 0x1
#define WINED3DSI_TEXLD_BIAS 0x2
@ -490,6 +501,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_DCL_CONSTANT_BUFFER,
WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER,
WINED3DSIH_DCL_INPUT_PRIMITIVE,
WINED3DSIH_DCL_INPUT_PS,
WINED3DSIH_DCL_OUTPUT,
WINED3DSIH_DCL_OUTPUT_TOPOLOGY,
WINED3DSIH_DCL_SAMPLER,