mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-23 11:50:42 +01:00
tgsi: make the tgsi assembly parser report line/column on error
This commit is contained in:
parent
89d8577fb3
commit
5aac920e49
1 changed files with 14 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue