&tex_info->coord[chan];
if (chan_info->file != TGSI_FILE_NULL) {
debug_printf(" %s[%u].%c",
- tgsi_file_names[chan_info->file],
+ tgsi_file_name(chan_info->file),
chan_info->u.index,
"xyzw01"[chan_info->swizzle]);
} else {
struct dump_ctx *ctx,
const struct tgsi_full_src_register *src )
{
- ENM(src->Register.File, tgsi_file_names);
+ TXT(tgsi_file_name(src->Register.File));
if (src->Register.Dimension) {
if (src->Dimension.Indirect) {
CHR( '[' );
- ENM( src->DimIndirect.File, tgsi_file_names );
+ TXT(tgsi_file_name(src->DimIndirect.File));
CHR( '[' );
SID( src->DimIndirect.Index );
TXT( "]." );
}
if (src->Register.Indirect) {
CHR( '[' );
- ENM( src->Indirect.File, tgsi_file_names );
+ TXT(tgsi_file_name(src->Indirect.File));
CHR( '[' );
SID( src->Indirect.Index );
TXT( "]." );
struct dump_ctx *ctx,
const struct tgsi_full_dst_register *dst )
{
- ENM(dst->Register.File, tgsi_file_names);
+ TXT(tgsi_file_name(dst->Register.File));
if (dst->Register.Dimension) {
if (dst->Dimension.Indirect) {
CHR( '[' );
- ENM( dst->DimIndirect.File, tgsi_file_names );
+ TXT(tgsi_file_name(dst->DimIndirect.File));
CHR( '[' );
SID( dst->DimIndirect.Index );
TXT( "]." );
}
if (dst->Register.Indirect) {
CHR( '[' );
- ENM( dst->Indirect.File, tgsi_file_names );
+ TXT(tgsi_file_name(dst->Indirect.File));
CHR( '[' );
SID( dst->Indirect.Index );
TXT( "]." );
TXT( "DCL " );
- ENM(decl->Declaration.File, tgsi_file_names);
+ TXT(tgsi_file_name(decl->Declaration.File));
/* all geometry shader inputs are two dimensional */
if (decl->Declaration.File == TGSI_FILE_INPUT &&
ENM( inst->Texture.Texture, tgsi_texture_names );
for (i = 0; i < inst->Texture.NumOffsets; i++) {
TXT( ", " );
- ENM( inst->TexOffsets[i].File, tgsi_file_names);
+ TXT(tgsi_file_name(inst->TexOffsets[i].File));
CHR( '[' );
SID( inst->TexOffsets[i].Index );
CHR( ']' );
"COMP"
};
-const char *tgsi_file_names[TGSI_FILE_COUNT] =
+static const char *tgsi_file_names[] =
{
"NULL",
"CONST",
static INLINE void
tgsi_strings_check(void)
{
- STATIC_ASSERT(Elements(tgsi_file_names) == TGSI_FILE_COUNT);
STATIC_ASSERT(Elements(tgsi_semantic_names) == TGSI_SEMANTIC_COUNT);
STATIC_ASSERT(Elements(tgsi_texture_names) == TGSI_TEXTURE_COUNT);
STATIC_ASSERT(Elements(tgsi_property_names) == TGSI_PROPERTY_COUNT);
(void) tgsi_fs_coord_origin_names;
(void) tgsi_fs_coord_pixel_center_names;
}
+
+
+const char *
+tgsi_file_name(unsigned file)
+{
+ STATIC_ASSERT(Elements(tgsi_file_names) == TGSI_FILE_COUNT);
+ if (file < Elements(tgsi_file_names))
+ return tgsi_file_names[file];
+ else
+ return "invalid file";
+}
extern const char *tgsi_processor_type_names[4];
-extern const char *tgsi_file_names[TGSI_FILE_COUNT];
-
extern const char *tgsi_semantic_names[TGSI_SEMANTIC_COUNT];
extern const char *tgsi_texture_names[TGSI_TEXTURE_COUNT];
extern const char *tgsi_immediate_type_names[3];
+const char *
+tgsi_file_name(unsigned file);
+
+
#if defined __cplusplus
}
#endif
for (i = 0; i < TGSI_FILE_COUNT; i++) {
const char *cur = *pcur;
- if (str_match_nocase_whole( &cur, tgsi_file_names[i] )) {
+ if (str_match_nocase_whole( &cur, tgsi_file_name(i) )) {
*pcur = cur;
*file = i;
return TRUE;
break;
default:
DBG("unsupported dst register file: %s",
- tgsi_file_names[dst->File]);
+ tgsi_file_name(dst->File));
assert(0);
break;
}
break;
default:
DBG("unsupported src register file: %s",
- tgsi_file_names[src->File]);
+ tgsi_file_name(src->File));
assert(0);
break;
}
if (tgsi_dim) {
ilo_printf(" v%d:\t%s[%d][%d]\n", vrf,
- tgsi_file_names[tgsi_file], tgsi_dim, tgsi_index);
+ tgsi_file_name(tgsi_file), tgsi_dim, tgsi_index);
}
else {
ilo_printf(" v%d:\t%s[%d]\n", vrf,
- tgsi_file_names[tgsi_file], tgsi_index);
+ tgsi_file_name(tgsi_file), tgsi_index);
}
return PIPE_OK;