r300-gallium: Start VS dumper.

This commit is contained in:
Corbin Simpson
2009-05-09 00:28:49 -07:00
parent 7e347a0f49
commit c4c5bf31a7
2 changed files with 160 additions and 76 deletions

View File

@@ -30,81 +30,6 @@ static void r300_dump_fs(struct r300_fragment_shader* fs)
}
}
static char* r500_fs_swiz[] = {
" R",
" G",
" B",
" A",
" 0",
".5",
" 1",
" U",
};
static char* r500_fs_op_rgb[] = {
"MAD",
"DP3",
"DP4",
"D2A",
"MIN",
"MAX",
"---",
"CND",
"CMP",
"FRC",
"SOP",
"MDH",
"MDV",
};
static char* r500_fs_op_alpha[] = {
"MAD",
" DP",
"MIN",
"MAX",
"---",
"CND",
"CMP",
"FRC",
"EX2",
"LN2",
"RCP",
"RSQ",
"SIN",
"COS",
"MDH",
"MDV",
};
static char* r500_fs_mask[] = {
"NONE",
"R ",
" G ",
"RG ",
" B ",
"R B ",
" GB ",
"RGB ",
" A",
"R A",
" G A",
"RG A",
" BA",
"R BA",
" GBA",
"RGBA",
};
static char* r500_fs_tex[] = {
" NOP",
" LD",
"TEXKILL",
" PROJ",
"LODBIAS",
" LOD",
" DXDY",
};
void r500_fs_dump(struct r500_fragment_shader* fs)
{
int i;
@@ -225,12 +150,25 @@ 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");
} else if (op & 0x40) {
debug_printf("%s\n", r300_vs_me_ops[op & 0x1f]);
} else {
debug_printf("%s\n", r300_vs_ve_ops[op & 0x1f]);
}
}
void r300_vs_dump(struct r300_vertex_shader* vs)
{
int i;
for (i = 0; i < vs->instruction_count; i++) {
debug_printf("inst0: 0x%x\n", vs->instructions[i].inst0);
r300_vs_op_dump(vs->instructions[i].inst0);
debug_printf("inst1: 0x%x\n", vs->instructions[i].inst1);
debug_printf("inst2: 0x%x\n", vs->instructions[i].inst2);
debug_printf("inst3: 0x%x\n", vs->instructions[i].inst3);