diff options
author | Corbin Simpson <[email protected]> | 2009-05-17 09:39:06 -0700 |
---|---|---|
committer | Corbin Simpson <[email protected]> | 2009-05-17 09:39:06 -0700 |
commit | 764bf9501adea0f3dbe8d7c718b22dfb067fbbfa (patch) | |
tree | 2cb0659cdc0587fa3064220e28ab6afc777979b2 /src/gallium | |
parent | 08ec7e0d329a72433b427e8167b2c3442d1f53b4 (diff) |
r300-gallium: vs: Dupe tokens, better debug, count spurious insts.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/r300/r300_debug.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_state_tcl.c | 17 |
3 files changed, 23 insertions, 6 deletions
diff --git a/src/gallium/drivers/r300/r300_debug.c b/src/gallium/drivers/r300/r300_debug.c index 1ff72172ebd..ffc93eb5915 100644 --- a/src/gallium/drivers/r300/r300_debug.c +++ b/src/gallium/drivers/r300/r300_debug.c @@ -152,10 +152,12 @@ void r500_fs_dump(struct r500_fragment_shader* fs) static void r300_vs_op_dump(uint32_t op) { - if (op & 0x81) { - debug_printf("PVS_MACRO_OP_2CLK_M2X_ADD\n"); - } else if (op & 0x80) { - debug_printf(" PVS_MACRO_OP_2CLK_MADD\n"); + if (op & 0x80) { + if (op & 0x1) { + debug_printf("PVS_MACRO_OP_2CLK_M2X_ADD\n"); + } else { + debug_printf(" PVS_MACRO_OP_2CLK_MADD\n"); + } } else if (op & 0x40) { debug_printf("%s\n", r300_vs_me_ops[op & 0x1f]); } else { diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 49b93a420b1..0ae118dbb9d 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -634,6 +634,7 @@ static void* r300_create_vs_state(struct pipe_context* pipe, struct r300_vertex_shader* vs = CALLOC_STRUCT(r300_vertex_shader); /* Copy state directly into shader. */ vs->state = *shader; + vs->state.tokens = tgsi_dup_tokens(shader->tokens); tgsi_scan_shader(shader->tokens, &vs->info); @@ -679,6 +680,7 @@ static void r300_delete_vs_state(struct pipe_context* pipe, void* shader) struct r300_vertex_shader* vs = (struct r300_vertex_shader*)shader; draw_delete_vertex_shader(r300->draw, vs->draw); + FREE(vs->state.tokens); FREE(shader); } else { draw_delete_vertex_shader(r300->draw, diff --git a/src/gallium/drivers/r300/r300_state_tcl.c b/src/gallium/drivers/r300/r300_state_tcl.c index ed9164db496..8b7a2ec5e9c 100644 --- a/src/gallium/drivers/r300/r300_state_tcl.c +++ b/src/gallium/drivers/r300/r300_state_tcl.c @@ -334,6 +334,8 @@ void r300_translate_vertex_shader(struct r300_context* r300, int i; struct r300_constant_buffer* consts = &r300->shader_constants[PIPE_SHADER_VERTEX]; + boolean end = FALSE; + int spurious = 0; struct r300_vs_asm* assembler = CALLOC_STRUCT(r300_vs_asm); if (assembler == NULL) { @@ -373,8 +375,16 @@ void r300_translate_vertex_shader(struct r300_context* r300, assembler->imm_count++; break; case TGSI_TOKEN_TYPE_INSTRUCTION: - r300_vs_instruction(vs, assembler, - &parser.FullToken.FullInstruction); + if (parser.FullToken.FullInstruction.Instruction.Opcode == + TGSI_OPCODE_END) { + end = TRUE; + } + if (end) { + spurious++; + } else { + r300_vs_instruction(vs, assembler, + &parser.FullToken.FullInstruction); + } break; } } @@ -391,6 +401,9 @@ void r300_translate_vertex_shader(struct r300_context* r300, debug_printf("r300: vs: tab: %d %d %d %d\n", assembler->tab[0], assembler->tab[1], assembler->tab[2], assembler->tab[3]); + debug_printf("r300: vs: %d spurious instructions following END\n", + spurious - 1); + tgsi_dump(vs->state.tokens); /* XXX finish r300 vertex shader dumper */ r300_vs_dump(vs); |