summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorMichal Krol <michal@tungstengraphics.com>2008-07-13 14:50:12 +0200
committerMichal Krol <michal@tungstengraphics.com>2008-07-13 14:50:12 +0200
commit47a45aaa0fd1dbc0de45de2ed2995f81a0154baf (patch)
treefbebe5dfaa8a623f73fbdb3d8f209a3540b9a691 /src/gallium/auxiliary
parenta7d8eed61c1fd0bd3d99ebcd10c24bc70f8e3293 (diff)
tgsi: Parse _SAT and _SAT opcode suffix.
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_dump.c2
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_text.c8
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 cae74a9267..8220e09199 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 d5a9480f4a..f3fc675807 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;