diff options
author | Eric Anholt <[email protected]> | 2010-07-30 14:44:09 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-07-30 14:57:44 -0700 |
commit | 40f57c2becbb2cee7cfb6d6ed49dc1db57987e9a (patch) | |
tree | 05cd5ba9cd6bcafd75f46ec5123bb1652c825fb9 | |
parent | 5e5583ee06cff53db48151c13b21916a166ea2ed (diff) |
ir_to_mesa: Add the function name as a comment to BGNSUB and ENDSUB.
-rw-r--r-- | src/mesa/program/ir_to_mesa.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index b6dfde3783e..e62395a3b90 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -2355,7 +2355,10 @@ get_mesa_program(GLcontext *ctx, struct gl_shader_program *shader_program, if (last->op != OPCODE_RET) v.ir_to_mesa_emit_op0(NULL, OPCODE_RET); - v.ir_to_mesa_emit_op0(NULL, OPCODE_ENDSUB); + ir_to_mesa_instruction *end; + end = v.ir_to_mesa_emit_op0(NULL, OPCODE_ENDSUB); + end->function = entry; + progress = GL_TRUE; } } @@ -2401,12 +2404,23 @@ get_mesa_program(GLcontext *ctx, struct gl_shader_program *shader_program, shader_program->LinkStatus = false; } - if (mesa_inst->Opcode == OPCODE_BGNSUB) + switch (mesa_inst->Opcode) { + case OPCODE_BGNSUB: inst->function->inst = i; - else if (mesa_inst->Opcode == OPCODE_CAL) + mesa_inst->Comment = strdup(inst->function->sig->function_name()); + break; + case OPCODE_ENDSUB: + mesa_inst->Comment = strdup(inst->function->sig->function_name()); + break; + case OPCODE_CAL: mesa_inst->BranchTarget = inst->function->sig_id; /* rewritten later */ - else if (mesa_inst->Opcode == OPCODE_ARL) + break; + case OPCODE_ARL: prog->NumAddressRegs = 1; + break; + default: + break; + } mesa_inst++; i++; |