[virglrenderer-devel] [PATCH virglrenderer 2/2] tgsi: don't fail on unknown property
marcandre.lureau at redhat.com
marcandre.lureau at redhat.com
Tue Mar 29 21:41:14 UTC 2016
From: Marc-André Lureau <marcandre.lureau at redhat.com>
They should mostly be fine, as long the shader compiles. The reported
error should be enough to diagnose something going wrong in case of
failure.
This should help avoiding temporary regressions when new properties are
introduced in mesa.git before they are either handled or filtered out by
virgl, as was the case with commit fbe6e92899.
Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
src/gallium/auxiliary/tgsi/tgsi_text.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
index 1b6a2b0..bef0d72 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_text.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
@@ -119,6 +119,14 @@ static boolean str_match_nocase_whole( const char **pcur, const char *str )
return FALSE;
}
+/* Eat until eol
+ */
+static void eat_until_eol( const char **pcur )
+{
+ while (**pcur != '\0' && **pcur != '\n')
+ (*pcur)++;
+}
+
/* Eat zero or more whitespaces.
*/
static void eat_opt_white( const char **pcur )
@@ -1593,8 +1601,9 @@ static boolean parse_property( struct translate_ctx *ctx )
}
}
if (property_name >= TGSI_PROPERTY_COUNT) {
- debug_printf( "\nError: Unknown property : '%s'", id );
- return FALSE;
+ eat_until_eol( &ctx->cur );
+ report_error(ctx, "\nError: Unknown property : '%s'\n", id);
+ return TRUE;
}
eat_opt_white( &ctx->cur );
--
2.5.5
More information about the virglrenderer-devel
mailing list