diff options
author | Joe M. Kniss <[email protected]> | 2018-06-20 17:55:10 -0700 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2018-06-29 11:11:54 +1000 |
commit | 70425bcfe63c4e9191809659d019ec4af923595d (patch) | |
tree | 3993a5978c655b0a1bed9ce71447ded2fb16276c /src/gallium/auxiliary/tgsi/tgsi_text.c | |
parent | c2c803be7bfb857b6846390d2aae7523319ac58e (diff) |
gallium: plumb invariant output attrib thru TGSI
Add support for glsl 'invariant' modifier for output data declarations.
Gallium drivers that use TGSI serialization currently loose invariant
modifiers in glsl shaders.
v2: use boolean for invariant instead of unsigned.
Tested: chromiumos on qemu with virglrenderer.
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_text.c')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_text.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index 55a814994e0..9779f212cb1 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -1586,10 +1586,6 @@ static boolean parse_declaration( struct translate_ctx *ctx ) break; } } - if (i == TGSI_INTERPOLATE_COUNT) { - report_error( ctx, "Expected semantic or interpolate attribute" ); - return FALSE; - } } cur = ctx->cur; @@ -1609,6 +1605,20 @@ static boolean parse_declaration( struct translate_ctx *ctx ) } } + cur = ctx->cur; + eat_opt_white( &cur ); + if (*cur == ',' && !is_vs_input) { + cur++; + eat_opt_white( &cur ); + if (str_match_nocase_whole( &cur, tgsi_invariant_name )) { + decl.Declaration.Invariant = 1; + ctx->cur = cur; + } else { + report_error( ctx, "Expected semantic, interpolate attribute, or invariant "); + return FALSE; + } + } + advance = tgsi_build_full_declaration( &decl, ctx->tokens_cur, |