From 47a45aaa0fd1dbc0de45de2ed2995f81a0154baf Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sun, 13 Jul 2008 14:50:12 +0200 Subject: [PATCH] tgsi: Parse _SAT and _SAT opcode suffix. --- src/gallium/auxiliary/tgsi/util/tgsi_dump.c | 2 +- src/gallium/auxiliary/tgsi/util/tgsi_text.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_dump.c b/src/gallium/auxiliary/tgsi/util/tgsi_dump.c index cae74a9..8220e09 100644 --- a/src/gallium/auxiliary/tgsi/util/tgsi_dump.c +++ b/src/gallium/auxiliary/tgsi/util/tgsi_dump.c @@ -716,7 +716,7 @@ tgsi_dump_instruction( TXT( "_SAT" ); break; case TGSI_SAT_MINUS_PLUS_ONE: - TXT( "_SAT[-1,1]" ); + TXT( "_SATNV" ); break; default: assert( 0 ); diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_text.c b/src/gallium/auxiliary/tgsi/util/tgsi_text.c index d5a9480..f3fc675 100644 --- a/src/gallium/auxiliary/tgsi/util/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/util/tgsi_text.c @@ -588,6 +588,7 @@ static const char *texture_names[TGSI_TEXTURE_COUNT] = static boolean parse_instruction( struct translate_ctx *ctx ) { uint i; + uint saturate = TGSI_SAT_NONE; const struct opcode_info *info; struct tgsi_full_instruction inst; uint advance; @@ -599,7 +600,11 @@ static boolean parse_instruction( struct translate_ctx *ctx ) const char *cur = ctx->cur; if (str_match_no_case( &cur, opcode_info[i].mnemonic )) { - /* TODO: _SAT suffix */ + if (str_match_no_case( &cur, "_SATNV" )) + saturate = TGSI_SAT_MINUS_PLUS_ONE; + else if (str_match_no_case( &cur, "_SAT" )) + saturate = TGSI_SAT_ZERO_ONE; + if (*cur == '\0' || eat_white( &cur )) { ctx->cur = cur; break; @@ -614,6 +619,7 @@ static boolean parse_instruction( struct translate_ctx *ctx ) inst = tgsi_default_full_instruction(); inst.Instruction.Opcode = i; + inst.Instruction.Saturate = saturate; inst.Instruction.NumDstRegs = info->num_dst; inst.Instruction.NumSrcRegs = info->num_src; -- 2.7.4