Commit 6d948e1a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Recognize the SM4 dcl_constantBuffer opcode.

parent 2ad58089
......@@ -5101,6 +5101,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_CRS */ shader_hw_map2gl,
/* WINED3DSIH_CUT */ NULL,
/* WINED3DSIH_DCL */ shader_hw_nop,
/* WINED3DSIH_DCL_CONSTANT_BUFFER */ shader_hw_nop,
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_hw_nop,
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_hw_nop,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop,
......
......@@ -5120,6 +5120,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_CRS */ shader_glsl_cross,
/* WINED3DSIH_CUT */ shader_glsl_cut,
/* WINED3DSIH_DCL */ shader_glsl_nop,
/* WINED3DSIH_DCL_CONSTANT_BUFFER */ shader_glsl_nop,
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_glsl_nop,
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_glsl_nop,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop,
......
......@@ -50,6 +50,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_CRS */ "crs",
/* WINED3DSIH_CUT */ "cut",
/* WINED3DSIH_DCL */ "dcl",
/* WINED3DSIH_DCL_CONSTANT_BUFFER */ "dcl_constantBuffer",
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ "dcl_inputPrimitive",
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ "dcl_outputTopology",
/* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount",
......@@ -1367,6 +1368,12 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
TRACE(" ");
shader_dump_dst_param(&ins.declaration.semantic.reg, &shader_version);
}
else if (ins.handler_idx == WINED3DSIH_DCL_CONSTANT_BUFFER)
{
TRACE("%s ", shader_opcode_names[ins.handler_idx]);
shader_dump_src_param(&ins.declaration.src, &shader_version);
TRACE(", %s", ins.flags & WINED3DSI_INDEXED_DYNAMIC ? "dynamicIndexed" : "immediateIndexed");
}
else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PRIMITIVE
|| ins.handler_idx == WINED3DSIH_DCL_OUTPUT_TOPOLOGY)
{
......
......@@ -32,6 +32,9 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode);
#define WINED3D_SM4_PRIMITIVE_TYPE_SHIFT 11
#define WINED3D_SM4_PRIMITIVE_TYPE_MASK (0x7 << WINED3D_SM4_PRIMITIVE_TYPE_SHIFT)
#define WINED3D_SM4_INDEX_TYPE_SHIFT 11
#define WINED3D_SM4_INDEX_TYPE_MASK (0x1 << WINED3D_SM4_INDEX_TYPE_SHIFT)
#define WINED3D_SM4_OPCODE_MASK 0xff
#define WINED3D_SM4_REGISTER_MODIFIER (1 << 31)
......@@ -102,6 +105,7 @@ enum wined3d_sm4_opcode
WINED3D_SM4_OP_USHR = 0x55,
WINED3D_SM4_OP_UTOF = 0x56,
WINED3D_SM4_OP_XOR = 0x57,
WINED3D_SM4_OP_DCL_CONSTANT_BUFFER = 0x59,
WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY = 0x5c,
WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE = 0x5d,
WINED3D_SM4_OP_DCL_VERTICES_OUT = 0x5e,
......@@ -222,6 +226,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
{WINED3D_SM4_OP_USHR, WINED3DSIH_USHR, "U", "UU"},
{WINED3D_SM4_OP_UTOF, WINED3DSIH_UTOF, "F", "U"},
{WINED3D_SM4_OP_XOR, WINED3DSIH_XOR, "U", "UU"},
{WINED3D_SM4_OP_DCL_CONSTANT_BUFFER, WINED3DSIH_DCL_CONSTANT_BUFFER, "", ""},
{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, "", ""},
......@@ -592,7 +597,14 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
FIXME("Skipping modifier 0x%08x.\n", modifier);
}
if (opcode == WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY)
if (opcode == WINED3D_SM4_OP_DCL_CONSTANT_BUFFER)
{
shader_sm4_read_src_param(priv, &p, WINED3D_DATA_FLOAT,
&ins->declaration.src, NULL);
if (opcode_token & WINED3D_SM4_INDEX_TYPE_MASK)
ins->flags |= WINED3DSI_INDEXED_DYNAMIC;
}
else if (opcode == WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY)
{
enum wined3d_sm4_output_primitive_type primitive_type;
......
......@@ -374,8 +374,9 @@ enum wined3d_shader_dst_modifier
};
/* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */
#define WINED3DSI_TEXLD_PROJECT 1
#define WINED3DSI_TEXLD_BIAS 2
#define WINED3DSI_TEXLD_PROJECT 0x1
#define WINED3DSI_TEXLD_BIAS 0x2
#define WINED3DSI_INDEXED_DYNAMIC 0x4
enum wined3d_shader_rel_op
{
......@@ -439,6 +440,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_CRS,
WINED3DSIH_CUT,
WINED3DSIH_DCL,
WINED3DSIH_DCL_CONSTANT_BUFFER,
WINED3DSIH_DCL_INPUT_PRIMITIVE,
WINED3DSIH_DCL_OUTPUT_TOPOLOGY,
WINED3DSIH_DCL_VERTICES_OUT,
......@@ -670,6 +672,7 @@ struct wined3d_shader_instruction
{
struct wined3d_shader_semantic semantic;
enum wined3d_primitive_type primitive_type;
struct wined3d_shader_src_param src;
UINT count;
} 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