wined3d: Recognize SM5 sync 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:
parent
20fdcbf2a0
commit
df7512c5e9
|
@ -5364,6 +5364,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
|
|||
/* WINED3DSIH_SUB */ shader_hw_map2gl,
|
||||
/* WINED3DSIH_SWAPC */ NULL,
|
||||
/* WINED3DSIH_SWITCH */ NULL,
|
||||
/* WINED3DSIH_SYNC */ NULL,
|
||||
/* WINED3DSIH_TEX */ pshader_hw_tex,
|
||||
/* WINED3DSIH_TEXBEM */ pshader_hw_texbem,
|
||||
/* WINED3DSIH_TEXBEML */ pshader_hw_texbem,
|
||||
|
|
|
@ -9027,6 +9027,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
|
|||
/* WINED3DSIH_SUB */ shader_glsl_binop,
|
||||
/* WINED3DSIH_SWAPC */ NULL,
|
||||
/* WINED3DSIH_SWITCH */ shader_glsl_switch,
|
||||
/* WINED3DSIH_SYNC */ NULL,
|
||||
/* WINED3DSIH_TEX */ shader_glsl_tex,
|
||||
/* WINED3DSIH_TEXBEM */ shader_glsl_texbem,
|
||||
/* WINED3DSIH_TEXBEML */ shader_glsl_texbem,
|
||||
|
|
|
@ -205,6 +205,7 @@ static const char * const shader_opcode_names[] =
|
|||
/* WINED3DSIH_SUB */ "sub",
|
||||
/* WINED3DSIH_SWAPC */ "swapc",
|
||||
/* WINED3DSIH_SWITCH */ "switch",
|
||||
/* WINED3DSIH_SYNC */ "sync",
|
||||
/* WINED3DSIH_TEX */ "texld",
|
||||
/* WINED3DSIH_TEXBEM */ "texbem",
|
||||
/* WINED3DSIH_TEXBEML */ "texbeml",
|
||||
|
@ -1439,6 +1440,23 @@ static void shader_dump_global_flags(struct wined3d_string_buffer *buffer, DWORD
|
|||
shader_addline(buffer, "unknown_flags(%#x)", global_flags);
|
||||
}
|
||||
|
||||
static void shader_dump_sync_flags(struct wined3d_string_buffer *buffer, DWORD sync_flags)
|
||||
{
|
||||
if (sync_flags & WINED3DSSF_GROUP_SHARED_MEMORY)
|
||||
{
|
||||
shader_addline(buffer, "_g");
|
||||
sync_flags &= ~WINED3DSSF_GROUP_SHARED_MEMORY;
|
||||
}
|
||||
if (sync_flags & WINED3DSSF_THREAD_GROUP)
|
||||
{
|
||||
shader_addline(buffer, "_t");
|
||||
sync_flags &= ~WINED3DSSF_THREAD_GROUP;
|
||||
}
|
||||
|
||||
if (sync_flags)
|
||||
shader_addline(buffer, "_unknown_flags(%#x)", sync_flags);
|
||||
}
|
||||
|
||||
static void shader_dump_tessellator_domain(struct wined3d_string_buffer *buffer,
|
||||
enum wined3d_tessellator_domain domain)
|
||||
{
|
||||
|
@ -2483,6 +2501,10 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
|
|||
default: shader_addline(&buffer, "_unrecognized(%#x)", ins.flags);
|
||||
}
|
||||
}
|
||||
else if (ins.handler_idx == WINED3DSIH_SYNC)
|
||||
{
|
||||
shader_dump_sync_flags(&buffer, ins.flags);
|
||||
}
|
||||
|
||||
if (wined3d_shader_instruction_has_texel_offset(&ins))
|
||||
shader_addline(&buffer, "(%d,%d,%d)", ins.texel_offset.u, ins.texel_offset.v, ins.texel_offset.w);
|
||||
|
|
|
@ -64,6 +64,9 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode);
|
|||
#define WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT 11
|
||||
#define WINED3D_SM5_CONTROL_POINT_COUNT_MASK (0xffu << WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT)
|
||||
|
||||
#define WINED3D_SM5_SYNC_FLAGS_SHIFT 11
|
||||
#define WINED3D_SM5_SYNC_FLAGS_MASK (0xffu << WINED3D_SM5_SYNC_FLAGS_SHIFT)
|
||||
|
||||
#define WINED3D_SM5_TESSELLATOR_SHIFT 11
|
||||
#define WINED3D_SM5_TESSELLATOR_MASK (0xfu << WINED3D_SM5_TESSELLATOR_SHIFT)
|
||||
|
||||
|
@ -246,6 +249,7 @@ enum wined3d_sm4_opcode
|
|||
WINED3D_SM5_OP_ATOMIC_IADD = 0xad,
|
||||
WINED3D_SM5_OP_IMM_ATOMIC_ALLOC = 0xb2,
|
||||
WINED3D_SM5_OP_IMM_ATOMIC_CONSUME = 0xb3,
|
||||
WINED3D_SM5_OP_SYNC = 0xbe,
|
||||
};
|
||||
|
||||
enum wined3d_sm4_register_type
|
||||
|
@ -681,6 +685,13 @@ static void shader_sm5_read_dcl_resource_structured(struct wined3d_shader_instru
|
|||
ins->declaration.structured_resource.byte_stride = *tokens;
|
||||
}
|
||||
|
||||
static void shader_sm5_read_sync(struct wined3d_shader_instruction *ins,
|
||||
DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
|
||||
struct wined3d_sm4_data *priv)
|
||||
{
|
||||
ins->flags = (opcode_token & WINED3D_SM5_SYNC_FLAGS_MASK) >> WINED3D_SM5_SYNC_FLAGS_SHIFT;
|
||||
}
|
||||
|
||||
/*
|
||||
* f -> WINED3D_DATA_FLOAT
|
||||
* i -> WINED3D_DATA_INT
|
||||
|
@ -862,6 +873,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
|
|||
{WINED3D_SM5_OP_ATOMIC_IADD, WINED3DSIH_ATOMIC_IADD, "U", "ii"},
|
||||
{WINED3D_SM5_OP_IMM_ATOMIC_ALLOC, WINED3DSIH_IMM_ATOMIC_ALLOC, "u", "U"},
|
||||
{WINED3D_SM5_OP_IMM_ATOMIC_CONSUME, WINED3DSIH_IMM_ATOMIC_CONSUME, "u", "U"},
|
||||
{WINED3D_SM5_OP_SYNC, WINED3DSIH_SYNC, "", "",
|
||||
shader_sm5_read_sync},
|
||||
};
|
||||
|
||||
static const enum wined3d_shader_register_type register_type_table[] =
|
||||
|
|
|
@ -463,6 +463,12 @@ enum wined3d_shader_global_flags
|
|||
WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS = 0x8,
|
||||
};
|
||||
|
||||
enum wined3d_shader_sync_flags
|
||||
{
|
||||
WINED3DSSF_THREAD_GROUP = 0x1,
|
||||
WINED3DSSF_GROUP_SHARED_MEMORY = 0x2,
|
||||
};
|
||||
|
||||
enum wined3d_tessellator_domain
|
||||
{
|
||||
WINED3D_TESSELLATOR_DOMAIN_LINE = 1,
|
||||
|
@ -719,6 +725,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
|
|||
WINED3DSIH_SUB,
|
||||
WINED3DSIH_SWAPC,
|
||||
WINED3DSIH_SWITCH,
|
||||
WINED3DSIH_SYNC,
|
||||
WINED3DSIH_TEX,
|
||||
WINED3DSIH_TEXBEM,
|
||||
WINED3DSIH_TEXBEML,
|
||||
|
|
Loading…
Reference in New Issue