Module: wine Branch: master Commit: 8ac0526013753ef4ef45a71f17ef9aea676e8159 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8ac0526013753ef4ef45a71f17...
Author: Józef Kucia jkucia@codeweavers.com Date: Fri Jan 1 18:08:05 2016 +0100
wined3d: Print opcode names instead of enum values.
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/arb_program_shader.c | 8 ++++---- dlls/wined3d/glsl_shader.c | 10 +++++----- dlls/wined3d/shader.c | 8 ++++++++ dlls/wined3d/wined3d_private.h | 1 + 4 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 3dfc8c4..5f493b2 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; }
@@ -5729,7 +5729,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 ed87e79..366c6ec 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -2914,7 +2914,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; }
@@ -3200,7 +3200,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; }
@@ -3389,7 +3389,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, @@ -3413,7 +3413,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)); }
} @@ -7941,7 +7941,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 bf420ee..2837229 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -178,6 +178,14 @@ 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)) + return wine_dbg_sprintf("UNRECOGNIZED(%#x)", handler_idx); + + 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 23fe595..288d683 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2853,6 +2853,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;