wined3d: Recognize SM4 dcl_globalFlags 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:34 +01:00 committed by Alexandre Julliard
parent 3e64e1a564
commit e379a17a0a
5 changed files with 44 additions and 0 deletions

View File

@ -5227,6 +5227,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_CUT */ NULL,
/* WINED3DSIH_DCL */ shader_hw_nop,
/* WINED3DSIH_DCL_CONSTANT_BUFFER */ shader_hw_nop,
/* WINED3DSIH_DCL_GLOBAL_FLAGS */ NULL,
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL,
/* WINED3DSIH_DCL_INPUT */ NULL,
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_hw_nop,

View File

@ -8015,6 +8015,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_CUT */ shader_glsl_cut,
/* WINED3DSIH_DCL */ shader_glsl_nop,
/* WINED3DSIH_DCL_CONSTANT_BUFFER */ shader_glsl_nop,
/* WINED3DSIH_DCL_GLOBAL_FLAGS */ shader_glsl_nop,
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL,
/* WINED3DSIH_DCL_INPUT */ shader_glsl_nop,
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_glsl_nop,

View File

@ -55,6 +55,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_CUT */ "cut",
/* WINED3DSIH_DCL */ "dcl",
/* WINED3DSIH_DCL_CONSTANT_BUFFER */ "dcl_constantBuffer",
/* WINED3DSIH_DCL_GLOBAL_FLAGS */ "dcl_globalFlags",
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ "dcl_immediateConstantBuffer",
/* WINED3DSIH_DCL_INPUT */ "dcl_input",
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ "dcl_inputPrimitive",
@ -1229,6 +1230,26 @@ unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_map
return wined3d_log2i(map);
}
static void shader_dump_global_flags(DWORD global_flags)
{
if (global_flags & WINED3DSGF_REFACTORING_ALLOWED)
{
TRACE("refactoringAllowed");
global_flags &= ~WINED3DSGF_REFACTORING_ALLOWED;
if (global_flags)
TRACE(" | ");
}
if (global_flags & WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS)
{
TRACE("enableRawAndStructuredBuffers");
global_flags &= ~WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS;
}
if (global_flags)
TRACE("unknown_flags(%#x)", global_flags);
}
static void shader_dump_sysval_semantic(enum wined3d_sysval_semantic semantic)
{
unsigned int i;
@ -1899,6 +1920,11 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
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_GLOBAL_FLAGS)
{
TRACE("%s ", shader_opcode_names[ins.handler_idx]);
shader_dump_global_flags(ins.flags);
}
else if (ins.handler_idx == WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER)
{
TRACE("%s {\n", shader_opcode_names[ins.handler_idx]);

View File

@ -50,6 +50,9 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode);
#define WINED3D_SM4_INTERPOLATION_MODE_SHIFT 11
#define WINED3D_SM4_INTERPOLATION_MODE_MASK (0xfu << WINED3D_SM4_INTERPOLATION_MODE_SHIFT)
#define WINED3D_SM4_GLOBAL_FLAGS_SHIFT 11
#define WINED3D_SM4_GLOBAL_FLAGS_MASK (0xffu << WINED3D_SM4_GLOBAL_FLAGS_SHIFT)
#define WINED3D_SM4_OPCODE_MASK 0xff
#define WINED3D_SM4_REGISTER_MODIFIER (0x1u << 31)
@ -170,6 +173,7 @@ enum wined3d_sm4_opcode
WINED3D_SM4_OP_DCL_OUTPUT = 0x65,
WINED3D_SM4_OP_DCL_OUTPUT_SIV = 0x67,
WINED3D_SM4_OP_DCL_TEMPS = 0x68,
WINED3D_SM4_OP_DCL_GLOBAL_FLAGS = 0x6a,
};
enum wined3d_sm4_register_type
@ -380,6 +384,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
{WINED3D_SM4_OP_DCL_OUTPUT, WINED3DSIH_DCL_OUTPUT, "", ""},
{WINED3D_SM4_OP_DCL_OUTPUT_SIV, WINED3DSIH_DCL_OUTPUT_SIV, "", ""},
{WINED3D_SM4_OP_DCL_TEMPS, WINED3DSIH_DCL_TEMPS, "", ""},
{WINED3D_SM4_OP_DCL_GLOBAL_FLAGS, WINED3DSIH_DCL_GLOBAL_FLAGS, "", ""},
};
static const enum wined3d_shader_register_type register_type_table[] =
@ -1019,6 +1024,10 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
{
ins->declaration.count = *p++;
}
else if (opcode == WINED3D_SM4_OP_DCL_GLOBAL_FLAGS)
{
ins->flags = (opcode_token & WINED3D_SM4_GLOBAL_FLAGS_MASK) >> WINED3D_SM4_GLOBAL_FLAGS_SHIFT;
}
else
{
enum wined3d_shader_dst_modifier instruction_dst_modifier = WINED3DSPDM_NONE;

View File

@ -427,6 +427,12 @@ enum wined3d_shader_interpolation_mode
WINED3DSIM_LINEAR_NOPERSPECTIVE_SAMPLE = 7,
};
enum wined3d_shader_global_flags
{
WINED3DSGF_REFACTORING_ALLOWED = 0x1,
WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS = 0x8,
};
/* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */
#define WINED3DSI_TEXLD_PROJECT 0x1
#define WINED3DSI_TEXLD_BIAS 0x2
@ -499,6 +505,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_CUT,
WINED3DSIH_DCL,
WINED3DSIH_DCL_CONSTANT_BUFFER,
WINED3DSIH_DCL_GLOBAL_FLAGS,
WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER,
WINED3DSIH_DCL_INPUT,
WINED3DSIH_DCL_INPUT_PRIMITIVE,