"MODULATE_EIGHTH"
};
+static const char *TGSI_MODULATES_SHORT[TGSI_MODULATE_COUNT] =
+{
+ "",
+ "_2X",
+ "_4X",
+ "_8X",
+ "_D2",
+ "_D4",
+ "_D8"
+};
+
void
tgsi_dump_declaration(
const struct tgsi_full_declaration *decl )
SID( dst->DstRegister.Index );
CHR( ']' );
- switch (dst->DstRegisterExtModulate.Modulate) {
- case TGSI_MODULATE_1X:
- break;
- case TGSI_MODULATE_2X:
- TXT( "_2X" );
- break;
- case TGSI_MODULATE_4X:
- TXT( "_4X" );
- break;
- case TGSI_MODULATE_8X:
- TXT( "_8X" );
- break;
- case TGSI_MODULATE_HALF:
- TXT( "_D2" );
- break;
- case TGSI_MODULATE_QUARTER:
- TXT( "_D4" );
- break;
- case TGSI_MODULATE_EIGHTH:
- TXT( "_D8" );
- break;
- default:
- assert( 0 );
- }
+ ENM( dst->DstRegisterExtModulate.Modulate, TGSI_MODULATES_SHORT );
if( dst->DstRegister.WriteMask != TGSI_WRITEMASK_XYZW ) {
CHR( '.' );
return TRUE;
}
+static const char *modulate_names[TGSI_MODULATE_COUNT] =
+{
+ "_1X",
+ "_2X",
+ "_4X",
+ "_8X",
+ "_D2",
+ "_D4",
+ "_D8"
+};
+
static boolean
parse_dst_operand(
struct translate_ctx *ctx,
uint file;
uint index;
uint writemask;
+ const char *cur;
if (!parse_register( ctx, &file, &index ))
return FALSE;
+
+ cur = ctx->cur;
+ eat_opt_white( &cur );
+ if (*cur == '_') {
+ uint i;
+
+ for (i = 0; i < TGSI_MODULATE_COUNT; i++) {
+ if (str_match_no_case( &cur, modulate_names[i] )) {
+ if (!is_digit_alpha_underscore( cur )) {
+ dst->DstRegisterExtModulate.Modulate = i;
+ ctx->cur = cur;
+ break;
+ }
+ }
+ }
+ }
+
if (!parse_opt_writemask( ctx, &writemask ))
return FALSE;
+
dst->DstRegister.File = file;
dst->DstRegister.Index = index;
dst->DstRegister.WriteMask = writemask;
#define TGSI_MODULATE_HALF 4
#define TGSI_MODULATE_QUARTER 5
#define TGSI_MODULATE_EIGHTH 6
+#define TGSI_MODULATE_COUNT 7
struct tgsi_dst_register_ext_modulate
{