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

wined3d: Recognize SM5 dcl_uav_structured opcode.

parent 17c7cbeb
...@@ -5249,6 +5249,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL ...@@ -5249,6 +5249,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_DCL_TGSM_STRUCTURED */ NULL, /* WINED3DSIH_DCL_TGSM_STRUCTURED */ NULL,
/* WINED3DSIH_DCL_THREAD_GROUP */ NULL, /* WINED3DSIH_DCL_THREAD_GROUP */ NULL,
/* WINED3DSIH_DCL_UAV_RAW */ NULL, /* WINED3DSIH_DCL_UAV_RAW */ NULL,
/* WINED3DSIH_DCL_UAV_STRUCTURED */ NULL,
/* WINED3DSIH_DCL_UAV_TYPED */ NULL, /* WINED3DSIH_DCL_UAV_TYPED */ NULL,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop, /* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop,
/* WINED3DSIH_DEF */ shader_hw_nop, /* WINED3DSIH_DEF */ shader_hw_nop,
......
...@@ -8912,6 +8912,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB ...@@ -8912,6 +8912,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_TGSM_STRUCTURED */ NULL, /* WINED3DSIH_DCL_TGSM_STRUCTURED */ NULL,
/* WINED3DSIH_DCL_THREAD_GROUP */ NULL, /* WINED3DSIH_DCL_THREAD_GROUP */ NULL,
/* WINED3DSIH_DCL_UAV_RAW */ NULL, /* WINED3DSIH_DCL_UAV_RAW */ NULL,
/* WINED3DSIH_DCL_UAV_STRUCTURED */ NULL,
/* WINED3DSIH_DCL_UAV_TYPED */ shader_glsl_nop, /* WINED3DSIH_DCL_UAV_TYPED */ shader_glsl_nop,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop, /* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop,
/* WINED3DSIH_DEF */ shader_glsl_nop, /* WINED3DSIH_DEF */ shader_glsl_nop,
......
...@@ -90,6 +90,7 @@ static const char * const shader_opcode_names[] = ...@@ -90,6 +90,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_DCL_TGSM_STRUCTURED */ "dcl_tgsm_structured", /* WINED3DSIH_DCL_TGSM_STRUCTURED */ "dcl_tgsm_structured",
/* WINED3DSIH_DCL_THREAD_GROUP */ "dcl_thread_group", /* WINED3DSIH_DCL_THREAD_GROUP */ "dcl_thread_group",
/* WINED3DSIH_DCL_UAV_RAW */ "dcl_uav_raw", /* WINED3DSIH_DCL_UAV_RAW */ "dcl_uav_raw",
/* WINED3DSIH_DCL_UAV_STRUCTURED */ "dcl_uav_structured",
/* WINED3DSIH_DCL_UAV_TYPED */ "dcl_uav_typed", /* WINED3DSIH_DCL_UAV_TYPED */ "dcl_uav_typed",
/* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount", /* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount",
/* WINED3DSIH_DEF */ "def", /* WINED3DSIH_DEF */ "def",
...@@ -1465,6 +1466,11 @@ static void shader_dump_uav_flags(struct wined3d_string_buffer *buffer, DWORD ua ...@@ -1465,6 +1466,11 @@ static void shader_dump_uav_flags(struct wined3d_string_buffer *buffer, DWORD ua
shader_addline(buffer, "_glc"); shader_addline(buffer, "_glc");
uav_flags &= ~WINED3DSUF_GLOBALLY_COHERENT; uav_flags &= ~WINED3DSUF_GLOBALLY_COHERENT;
} }
if (uav_flags & WINED3DSUF_ORDER_PRESERVING_COUNTER)
{
shader_addline(buffer, "_opc");
uav_flags &= ~WINED3DSUF_ORDER_PRESERVING_COUNTER;
}
if (uav_flags) if (uav_flags)
shader_addline(buffer, "_unknown_flags(%#x)", uav_flags); shader_addline(buffer, "_unknown_flags(%#x)", uav_flags);
...@@ -2437,6 +2443,14 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe ...@@ -2437,6 +2443,14 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
shader_addline(&buffer, " "); shader_addline(&buffer, " ");
shader_dump_dst_param(&buffer, &ins.declaration.dst, &shader_version); shader_dump_dst_param(&buffer, &ins.declaration.dst, &shader_version);
} }
else if (ins.handler_idx == WINED3DSIH_DCL_UAV_STRUCTURED)
{
shader_addline(&buffer, "%s", shader_opcode_names[ins.handler_idx]);
shader_dump_uav_flags(&buffer, ins.flags);
shader_addline(&buffer, " ");
shader_dump_dst_param(&buffer, &ins.declaration.structured_resource.reg, &shader_version);
shader_addline(&buffer, ", %u", ins.declaration.structured_resource.byte_stride);
}
else if (ins.handler_idx == WINED3DSIH_DEF) else if (ins.handler_idx == WINED3DSIH_DEF)
{ {
shader_addline(&buffer, "def c%u = %.8e, %.8e, %.8e, %.8e", shader_get_float_offset(ins.dst[0].reg.type, shader_addline(&buffer, "def c%u = %.8e, %.8e, %.8e, %.8e", shader_get_float_offset(ins.dst[0].reg.type,
......
...@@ -65,7 +65,7 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode); ...@@ -65,7 +65,7 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode);
#define WINED3D_SM5_CONTROL_POINT_COUNT_MASK (0xffu << WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT) #define WINED3D_SM5_CONTROL_POINT_COUNT_MASK (0xffu << WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT)
#define WINED3D_SM5_UAV_FLAGS_SHIFT 11 #define WINED3D_SM5_UAV_FLAGS_SHIFT 11
#define WINED3D_SM5_UAV_FLAGS_MASK (0xffu << WINED3D_SM5_UAV_FLAGS_SHIFT) #define WINED3D_SM5_UAV_FLAGS_MASK (0x8fffu << WINED3D_SM5_UAV_FLAGS_SHIFT)
#define WINED3D_SM5_SYNC_FLAGS_SHIFT 11 #define WINED3D_SM5_SYNC_FLAGS_SHIFT 11
#define WINED3D_SM5_SYNC_FLAGS_MASK (0xffu << WINED3D_SM5_SYNC_FLAGS_SHIFT) #define WINED3D_SM5_SYNC_FLAGS_MASK (0xffu << WINED3D_SM5_SYNC_FLAGS_SHIFT)
...@@ -241,6 +241,7 @@ enum wined3d_sm4_opcode ...@@ -241,6 +241,7 @@ enum wined3d_sm4_opcode
WINED3D_SM5_OP_DCL_THREAD_GROUP = 0x9b, WINED3D_SM5_OP_DCL_THREAD_GROUP = 0x9b,
WINED3D_SM5_OP_DCL_UAV_TYPED = 0x9c, WINED3D_SM5_OP_DCL_UAV_TYPED = 0x9c,
WINED3D_SM5_OP_DCL_UAV_RAW = 0x9d, WINED3D_SM5_OP_DCL_UAV_RAW = 0x9d,
WINED3D_SM5_OP_DCL_UAV_STRUCTURED = 0x9e,
WINED3D_SM5_OP_DCL_TGSM_RAW = 0x9f, WINED3D_SM5_OP_DCL_TGSM_RAW = 0x9f,
WINED3D_SM5_OP_DCL_TGSM_STRUCTURED = 0xa0, WINED3D_SM5_OP_DCL_TGSM_STRUCTURED = 0xa0,
WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED = 0xa2, WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED = 0xa2,
...@@ -672,6 +673,15 @@ static void shader_sm5_read_dcl_uav_raw(struct wined3d_shader_instruction *ins, ...@@ -672,6 +673,15 @@ static void shader_sm5_read_dcl_uav_raw(struct wined3d_shader_instruction *ins,
ins->flags = (opcode_token & WINED3D_SM5_UAV_FLAGS_MASK) >> WINED3D_SM5_UAV_FLAGS_SHIFT; ins->flags = (opcode_token & WINED3D_SM5_UAV_FLAGS_MASK) >> WINED3D_SM5_UAV_FLAGS_SHIFT;
} }
static void shader_sm5_read_dcl_uav_structured(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_UAV, &ins->declaration.structured_resource.reg);
ins->flags = (opcode_token & WINED3D_SM5_UAV_FLAGS_MASK) >> WINED3D_SM5_UAV_FLAGS_SHIFT;
ins->declaration.structured_resource.byte_stride = *tokens;
}
static void shader_sm5_read_dcl_tgsm_raw(struct wined3d_shader_instruction *ins, static void shader_sm5_read_dcl_tgsm_raw(struct wined3d_shader_instruction *ins,
DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
struct wined3d_sm4_data *priv) struct wined3d_sm4_data *priv)
...@@ -872,6 +882,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = ...@@ -872,6 +882,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
shader_sm4_read_dcl_resource}, shader_sm4_read_dcl_resource},
{WINED3D_SM5_OP_DCL_UAV_RAW, WINED3DSIH_DCL_UAV_RAW, "", "", {WINED3D_SM5_OP_DCL_UAV_RAW, WINED3DSIH_DCL_UAV_RAW, "", "",
shader_sm5_read_dcl_uav_raw}, shader_sm5_read_dcl_uav_raw},
{WINED3D_SM5_OP_DCL_UAV_STRUCTURED, WINED3DSIH_DCL_UAV_STRUCTURED, "", "",
shader_sm5_read_dcl_uav_structured},
{WINED3D_SM5_OP_DCL_TGSM_RAW, WINED3DSIH_DCL_TGSM_RAW, "", "", {WINED3D_SM5_OP_DCL_TGSM_RAW, WINED3DSIH_DCL_TGSM_RAW, "", "",
shader_sm5_read_dcl_tgsm_raw}, shader_sm5_read_dcl_tgsm_raw},
{WINED3D_SM5_OP_DCL_TGSM_STRUCTURED, WINED3DSIH_DCL_TGSM_STRUCTURED, "", "", {WINED3D_SM5_OP_DCL_TGSM_STRUCTURED, WINED3DSIH_DCL_TGSM_STRUCTURED, "", "",
......
...@@ -472,6 +472,7 @@ enum wined3d_shader_sync_flags ...@@ -472,6 +472,7 @@ enum wined3d_shader_sync_flags
enum wined3d_shader_uav_flags enum wined3d_shader_uav_flags
{ {
WINED3DSUF_GLOBALLY_COHERENT = 0x20, WINED3DSUF_GLOBALLY_COHERENT = 0x20,
WINED3DSUF_ORDER_PRESERVING_COUNTER = 0x8000,
}; };
enum wined3d_tessellator_domain enum wined3d_tessellator_domain
...@@ -615,6 +616,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER ...@@ -615,6 +616,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_DCL_TGSM_STRUCTURED, WINED3DSIH_DCL_TGSM_STRUCTURED,
WINED3DSIH_DCL_THREAD_GROUP, WINED3DSIH_DCL_THREAD_GROUP,
WINED3DSIH_DCL_UAV_RAW, WINED3DSIH_DCL_UAV_RAW,
WINED3DSIH_DCL_UAV_STRUCTURED,
WINED3DSIH_DCL_UAV_TYPED, WINED3DSIH_DCL_UAV_TYPED,
WINED3DSIH_DCL_VERTICES_OUT, WINED3DSIH_DCL_VERTICES_OUT,
WINED3DSIH_DEF, WINED3DSIH_DEF,
......
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