summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2009-12-15 09:26:51 -0500
committerZack Rusin <zackr@vmware.com>2009-12-25 05:52:17 -0500
commit5aac920e4968d5be37ec2dbecb18838e66ca2c95 (patch)
tree14a23256e618127c2f64f9f3ec2cd354129f3865 /src
parent89d8577fb3036547ef0b47498cc8dc5c77f886e0 (diff)
tgsi: make the tgsi assembly parser report line/column on error
Diffstat (limited to 'src')
-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 84e863b237..9673686ace 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.