summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2009-12-15 09:26:51 -0500
committerZack Rusin <[email protected]>2009-12-25 05:52:17 -0500
commit5aac920e4968d5be37ec2dbecb18838e66ca2c95 (patch)
tree14a23256e618127c2f64f9f3ec2cd354129f3865 /src/gallium/auxiliary
parent89d8577fb3036547ef0b47498cc8dc5c77f886e0 (diff)
tgsi: make the tgsi assembly parser report line/column on error
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_text.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
index 84e863b2375..9673686ace6 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_text.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
@@ -197,7 +197,20 @@ struct translate_ctx
static void report_error( struct translate_ctx *ctx, const char *msg )
{
- debug_printf( "\nError: %s", msg );
+ int line = 1;
+ int column = 1;
+ const char *itr = ctx->text;
+
+ while (itr != ctx->cur) {
+ if (*itr == '\n') {
+ column = 1;
+ ++line;
+ }
+ ++column;
+ ++itr;
+ }
+
+ debug_printf( "\nTGSI asm error: %s [%d : %d] \n", msg, line, column );
}
/* Parse shader header.