[PATCH] wined3d: Recognize SM5 dcl_resource_raw instruction. (v2)
Guillaume Charifi
guillaume.charifi at sfr.fr
Sun Jan 29 06:37:23 CST 2017
Signed-off-by: Guillaume Charifi <guillaume.charifi at sfr.fr>
---
dlls/wined3d/arb_program_shader.c | 1 +
dlls/wined3d/glsl_shader.c | 1 +
dlls/wined3d/shader.c | 6 ++++++
dlls/wined3d/shader_sm4.c | 10 ++++++++++
dlls/wined3d/wined3d_private.h | 1 +
5 files changed, 19 insertions(+)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index f2a5b38..244870a 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5065,6 +5065,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT */ NULL,
/* WINED3DSIH_DCL_OUTPUT_SIV */ NULL,
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_hw_nop,
+ /* WINED3DSIH_DCL_RESOURCE_RAW */ NULL,
/* WINED3DSIH_DCL_RESOURCE_STRUCTURED */ NULL,
/* WINED3DSIH_DCL_SAMPLER */ NULL,
/* WINED3DSIH_DCL_STREAM */ NULL,
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 968c2a2..9db03a6 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -8848,6 +8848,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT */ NULL,
/* WINED3DSIH_DCL_OUTPUT_SIV */ shader_glsl_nop,
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_glsl_nop,
+ /* WINED3DSIH_DCL_RESOURCE_RAW */ NULL,
/* WINED3DSIH_DCL_RESOURCE_STRUCTURED */ NULL,
/* WINED3DSIH_DCL_SAMPLER */ shader_glsl_nop,
/* WINED3DSIH_DCL_STREAM */ NULL,
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 4ca82c2..4c8fe16 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -90,6 +90,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT */ "dcl_output_control_point_count",
/* WINED3DSIH_DCL_OUTPUT_SIV */ "dcl_output_siv",
/* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ "dcl_outputTopology",
+ /* WINED3DSIH_DCL_RESOURCE_RAW */ "dcl_resource_raw",
/* WINED3DSIH_DCL_RESOURCE_STRUCTURED */ "dcl_resource_structured",
/* WINED3DSIH_DCL_SAMPLER */ "dcl_sampler",
/* WINED3DSIH_DCL_STREAM */ "dcl_stream",
@@ -2436,6 +2437,11 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
shader_opcode_names[ins.handler_idx], ins.declaration.fp.index,
ins.declaration.fp.array_size, ins.declaration.fp.body_count);
}
+ else if (ins.handler_idx == WINED3DSIH_DCL_RESOURCE_RAW)
+ {
+ shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
+ shader_dump_dst_param(&buffer, &ins.declaration.dst, &shader_version);
+ }
else if (ins.handler_idx == WINED3DSIH_DCL_RESOURCE_STRUCTURED)
{
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 66c33b3..e3a8769 100644
--- a/dlls/wined3d/shader_sm4.c
+++ b/dlls/wined3d/shader_sm4.c
@@ -252,6 +252,7 @@ enum wined3d_sm4_opcode
WINED3D_SM5_OP_DCL_UAV_STRUCTURED = 0x9e,
WINED3D_SM5_OP_DCL_TGSM_RAW = 0x9f,
WINED3D_SM5_OP_DCL_TGSM_STRUCTURED = 0xa0,
+ WINED3D_SM5_OP_DCL_RESOURCE_RAW = 0xa1,
WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED = 0xa2,
WINED3D_SM5_OP_LD_UAV_TYPED = 0xa3,
WINED3D_SM5_OP_STORE_UAV_TYPED = 0xa4,
@@ -768,6 +769,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_dcl_resource_raw(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_RESOURCE, &ins->declaration.dst);
+}
+
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)
@@ -959,6 +967,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
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_RAW, WINED3DSIH_DCL_RESOURCE_RAW, "", "",
+ shader_sm5_read_dcl_resource_raw},
{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 051836c..2fe5668 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -620,6 +620,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT,
WINED3DSIH_DCL_OUTPUT_SIV,
WINED3DSIH_DCL_OUTPUT_TOPOLOGY,
+ WINED3DSIH_DCL_RESOURCE_RAW,
WINED3DSIH_DCL_RESOURCE_STRUCTURED,
WINED3DSIH_DCL_SAMPLER,
WINED3DSIH_DCL_STREAM,
--
Guillaume Charifi <guillaume.charifi at sfr.fr>
More information about the wine-patches
mailing list