[PATCH 4/5] wined3d: Recognize SM4 dcl_indexableTemp opcode.
Józef Kucia
jkucia at codeweavers.com
Thu Jun 23 05:08:00 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 2e070fb..5a0cdba 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5232,6 +5232,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT */ NULL,
/* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ NULL,
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL,
+ /* WINED3DSIH_DCL_INDEXABLE_TEMP */ NULL,
/* WINED3DSIH_DCL_INPUT */ NULL,
/* WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT */ NULL,
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_hw_nop,
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 3aa9626..d22798f 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -8567,6 +8567,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT */ NULL,
/* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ NULL,
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL,
+ /* WINED3DSIH_DCL_INDEXABLE_TEMP */ NULL,
/* WINED3DSIH_DCL_INPUT */ shader_glsl_nop,
/* WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT */ NULL,
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_glsl_nop,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index e9a4a84..700b7c1 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -62,6 +62,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT */ "dcl_hs_fork_phase_instance_count",
/* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ "dcl_hs_max_tessfactor",
/* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ "dcl_immediateConstantBuffer",
+ /* WINED3DSIH_DCL_INDEXABLE_TEMP */ "dcl_indexableTemp",
/* WINED3DSIH_DCL_INPUT */ "dcl_input",
/* WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT */ "dcl_input_control_point_count",
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ "dcl_inputPrimitive",
@@ -2205,6 +2206,13 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
}
shader_addline(&buffer, "}");
}
+ else if (ins.handler_idx == WINED3DSIH_DCL_INDEXABLE_TEMP)
+ {
+ shader_addline(&buffer, "%s x[%u][%u], %u", shader_opcode_names[ins.handler_idx],
+ ins.declaration.indexable_temp.register_idx,
+ ins.declaration.indexable_temp.register_size,
+ ins.declaration.indexable_temp.component_count);
+ }
else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PS)
{
shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c
index b17140d..c90c2d4 100644
--- a/dlls/wined3d/shader_sm4.c
+++ b/dlls/wined3d/shader_sm4.c
@@ -199,6 +199,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_INDEXABLE_TEMP = 0x69,
WINED3D_SM4_OP_DCL_GLOBAL_FLAGS = 0x6a,
WINED3D_SM4_OP_GATHER4 = 0x6d,
WINED3D_SM5_OP_HS_DECLS = 0x71,
@@ -576,6 +577,15 @@ static void shader_sm4_read_dcl_input_ps_siv(struct wined3d_shader_instruction *
ins->declaration.register_semantic.sysval_semantic = *tokens;
}
+static void shader_sm4_read_dcl_indexable_temp(struct wined3d_shader_instruction *ins,
+ DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
+ struct wined3d_sm4_data *priv)
+{
+ ins->declaration.indexable_temp.register_idx = *tokens++;
+ ins->declaration.indexable_temp.register_size = *tokens++;
+ ins->declaration.indexable_temp.component_count = *tokens;
+}
+
static void shader_sm4_read_dcl_global_flags(struct wined3d_shader_instruction *ins,
DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
struct wined3d_sm4_data *priv)
@@ -776,6 +786,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
shader_sm4_read_declaration_register_semantic},
{WINED3D_SM4_OP_DCL_TEMPS, WINED3DSIH_DCL_TEMPS, "", "",
shader_sm4_read_declaration_count},
+ {WINED3D_SM4_OP_DCL_INDEXABLE_TEMP, WINED3DSIH_DCL_INDEXABLE_TEMP, "", "",
+ shader_sm4_read_dcl_indexable_temp},
{WINED3D_SM4_OP_DCL_GLOBAL_FLAGS, WINED3DSIH_DCL_GLOBAL_FLAGS, "", "",
shader_sm4_read_dcl_global_flags},
{WINED3D_SM4_OP_GATHER4, WINED3DSIH_GATHER4, "u", "fRS"},
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f89573c..8fb6f4d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -577,6 +577,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT,
WINED3DSIH_DCL_HS_MAX_TESSFACTOR,
WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER,
+ WINED3DSIH_DCL_INDEXABLE_TEMP,
WINED3DSIH_DCL_INPUT,
WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT,
WINED3DSIH_DCL_INPUT_PRIMITIVE,
@@ -895,6 +896,13 @@ struct wined3d_shader_src_param
enum wined3d_shader_src_modifier modifiers;
};
+struct wined3d_shader_indexable_temp
+{
+ unsigned int register_idx;
+ unsigned int register_size;
+ unsigned int component_count;
+};
+
struct wined3d_shader_semantic
{
enum wined3d_decl_usage usage;
@@ -968,6 +976,7 @@ struct wined3d_shader_instruction
enum wined3d_tessellator_output_primitive tessellator_output_primitive;
enum wined3d_tessellator_partitioning tessellator_partitioning;
float max_tessellation_factor;
+ struct wined3d_shader_indexable_temp indexable_temp;
} declaration;
};
--
2.7.3
More information about the wine-patches
mailing list