d3dcompiler: Dump flattened IR more accurately.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-02-05 14:52:34 -06:00 committed by Alexandre Julliard
parent a43974a6d4
commit e6f89bcb04
1 changed files with 16 additions and 10 deletions

View File

@ -1789,6 +1789,11 @@ static void debug_dump_instr_list(const struct list *list)
} }
} }
static void debug_dump_src(const struct hlsl_ir_node *node)
{
TRACE("%p", node);
}
static void debug_dump_ir_var(const struct hlsl_ir_var *var) static void debug_dump_ir_var(const struct hlsl_ir_var *var)
{ {
if (var->modifiers) if (var->modifiers)
@ -1808,13 +1813,13 @@ static void debug_dump_ir_deref(const struct hlsl_ir_deref *deref)
TRACE(")"); TRACE(")");
break; break;
case HLSL_IR_DEREF_ARRAY: case HLSL_IR_DEREF_ARRAY:
debug_dump_instr(deref->v.array.array); debug_dump_src(deref->v.array.array);
TRACE("["); TRACE("[");
debug_dump_instr(deref->v.array.index); debug_dump_src(deref->v.array.index);
TRACE("]"); TRACE("]");
break; break;
case HLSL_IR_DEREF_RECORD: case HLSL_IR_DEREF_RECORD:
debug_dump_instr(deref->v.record.record); debug_dump_src(deref->v.record.record);
TRACE(".%s", debugstr_a(deref->v.record.field->name)); TRACE(".%s", debugstr_a(deref->v.record.field->name));
break; break;
} }
@ -1945,7 +1950,7 @@ static void debug_dump_ir_expr(const struct hlsl_ir_expr *expr)
TRACE("%s (", debug_expr_op(expr)); TRACE("%s (", debug_expr_op(expr));
for (i = 0; i < 3 && expr->operands[i]; ++i) for (i = 0; i < 3 && expr->operands[i]; ++i)
{ {
debug_dump_instr(expr->operands[i]); debug_dump_src(expr->operands[i]);
TRACE(" "); TRACE(" ");
} }
TRACE(")"); TRACE(")");
@ -1958,7 +1963,7 @@ static void debug_dump_ir_constructor(const struct hlsl_ir_constructor *construc
TRACE("%s (", debug_hlsl_type(constructor->node.data_type)); TRACE("%s (", debug_hlsl_type(constructor->node.data_type));
for (i = 0; i < constructor->args_count; ++i) for (i = 0; i < constructor->args_count; ++i)
{ {
debug_dump_instr(constructor->args[i]); debug_dump_src(constructor->args[i]);
TRACE(" "); TRACE(" ");
} }
TRACE(")"); TRACE(")");
@ -1986,11 +1991,11 @@ static const char *debug_writemask(DWORD writemask)
static void debug_dump_ir_assignment(const struct hlsl_ir_assignment *assign) static void debug_dump_ir_assignment(const struct hlsl_ir_assignment *assign)
{ {
TRACE("= ("); TRACE("= (");
debug_dump_instr(assign->lhs); debug_dump_src(assign->lhs);
if (assign->writemask != BWRITERSP_WRITEMASK_ALL) if (assign->writemask != BWRITERSP_WRITEMASK_ALL)
TRACE("%s", debug_writemask(assign->writemask)); TRACE("%s", debug_writemask(assign->writemask));
TRACE(" "); TRACE(" ");
debug_dump_instr(assign->rhs); debug_dump_src(assign->rhs);
TRACE(")"); TRACE(")");
} }
@ -1998,7 +2003,7 @@ static void debug_dump_ir_swizzle(const struct hlsl_ir_swizzle *swizzle)
{ {
unsigned int i; unsigned int i;
debug_dump_instr(swizzle->val); debug_dump_src(swizzle->val);
TRACE("."); TRACE(".");
if (swizzle->val->data_type->dimy > 1) if (swizzle->val->data_type->dimy > 1)
{ {
@ -2030,7 +2035,7 @@ static void debug_dump_ir_jump(const struct hlsl_ir_jump *jump)
case HLSL_IR_JUMP_RETURN: case HLSL_IR_JUMP_RETURN:
TRACE("return "); TRACE("return ");
if (jump->return_value) if (jump->return_value)
debug_dump_instr(jump->return_value); debug_dump_src(jump->return_value);
TRACE(";"); TRACE(";");
break; break;
} }
@ -2039,7 +2044,7 @@ static void debug_dump_ir_jump(const struct hlsl_ir_jump *jump)
static void debug_dump_ir_if(const struct hlsl_ir_if *if_node) static void debug_dump_ir_if(const struct hlsl_ir_if *if_node)
{ {
TRACE("if ("); TRACE("if (");
debug_dump_instr(if_node->condition); debug_dump_src(if_node->condition);
TRACE(")\n{\n"); TRACE(")\n{\n");
debug_dump_instr_list(if_node->then_instrs); debug_dump_instr_list(if_node->then_instrs);
TRACE("}\n"); TRACE("}\n");
@ -2053,6 +2058,7 @@ static void debug_dump_ir_if(const struct hlsl_ir_if *if_node)
static void debug_dump_instr(const struct hlsl_ir_node *instr) static void debug_dump_instr(const struct hlsl_ir_node *instr)
{ {
TRACE("%p: ", instr);
switch (instr->type) switch (instr->type)
{ {
case HLSL_IR_EXPR: case HLSL_IR_EXPR: