[PATCH 3/7] wined3d: Recognize SM5 dcl_tgsm_structured opcode.
Józef Kucia
jkucia at codeweavers.com
Wed Jun 22 04:37:31 CDT 2016
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
dlls/wined3d/arb_program_shader.c | 1 +
dlls/wined3d/glsl_shader.c | 1 +
dlls/wined3d/shader.c | 8 ++++++++
dlls/wined3d/shader_sm4.c | 12 ++++++++++++
dlls/wined3d/wined3d_private.h | 9 +++++++++
5 files changed, 31 insertions(+)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index f81e8ea..2e070fb 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5251,6 +5251,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL,
/* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ NULL,
/* WINED3DSIH_DCL_TGSM_RAW */ NULL,
+ /* WINED3DSIH_DCL_TGSM_STRUCTURED */ NULL,
/* WINED3DSIH_DCL_THREAD_GROUP */ NULL,
/* WINED3DSIH_DCL_UAV_TYPED */ NULL,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop,
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 921904f..b4ddf89 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -8589,6 +8589,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL,
/* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ NULL,
/* WINED3DSIH_DCL_TGSM_RAW */ NULL,
+ /* WINED3DSIH_DCL_TGSM_STRUCTURED */ NULL,
/* WINED3DSIH_DCL_THREAD_GROUP */ NULL,
/* WINED3DSIH_DCL_UAV_TYPED */ NULL,
/* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 3133750..603a152 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -81,6 +81,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ "dcl_tessellator_output_primitive",
/* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ "dcl_tessellator_partitioning",
/* WINED3DSIH_DCL_TGSM_RAW */ "dcl_tgsm_raw",
+ /* WINED3DSIH_DCL_TGSM_STRUCTURED */ "dcl_tgsm_structured",
/* WINED3DSIH_DCL_THREAD_GROUP */ "dcl_thread_group",
/* WINED3DSIH_DCL_UAV_TYPED */ "dcl_uav_typed",
/* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount",
@@ -2279,6 +2280,13 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
shader_dump_dst_param(&buffer, &ins.declaration.tgsm_raw.reg, &shader_version);
shader_addline(&buffer, ", %u", ins.declaration.tgsm_raw.byte_count);
}
+ else if (ins.handler_idx == WINED3DSIH_DCL_TGSM_STRUCTURED)
+ {
+ shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
+ shader_dump_dst_param(&buffer, &ins.declaration.tgsm_structured.reg, &shader_version);
+ shader_addline(&buffer, ", %u, %u", ins.declaration.tgsm_structured.byte_stride,
+ ins.declaration.tgsm_structured.structure_count);
+ }
else if (ins.handler_idx == WINED3DSIH_DCL_THREAD_GROUP)
{
shader_addline(&buffer, "%s %u, %u, %u", shader_opcode_names[ins.handler_idx],
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c
index 959b10c..8961dc5 100644
--- a/dlls/wined3d/shader_sm4.c
+++ b/dlls/wined3d/shader_sm4.c
@@ -222,6 +222,7 @@ enum wined3d_sm4_opcode
WINED3D_SM5_OP_DCL_THREAD_GROUP = 0x9b,
WINED3D_SM5_OP_DCL_UAV_TYPED = 0x9c,
WINED3D_SM5_OP_DCL_TGSM_RAW = 0x9f,
+ WINED3D_SM5_OP_DCL_TGSM_STRUCTURED = 0xa0,
WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED = 0xa2,
WINED3D_SM5_OP_LD_UAV_TYPED = 0xa3,
WINED3D_SM5_OP_STORE_UAV_TYPED = 0xa4,
@@ -637,6 +638,15 @@ static void shader_sm5_read_dcl_tgsm_raw(struct wined3d_shader_instruction *ins,
ins->declaration.tgsm_raw.byte_count = *tokens;
}
+static void shader_sm5_read_dcl_tgsm_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_FLOAT, &ins->declaration.tgsm_structured.reg);
+ ins->declaration.tgsm_structured.byte_stride = *tokens++;
+ ins->declaration.tgsm_structured.structure_count = *tokens;
+}
+
static void shader_sm5_read_dcl_resource_structured(struct wined3d_shader_instruction *ins,
DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
struct wined3d_sm4_data *priv)
@@ -799,6 +809,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
shader_sm4_read_dcl_resource},
{WINED3D_SM5_OP_DCL_TGSM_RAW, WINED3DSIH_DCL_TGSM_RAW, "", "",
shader_sm5_read_dcl_tgsm_raw},
+ {WINED3D_SM5_OP_DCL_TGSM_STRUCTURED, WINED3DSIH_DCL_TGSM_STRUCTURED, "", "",
+ shader_sm5_read_dcl_tgsm_structured},
{WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED, WINED3DSIH_DCL_RESOURCE_STRUCTURED, "", "",
shader_sm5_read_dcl_resource_structured},
{WINED3D_SM5_OP_LD_UAV_TYPED, WINED3DSIH_LD_UAV_TYPED, "u", "iU"},
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 45207df..701e93e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -595,6 +595,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE,
WINED3DSIH_DCL_TESSELLATOR_PARTITIONING,
WINED3DSIH_DCL_TGSM_RAW,
+ WINED3DSIH_DCL_TGSM_STRUCTURED,
WINED3DSIH_DCL_THREAD_GROUP,
WINED3DSIH_DCL_UAV_TYPED,
WINED3DSIH_DCL_VERTICES_OUT,
@@ -920,6 +921,13 @@ struct wined3d_shader_tgsm_raw
unsigned int byte_count;
};
+struct wined3d_shader_tgsm_structured
+{
+ struct wined3d_shader_dst_param reg;
+ unsigned int byte_stride;
+ unsigned int structure_count;
+};
+
struct wined3d_shader_thread_group_size
{
unsigned int x, y, z;
@@ -953,6 +961,7 @@ struct wined3d_shader_instruction
const struct wined3d_shader_immediate_constant_buffer *icb;
struct wined3d_shader_structured_resource structured_resource;
struct wined3d_shader_tgsm_raw tgsm_raw;
+ struct wined3d_shader_tgsm_structured tgsm_structured;
struct wined3d_shader_thread_group_size thread_group_size;
enum wined3d_tessellator_domain tessellator_domain;
enum wined3d_tessellator_output_primitive tessellator_output_primitive;
--
2.7.3
More information about the wine-patches
mailing list