[PATCH 2/2] wined3d: Print opcode names instead of enum values.
Józef Kucia
jkucia at codeweavers.com
Thu Dec 3 04:04:18 CST 2015
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
dlls/wined3d/arb_program_shader.c | 8 ++++----
dlls/wined3d/glsl_shader.c | 10 +++++-----
dlls/wined3d/shader.c | 11 +++++++++++
dlls/wined3d/wined3d_private.h | 1 +
4 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 2af9845..69538cc 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -1798,7 +1798,7 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
case WINED3DSIH_MOVA:instruction = "ARR"; break;
case WINED3DSIH_DSX: instruction = "DDX"; break;
default: instruction = "";
- FIXME("Unhandled opcode %#x\n", ins->handler_idx);
+ FIXME("Unhandled opcode %s.\n", debug_d3dshaderinstructionhandler(ins->handler_idx));
break;
}
@@ -2487,7 +2487,7 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins)
tmp_ins.handler_idx = WINED3DSIH_DP3;
break;
default:
- FIXME("Unhandled opcode %#x\n", ins->handler_idx);
+ FIXME("Unhandled opcode %s.\n", debug_d3dshaderinstructionhandler(ins->handler_idx));
break;
}
@@ -2559,7 +2559,7 @@ static void shader_hw_scalar_op(const struct wined3d_shader_instruction *ins)
instruction = "LG2";
break;
default: instruction = "";
- FIXME("Unhandled opcode %#x\n", ins->handler_idx);
+ FIXME("Unhandled opcode %s.\n", debug_d3dshaderinstructionhandler(ins->handler_idx));
break;
}
@@ -5727,7 +5727,7 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio
/* Unhandled opcode */
if (!hw_fct)
{
- FIXME("Backend can't handle opcode %#x\n", ins->handler_idx);
+ FIXME("Backend can't handle opcode %s.\n", debug_d3dshaderinstructionhandler(ins->handler_idx));
return;
}
hw_fct(ins);
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 6fe0ff6..ad72f09 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -2916,7 +2916,7 @@ static void shader_glsl_binop(const struct wined3d_shader_instruction *ins)
case WINED3DSIH_XOR: op = "^"; break;
default:
op = "<unhandled operator>";
- FIXME("Opcode %#x not yet handled in GLSL\n", ins->handler_idx);
+ FIXME("Opcode %s not yet handled in GLSL.\n", debug_d3dshaderinstructionhandler(ins->handler_idx));
break;
}
@@ -3202,7 +3202,7 @@ static void shader_glsl_map2gl(const struct wined3d_shader_instruction *ins)
case WINED3DSIH_ROUND_NI: instruction = "floor"; break;
case WINED3DSIH_SQRT: instruction = "sqrt"; break;
default: instruction = "";
- FIXME("Opcode %#x not yet handled in GLSL\n", ins->handler_idx);
+ FIXME("Opcode %s not yet handled in GLSL.\n", debug_d3dshaderinstructionhandler(ins->handler_idx));
break;
}
@@ -3391,7 +3391,7 @@ static void shader_glsl_compare(const struct wined3d_shader_instruction *ins)
case WINED3DSIH_SLT: compare = "lessThan"; break;
case WINED3DSIH_SGE: compare = "greaterThanEqual"; break;
default: compare = "";
- FIXME("Can't handle opcode %#x\n", ins->handler_idx);
+ FIXME("Can't handle opcode %s.\n", debug_d3dshaderinstructionhandler(ins->handler_idx));
}
shader_addline(ins->ctx->buffer, "vec%d(%s(%s, %s)));\n", mask_size, compare,
@@ -3415,7 +3415,7 @@ static void shader_glsl_compare(const struct wined3d_shader_instruction *ins)
shader_addline(ins->ctx->buffer, "step(%s, %s));\n", src1_param.param_str, src0_param.param_str);
break;
default:
- FIXME("Can't handle opcode %#x\n", ins->handler_idx);
+ FIXME("Can't handle opcode %s.\n", debug_d3dshaderinstructionhandler(ins->handler_idx));
}
}
@@ -7951,7 +7951,7 @@ static void shader_glsl_handle_instruction(const struct wined3d_shader_instructi
/* Unhandled opcode */
if (!hw_fct)
{
- FIXME("Backend can't handle opcode %#x\n", ins->handler_idx);
+ FIXME("Backend can't handle opcode %s.\n", debug_d3dshaderinstructionhandler(ins->handler_idx));
return;
}
hw_fct(ins);
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 7e85988..1d7aeda 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -176,6 +176,17 @@ static const char * const semantic_names[] =
/* WINED3D_DECL_USAGE_SAMPLE */ "SAMPLE",
};
+const char *debug_d3dshaderinstructionhandler(enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx)
+{
+ if (handler_idx >= sizeof(shader_opcode_names) / sizeof(*shader_opcode_names))
+ {
+ FIXME("Unrecognized shader instruction handler %#x.\n", handler_idx);
+ return "UNRECOGNIZED";
+ }
+
+ return shader_opcode_names[handler_idx];
+}
+
static const char *shader_semantic_name_from_usage(enum wined3d_decl_usage usage)
{
if (usage >= sizeof(semantic_names) / sizeof(*semantic_names))
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6819330..c479a08 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2849,6 +2849,7 @@ void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPE
*/
/* Trace routines */
+const char *debug_d3dshaderinstructionhandler(enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx) DECLSPEC_HIDDEN;
const char *debug_d3dformat(enum wined3d_format_id format_id) DECLSPEC_HIDDEN;
const char *debug_d3ddevicetype(enum wined3d_device_type device_type) DECLSPEC_HIDDEN;
const char *debug_d3dresourcetype(enum wined3d_resource_type resource_type) DECLSPEC_HIDDEN;
--
2.4.10
More information about the wine-patches
mailing list