tgsi_dump_c.c File Reference

Include dependency graph for tgsi_dump_c.c:

Go to the source code of this file.

Defines

#define EOL()   debug_printf( "\n" )
#define TXT(S)   debug_printf( "%s", S )
#define CHR(C)   debug_printf( "%c", C )
#define UIX(I)   debug_printf( "0x%x", I )
#define UID(I)   debug_printf( "%u", I )
#define SID(I)   debug_printf( "%d", I )
#define FLT(F)   debug_printf( "%10.4f", F )
#define ENM(E, ENUMS)   dump_enum( E, ENUMS, sizeof( ENUMS ) / sizeof( *ENUMS ) )

Functions

static void dump_enum (const unsigned e, const char **enums, const unsigned enums_count)
static void dump_declaration_verbose (struct tgsi_full_declaration *decl, unsigned ignored, unsigned deflt, struct tgsi_full_declaration *fd)
static void dump_immediate_verbose (struct tgsi_full_immediate *imm, unsigned ignored)
static void dump_instruction_verbose (struct tgsi_full_instruction *inst, unsigned ignored, unsigned deflt, struct tgsi_full_instruction *fi)
void tgsi_dump_c (const struct tgsi_token *tokens, uint flags)

Variables

static const char * TGSI_PROCESSOR_TYPES []
static const char * TGSI_TOKEN_TYPES []
static const char * TGSI_FILES [TGSI_FILE_COUNT]
static const char * TGSI_INTERPOLATES []
static const char * TGSI_SEMANTICS []
static const char * TGSI_IMMS []
static const char * TGSI_SATS []
static const char * TGSI_INSTRUCTION_EXTS []
static const char * TGSI_PRECISIONS []
static const char * TGSI_CCS []
static const char * TGSI_SWIZZLES []
static const char * TGSI_TEXTURES []
static const char * TGSI_SRC_REGISTER_EXTS []
static const char * TGSI_EXTSWIZZLES []
static const char * TGSI_WRITEMASKS []
static const char * TGSI_DST_REGISTER_EXTS []
static const char * TGSI_MODULATES []


Define Documentation

#define CHR (  )     debug_printf( "%c", C )

Definition at line 51 of file tgsi_dump_c.c.

#define ENM ( E,
ENUMS   )     dump_enum( E, ENUMS, sizeof( ENUMS ) / sizeof( *ENUMS ) )

Definition at line 56 of file tgsi_dump_c.c.

 
#define EOL (  )     debug_printf( "\n" )

Definition at line 49 of file tgsi_dump_c.c.

#define FLT (  )     debug_printf( "%10.4f", F )

Definition at line 55 of file tgsi_dump_c.c.

#define SID (  )     debug_printf( "%d", I )

Definition at line 54 of file tgsi_dump_c.c.

#define TXT (  )     debug_printf( "%s", S )

Definition at line 50 of file tgsi_dump_c.c.

#define UID (  )     debug_printf( "%u", I )

Definition at line 53 of file tgsi_dump_c.c.

#define UIX (  )     debug_printf( "0x%x", I )

Definition at line 52 of file tgsi_dump_c.c.


Function Documentation

static void dump_declaration_verbose ( struct tgsi_full_declaration decl,
unsigned  ignored,
unsigned  deflt,
struct tgsi_full_declaration fd 
) [static]

Definition at line 218 of file tgsi_dump_c.c.

References CHR, tgsi_full_declaration::Declaration, tgsi_full_declaration::DeclarationRange, ENM, EOL, tgsi_declaration::File, tgsi_declaration_range::First, tgsi_declaration::Interpolate, tgsi_declaration_range::Last, tgsi_declaration_semantic::Padding, tgsi_declaration::Padding, tgsi_full_declaration::Semantic, tgsi_declaration::Semantic, tgsi_declaration_semantic::SemanticIndex, tgsi_declaration_semantic::SemanticName, TGSI_FILES, TGSI_INTERPOLATES, TGSI_SEMANTICS, TGSI_WRITEMASK_W, TGSI_WRITEMASK_X, TGSI_WRITEMASK_Y, TGSI_WRITEMASK_Z, TXT, UID, UIX, and tgsi_declaration::UsageMask.

00223 {
00224    TXT( "\nFile       : " );
00225    ENM( decl->Declaration.File, TGSI_FILES );
00226    if( deflt || fd->Declaration.UsageMask != decl->Declaration.UsageMask ) {
00227       TXT( "\nUsageMask  : " );
00228       if( decl->Declaration.UsageMask & TGSI_WRITEMASK_X ) {
00229          CHR( 'X' );
00230       }
00231       if( decl->Declaration.UsageMask & TGSI_WRITEMASK_Y ) {
00232          CHR( 'Y' );
00233       }
00234       if( decl->Declaration.UsageMask & TGSI_WRITEMASK_Z ) {
00235          CHR( 'Z' );
00236       }
00237       if( decl->Declaration.UsageMask & TGSI_WRITEMASK_W ) {
00238          CHR( 'W' );
00239       }
00240    }
00241    if( deflt || fd->Declaration.Interpolate != decl->Declaration.Interpolate ) {
00242       TXT( "\nInterpolate: " );
00243       ENM( decl->Declaration.Interpolate, TGSI_INTERPOLATES );
00244    }
00245    if( deflt || fd->Declaration.Semantic != decl->Declaration.Semantic ) {
00246       TXT( "\nSemantic   : " );
00247       UID( decl->Declaration.Semantic );
00248    }
00249    if( ignored ) {
00250       TXT( "\nPadding    : " );
00251       UIX( decl->Declaration.Padding );
00252    }
00253 
00254    EOL();
00255    TXT( "\nFirst: " );
00256    UID( decl->DeclarationRange.First );
00257    TXT( "\nLast : " );
00258    UID( decl->DeclarationRange.Last );
00259 
00260    if( decl->Declaration.Semantic ) {
00261       EOL();
00262       TXT( "\nSemanticName : " );
00263       ENM( decl->Semantic.SemanticName, TGSI_SEMANTICS );
00264       TXT( "\nSemanticIndex: " );
00265       UID( decl->Semantic.SemanticIndex );
00266       if( ignored ) {
00267          TXT( "\nPadding      : " );
00268          UIX( decl->Semantic.Padding );
00269       }
00270    }
00271 }

static void dump_enum ( const unsigned  e,
const char **  enums,
const unsigned  enums_count 
) [static]

Definition at line 36 of file tgsi_dump_c.c.

References debug_printf().

00040 {
00041    if (e >= enums_count) {
00042       debug_printf( "%u", e );
00043    }
00044    else {
00045       debug_printf( "%s", enums[e] );
00046    }
00047 }

static void dump_immediate_verbose ( struct tgsi_full_immediate imm,
unsigned  ignored 
) [static]

Definition at line 274 of file tgsi_dump_c.c.

References assert, tgsi_immediate::DataType, ENM, EOL, tgsi_immediate_float32::Float, FLT, tgsi_full_immediate::Immediate, tgsi_full_immediate::ImmediateFloat32, tgsi_immediate::Padding, tgsi_immediate::Size, TGSI_IMM_FLOAT32, TGSI_IMMS, TXT, tgsi_full_immediate::u, and UIX.

00277 {
00278    unsigned i;
00279 
00280    TXT( "\nDataType   : " );
00281    ENM( imm->Immediate.DataType, TGSI_IMMS );
00282    if( ignored ) {
00283       TXT( "\nPadding    : " );
00284       UIX( imm->Immediate.Padding );
00285    }
00286 
00287    for( i = 0; i < imm->Immediate.Size - 1; i++ ) {
00288       EOL();
00289       switch( imm->Immediate.DataType ) {
00290       case TGSI_IMM_FLOAT32:
00291          TXT( "\nFloat: " );
00292          FLT( imm->u.ImmediateFloat32[i].Float );
00293          break;
00294 
00295       default:
00296          assert( 0 );
00297       }
00298    }
00299 }

static void dump_instruction_verbose ( struct tgsi_full_instruction inst,
unsigned  ignored,
unsigned  deflt,
struct tgsi_full_instruction fi 
) [static]

Definition at line 302 of file tgsi_dump_c.c.

References tgsi_src_register_ext_mod::Absolute, tgsi_src_register_ext_mod::Bias, tgsi_src_register_ext_mod::Complement, tgsi_instruction_ext_nv::CondDstIndex, tgsi_instruction_ext_nv::CondDstUpdate, tgsi_instruction_ext_nv::CondFlowEnable, tgsi_instruction_ext_nv::CondFlowIndex, tgsi_dst_register_ext_concode::CondMask, tgsi_instruction_ext_nv::CondMask, tgsi_dst_register_ext_concode::CondSrcIndex, tgsi_dst_register_ext_concode::CondSwizzleW, tgsi_instruction_ext_nv::CondSwizzleW, tgsi_dst_register_ext_concode::CondSwizzleX, tgsi_instruction_ext_nv::CondSwizzleX, tgsi_dst_register_ext_concode::CondSwizzleY, tgsi_instruction_ext_nv::CondSwizzleY, tgsi_dst_register_ext_concode::CondSwizzleZ, tgsi_instruction_ext_nv::CondSwizzleZ, tgsi_src_register::Dimension, tgsi_dst_register::Dimension, tgsi_full_dst_register::DstRegister, tgsi_full_dst_register::DstRegisterExtConcode, tgsi_full_dst_register::DstRegisterExtModulate, ENM, EOL, tgsi_src_register_ext_mod::Extended, tgsi_src_register_ext_swz::Extended, tgsi_src_register::Extended, tgsi_dst_register_ext_modulate::Extended, tgsi_dst_register_ext_concode::Extended, tgsi_dst_register::Extended, tgsi_instruction_ext_texture::Extended, tgsi_instruction_ext_label::Extended, tgsi_instruction_ext_nv::Extended, tgsi_src_register_ext_swz::ExtSwizzleW, tgsi_src_register_ext_swz::ExtSwizzleX, tgsi_src_register_ext_swz::ExtSwizzleY, tgsi_src_register_ext_swz::ExtSwizzleZ, tgsi_src_register::File, tgsi_dst_register::File, tgsi_full_instruction::FullDstRegisters, tgsi_full_instruction::FullSrcRegisters, tgsi_src_register::Index, tgsi_dst_register::Index, tgsi_src_register::Indirect, tgsi_dst_register::Indirect, tgsi_full_instruction::Instruction, tgsi_full_instruction::InstructionExtLabel, tgsi_full_instruction::InstructionExtNv, tgsi_full_instruction::InstructionExtTexture, tgsi_instruction_ext_label::Label, tgsi_opcode_info::mnemonic, tgsi_dst_register_ext_modulate::Modulate, tgsi_src_register_ext_mod::Negate, tgsi_src_register::Negate, tgsi_src_register_ext_swz::NegateW, tgsi_src_register_ext_swz::NegateX, tgsi_src_register_ext_swz::NegateY, tgsi_src_register_ext_swz::NegateZ, tgsi_instruction::NumDstRegs, tgsi_instruction::NumSrcRegs, tgsi_instruction::Opcode, tgsi_src_register_ext_mod::Padding, tgsi_src_register_ext_swz::Padding, tgsi_dst_register_ext_modulate::Padding, tgsi_dst_register_ext_concode::Padding, tgsi_dst_register::Padding, tgsi_instruction_ext_texture::Padding, tgsi_instruction_ext_label::Padding, tgsi_instruction_ext_nv::Padding, tgsi_instruction::Padding, tgsi_instruction_ext_nv::Precision, tgsi_instruction::Saturate, tgsi_src_register_ext_mod::Scale2X, SID, tgsi_full_src_register::SrcRegister, tgsi_full_src_register::SrcRegisterExtMod, tgsi_full_src_register::SrcRegisterExtSwz, tgsi_src_register::SwizzleW, tgsi_src_register::SwizzleX, tgsi_src_register::SwizzleY, tgsi_src_register::SwizzleZ, tgsi_instruction_ext_texture::Texture, TGSI_CCS, tgsi_compare_dst_register_ext_concode(), tgsi_compare_dst_register_ext_modulate(), tgsi_compare_instruction_ext_label(), tgsi_compare_instruction_ext_nv(), tgsi_compare_instruction_ext_texture(), tgsi_compare_src_register_ext_mod(), tgsi_compare_src_register_ext_swz(), TGSI_DST_REGISTER_EXTS, TGSI_EXTSWIZZLES, TGSI_FILES, tgsi_get_opcode_info(), TGSI_INSTRUCTION_EXTS, TGSI_MODULATES, TGSI_PRECISIONS, TGSI_SATS, TGSI_SRC_REGISTER_EXTS, TGSI_SWIZZLES, TGSI_TEXTURES, TGSI_WRITEMASKS, TXT, tgsi_src_register_ext_mod::Type, tgsi_src_register_ext_swz::Type, tgsi_dst_register_ext_modulate::Type, tgsi_dst_register_ext_concode::Type, tgsi_instruction_ext_texture::Type, tgsi_instruction_ext_label::Type, tgsi_instruction_ext_nv::Type, UID, UIX, and tgsi_dst_register::WriteMask.

00307 {
00308    unsigned i;
00309 
00310    TXT( "\nOpcode     : OPCODE_" );
00311    TXT( tgsi_get_opcode_info( inst->Instruction.Opcode )->mnemonic );
00312    if( deflt || fi->Instruction.Saturate != inst->Instruction.Saturate ) {
00313       TXT( "\nSaturate   : " );
00314       ENM( inst->Instruction.Saturate, TGSI_SATS );
00315    }
00316    if( deflt || fi->Instruction.NumDstRegs != inst->Instruction.NumDstRegs ) {
00317       TXT( "\nNumDstRegs : " );
00318       UID( inst->Instruction.NumDstRegs );
00319    }
00320    if( deflt || fi->Instruction.NumSrcRegs != inst->Instruction.NumSrcRegs ) {
00321       TXT( "\nNumSrcRegs : " );
00322       UID( inst->Instruction.NumSrcRegs );
00323    }
00324    if( ignored ) {
00325       TXT( "\nPadding    : " );
00326       UIX( inst->Instruction.Padding );
00327    }
00328 
00329    if( deflt || tgsi_compare_instruction_ext_nv( inst->InstructionExtNv, fi->InstructionExtNv ) ) {
00330       EOL();
00331       TXT( "\nType          : " );
00332       ENM( inst->InstructionExtNv.Type, TGSI_INSTRUCTION_EXTS );
00333       if( deflt || fi->InstructionExtNv.Precision != inst->InstructionExtNv.Precision ) {
00334          TXT( "\nPrecision     : " );
00335          ENM( inst->InstructionExtNv.Precision, TGSI_PRECISIONS );
00336       }
00337       if( deflt || fi->InstructionExtNv.CondDstIndex != inst->InstructionExtNv.CondDstIndex ) {
00338          TXT( "\nCondDstIndex  : " );
00339          UID( inst->InstructionExtNv.CondDstIndex );
00340       }
00341       if( deflt || fi->InstructionExtNv.CondFlowIndex != inst->InstructionExtNv.CondFlowIndex ) {
00342          TXT( "\nCondFlowIndex : " );
00343          UID( inst->InstructionExtNv.CondFlowIndex );
00344       }
00345       if( deflt || fi->InstructionExtNv.CondMask != inst->InstructionExtNv.CondMask ) {
00346          TXT( "\nCondMask      : " );
00347          ENM( inst->InstructionExtNv.CondMask, TGSI_CCS );
00348       }
00349       if( deflt || fi->InstructionExtNv.CondSwizzleX != inst->InstructionExtNv.CondSwizzleX ) {
00350          TXT( "\nCondSwizzleX  : " );
00351          ENM( inst->InstructionExtNv.CondSwizzleX, TGSI_SWIZZLES );
00352       }
00353       if( deflt || fi->InstructionExtNv.CondSwizzleY != inst->InstructionExtNv.CondSwizzleY ) {
00354          TXT( "\nCondSwizzleY  : " );
00355          ENM( inst->InstructionExtNv.CondSwizzleY, TGSI_SWIZZLES );
00356       }
00357       if( deflt || fi->InstructionExtNv.CondSwizzleZ != inst->InstructionExtNv.CondSwizzleZ ) {
00358          TXT( "\nCondSwizzleZ  : " );
00359          ENM( inst->InstructionExtNv.CondSwizzleZ, TGSI_SWIZZLES );
00360       }
00361       if( deflt || fi->InstructionExtNv.CondSwizzleW != inst->InstructionExtNv.CondSwizzleW ) {
00362          TXT( "\nCondSwizzleW  : " );
00363          ENM( inst->InstructionExtNv.CondSwizzleW, TGSI_SWIZZLES );
00364       }
00365       if( deflt || fi->InstructionExtNv.CondDstUpdate != inst->InstructionExtNv.CondDstUpdate ) {
00366          TXT( "\nCondDstUpdate : " );
00367          UID( inst->InstructionExtNv.CondDstUpdate );
00368       }
00369       if( deflt || fi->InstructionExtNv.CondFlowEnable != inst->InstructionExtNv.CondFlowEnable ) {
00370          TXT( "\nCondFlowEnable: " );
00371          UID( inst->InstructionExtNv.CondFlowEnable );
00372       }
00373       if( ignored ) {
00374          TXT( "\nPadding       : " );
00375          UIX( inst->InstructionExtNv.Padding );
00376          if( deflt || fi->InstructionExtNv.Extended != inst->InstructionExtNv.Extended ) {
00377             TXT( "\nExtended      : " );
00378             UID( inst->InstructionExtNv.Extended );
00379          }
00380       }
00381    }
00382 
00383    if( deflt || tgsi_compare_instruction_ext_label( inst->InstructionExtLabel, fi->InstructionExtLabel ) ) {
00384       EOL();
00385       TXT( "\nType    : " );
00386       ENM( inst->InstructionExtLabel.Type, TGSI_INSTRUCTION_EXTS );
00387       if( deflt || fi->InstructionExtLabel.Label != inst->InstructionExtLabel.Label ) {
00388          TXT( "\nLabel   : " );
00389          UID( inst->InstructionExtLabel.Label );
00390       }
00391       if( ignored ) {
00392          TXT( "\nPadding : " );
00393          UIX( inst->InstructionExtLabel.Padding );
00394          if( deflt || fi->InstructionExtLabel.Extended != inst->InstructionExtLabel.Extended ) {
00395             TXT( "\nExtended: " );
00396             UID( inst->InstructionExtLabel.Extended );
00397          }
00398       }
00399    }
00400 
00401    if( deflt || tgsi_compare_instruction_ext_texture( inst->InstructionExtTexture, fi->InstructionExtTexture ) ) {
00402       EOL();
00403       TXT( "\nType    : " );
00404       ENM( inst->InstructionExtTexture.Type, TGSI_INSTRUCTION_EXTS );
00405       if( deflt || fi->InstructionExtTexture.Texture != inst->InstructionExtTexture.Texture ) {
00406          TXT( "\nTexture : " );
00407          ENM( inst->InstructionExtTexture.Texture, TGSI_TEXTURES );
00408       }
00409       if( ignored ) {
00410          TXT( "\nPadding : " );
00411          UIX( inst->InstructionExtTexture.Padding );
00412          if( deflt || fi->InstructionExtTexture.Extended != inst->InstructionExtTexture.Extended ) {
00413             TXT( "\nExtended: " );
00414             UID( inst->InstructionExtTexture.Extended );
00415          }
00416       }
00417    }
00418 
00419    for( i = 0; i < inst->Instruction.NumDstRegs; i++ ) {
00420       struct tgsi_full_dst_register *dst = &inst->FullDstRegisters[i];
00421       struct tgsi_full_dst_register *fd = &fi->FullDstRegisters[i];
00422 
00423       EOL();
00424       TXT( "\nFile     : " );
00425       ENM( dst->DstRegister.File, TGSI_FILES );
00426       if( deflt || fd->DstRegister.WriteMask != dst->DstRegister.WriteMask ) {
00427          TXT( "\nWriteMask: " );
00428          ENM( dst->DstRegister.WriteMask, TGSI_WRITEMASKS );
00429       }
00430       if( ignored ) {
00431          if( deflt || fd->DstRegister.Indirect != dst->DstRegister.Indirect ) {
00432             TXT( "\nIndirect : " );
00433             UID( dst->DstRegister.Indirect );
00434          }
00435          if( deflt || fd->DstRegister.Dimension != dst->DstRegister.Dimension ) {
00436             TXT( "\nDimension: " );
00437             UID( dst->DstRegister.Dimension );
00438          }
00439       }
00440       if( deflt || fd->DstRegister.Index != dst->DstRegister.Index ) {
00441          TXT( "\nIndex    : " );
00442          SID( dst->DstRegister.Index );
00443       }
00444       if( ignored ) {
00445          TXT( "\nPadding  : " );
00446          UIX( dst->DstRegister.Padding );
00447          if( deflt || fd->DstRegister.Extended != dst->DstRegister.Extended ) {
00448             TXT( "\nExtended : " );
00449             UID( dst->DstRegister.Extended );
00450          }
00451       }
00452 
00453       if( deflt || tgsi_compare_dst_register_ext_concode( dst->DstRegisterExtConcode, fd->DstRegisterExtConcode ) ) {
00454          EOL();
00455          TXT( "\nType        : " );
00456          ENM( dst->DstRegisterExtConcode.Type, TGSI_DST_REGISTER_EXTS );
00457          if( deflt || fd->DstRegisterExtConcode.CondMask != dst->DstRegisterExtConcode.CondMask ) {
00458             TXT( "\nCondMask    : " );
00459             ENM( dst->DstRegisterExtConcode.CondMask, TGSI_CCS );
00460          }
00461          if( deflt || fd->DstRegisterExtConcode.CondSwizzleX != dst->DstRegisterExtConcode.CondSwizzleX ) {
00462             TXT( "\nCondSwizzleX: " );
00463             ENM( dst->DstRegisterExtConcode.CondSwizzleX, TGSI_SWIZZLES );
00464          }
00465          if( deflt || fd->DstRegisterExtConcode.CondSwizzleY != dst->DstRegisterExtConcode.CondSwizzleY ) {
00466             TXT( "\nCondSwizzleY: " );
00467             ENM( dst->DstRegisterExtConcode.CondSwizzleY, TGSI_SWIZZLES );
00468          }
00469          if( deflt || fd->DstRegisterExtConcode.CondSwizzleZ != dst->DstRegisterExtConcode.CondSwizzleZ ) {
00470             TXT( "\nCondSwizzleZ: " );
00471             ENM( dst->DstRegisterExtConcode.CondSwizzleZ, TGSI_SWIZZLES );
00472          }
00473          if( deflt || fd->DstRegisterExtConcode.CondSwizzleW != dst->DstRegisterExtConcode.CondSwizzleW ) {
00474             TXT( "\nCondSwizzleW: " );
00475             ENM( dst->DstRegisterExtConcode.CondSwizzleW, TGSI_SWIZZLES );
00476          }
00477          if( deflt || fd->DstRegisterExtConcode.CondSrcIndex != dst->DstRegisterExtConcode.CondSrcIndex ) {
00478             TXT( "\nCondSrcIndex: " );
00479             UID( dst->DstRegisterExtConcode.CondSrcIndex );
00480          }
00481          if( ignored ) {
00482             TXT( "\nPadding     : " );
00483             UIX( dst->DstRegisterExtConcode.Padding );
00484             if( deflt || fd->DstRegisterExtConcode.Extended != dst->DstRegisterExtConcode.Extended ) {
00485                TXT( "\nExtended    : " );
00486                UID( dst->DstRegisterExtConcode.Extended );
00487             }
00488          }
00489       }
00490 
00491       if( deflt || tgsi_compare_dst_register_ext_modulate( dst->DstRegisterExtModulate, fd->DstRegisterExtModulate ) ) {
00492          EOL();
00493          TXT( "\nType    : " );
00494          ENM( dst->DstRegisterExtModulate.Type, TGSI_DST_REGISTER_EXTS );
00495          if( deflt || fd->DstRegisterExtModulate.Modulate != dst->DstRegisterExtModulate.Modulate ) {
00496             TXT( "\nModulate: " );
00497             ENM( dst->DstRegisterExtModulate.Modulate, TGSI_MODULATES );
00498          }
00499          if( ignored ) {
00500             TXT( "\nPadding : " );
00501             UIX( dst->DstRegisterExtModulate.Padding );
00502             if( deflt || fd->DstRegisterExtModulate.Extended != dst->DstRegisterExtModulate.Extended ) {
00503                TXT( "\nExtended: " );
00504                UID( dst->DstRegisterExtModulate.Extended );
00505             }
00506          }
00507       }
00508    }
00509 
00510    for( i = 0; i < inst->Instruction.NumSrcRegs; i++ ) {
00511       struct tgsi_full_src_register *src = &inst->FullSrcRegisters[i];
00512       struct tgsi_full_src_register *fs = &fi->FullSrcRegisters[i];
00513 
00514       EOL();
00515       TXT( "\nFile     : ");
00516       ENM( src->SrcRegister.File, TGSI_FILES );
00517       if( deflt || fs->SrcRegister.SwizzleX != src->SrcRegister.SwizzleX ) {
00518          TXT( "\nSwizzleX : " );
00519          ENM( src->SrcRegister.SwizzleX, TGSI_SWIZZLES );
00520       }
00521       if( deflt || fs->SrcRegister.SwizzleY != src->SrcRegister.SwizzleY ) {
00522          TXT( "\nSwizzleY : " );
00523          ENM( src->SrcRegister.SwizzleY, TGSI_SWIZZLES );
00524       }
00525       if( deflt || fs->SrcRegister.SwizzleZ != src->SrcRegister.SwizzleZ ) {
00526          TXT( "\nSwizzleZ : " );
00527          ENM( src->SrcRegister.SwizzleZ, TGSI_SWIZZLES );
00528       }
00529       if( deflt || fs->SrcRegister.SwizzleW != src->SrcRegister.SwizzleW ) {
00530          TXT( "\nSwizzleW : " );
00531          ENM( src->SrcRegister.SwizzleW, TGSI_SWIZZLES );
00532       }
00533       if( deflt || fs->SrcRegister.Negate != src->SrcRegister.Negate ) {
00534          TXT( "\nNegate   : " );
00535          UID( src->SrcRegister.Negate );
00536       }
00537       if( ignored ) {
00538          if( deflt || fs->SrcRegister.Indirect != src->SrcRegister.Indirect ) {
00539             TXT( "\nIndirect : " );
00540             UID( src->SrcRegister.Indirect );
00541          }
00542          if( deflt || fs->SrcRegister.Dimension != src->SrcRegister.Dimension ) {
00543             TXT( "\nDimension: " );
00544             UID( src->SrcRegister.Dimension );
00545          }
00546       }
00547       if( deflt || fs->SrcRegister.Index != src->SrcRegister.Index ) {
00548          TXT( "\nIndex    : " );
00549          SID( src->SrcRegister.Index );
00550       }
00551       if( ignored ) {
00552          if( deflt || fs->SrcRegister.Extended != src->SrcRegister.Extended ) {
00553             TXT( "\nExtended : " );
00554             UID( src->SrcRegister.Extended );
00555          }
00556       }
00557 
00558       if( deflt || tgsi_compare_src_register_ext_swz( src->SrcRegisterExtSwz, fs->SrcRegisterExtSwz ) ) {
00559          EOL();
00560          TXT( "\nType       : " );
00561          ENM( src->SrcRegisterExtSwz.Type, TGSI_SRC_REGISTER_EXTS );
00562          if( deflt || fs->SrcRegisterExtSwz.ExtSwizzleX != src->SrcRegisterExtSwz.ExtSwizzleX ) {
00563             TXT( "\nExtSwizzleX: " );
00564             ENM( src->SrcRegisterExtSwz.ExtSwizzleX, TGSI_EXTSWIZZLES );
00565          }
00566          if( deflt || fs->SrcRegisterExtSwz.ExtSwizzleY != src->SrcRegisterExtSwz.ExtSwizzleY ) {
00567             TXT( "\nExtSwizzleY: " );
00568             ENM( src->SrcRegisterExtSwz.ExtSwizzleY, TGSI_EXTSWIZZLES );
00569          }
00570          if( deflt || fs->SrcRegisterExtSwz.ExtSwizzleZ != src->SrcRegisterExtSwz.ExtSwizzleZ ) {
00571             TXT( "\nExtSwizzleZ: " );
00572             ENM( src->SrcRegisterExtSwz.ExtSwizzleZ, TGSI_EXTSWIZZLES );
00573          }
00574          if( deflt || fs->SrcRegisterExtSwz.ExtSwizzleW != src->SrcRegisterExtSwz.ExtSwizzleW ) {
00575             TXT( "\nExtSwizzleW: " );
00576             ENM( src->SrcRegisterExtSwz.ExtSwizzleW, TGSI_EXTSWIZZLES );
00577          }
00578          if( deflt || fs->SrcRegisterExtSwz.NegateX != src->SrcRegisterExtSwz.NegateX ) {
00579             TXT( "\nNegateX   : " );
00580             UID( src->SrcRegisterExtSwz.NegateX );
00581          }
00582          if( deflt || fs->SrcRegisterExtSwz.NegateY != src->SrcRegisterExtSwz.NegateY ) {
00583             TXT( "\nNegateY   : " );
00584             UID( src->SrcRegisterExtSwz.NegateY );
00585          }
00586          if( deflt || fs->SrcRegisterExtSwz.NegateZ != src->SrcRegisterExtSwz.NegateZ ) {
00587             TXT( "\nNegateZ   : " );
00588             UID( src->SrcRegisterExtSwz.NegateZ );
00589          }
00590          if( deflt || fs->SrcRegisterExtSwz.NegateW != src->SrcRegisterExtSwz.NegateW ) {
00591             TXT( "\nNegateW   : " );
00592             UID( src->SrcRegisterExtSwz.NegateW );
00593          }
00594          if( ignored ) {
00595             TXT( "\nPadding   : " );
00596             UIX( src->SrcRegisterExtSwz.Padding );
00597             if( deflt || fs->SrcRegisterExtSwz.Extended != src->SrcRegisterExtSwz.Extended ) {
00598                TXT( "\nExtended   : " );
00599                UID( src->SrcRegisterExtSwz.Extended );
00600             }
00601          }
00602       }
00603 
00604       if( deflt || tgsi_compare_src_register_ext_mod( src->SrcRegisterExtMod, fs->SrcRegisterExtMod ) ) {
00605          EOL();
00606          TXT( "\nType     : " );
00607          ENM( src->SrcRegisterExtMod.Type, TGSI_SRC_REGISTER_EXTS );
00608          if( deflt || fs->SrcRegisterExtMod.Complement != src->SrcRegisterExtMod.Complement ) {
00609             TXT( "\nComplement: " );
00610             UID( src->SrcRegisterExtMod.Complement );
00611          }
00612          if( deflt || fs->SrcRegisterExtMod.Bias != src->SrcRegisterExtMod.Bias ) {
00613             TXT( "\nBias     : " );
00614             UID( src->SrcRegisterExtMod.Bias );
00615          }
00616          if( deflt || fs->SrcRegisterExtMod.Scale2X != src->SrcRegisterExtMod.Scale2X ) {
00617             TXT( "\nScale2X   : " );
00618             UID( src->SrcRegisterExtMod.Scale2X );
00619          }
00620          if( deflt || fs->SrcRegisterExtMod.Absolute != src->SrcRegisterExtMod.Absolute ) {
00621             TXT( "\nAbsolute  : " );
00622             UID( src->SrcRegisterExtMod.Absolute );
00623          }
00624          if( deflt || fs->SrcRegisterExtMod.Negate != src->SrcRegisterExtMod.Negate ) {
00625             TXT( "\nNegate   : " );
00626             UID( src->SrcRegisterExtMod.Negate );
00627          }
00628          if( ignored ) {
00629             TXT( "\nPadding   : " );
00630             UIX( src->SrcRegisterExtMod.Padding );
00631             if( deflt || fs->SrcRegisterExtMod.Extended != src->SrcRegisterExtMod.Extended ) {
00632                TXT( "\nExtended  : " );
00633                UID( src->SrcRegisterExtMod.Extended );
00634             }
00635          }
00636       }
00637    }
00638 }

void tgsi_dump_c ( const struct tgsi_token tokens,
uint  flags 
)

Definition at line 641 of file tgsi_dump_c.c.

References assert, tgsi_header::BodySize, dump_declaration_verbose(), dump_immediate_verbose(), dump_instruction_verbose(), ENM, EOL, tgsi_token::Extended, tgsi_full_token::FullDeclaration, tgsi_parse_context::FullHeader, tgsi_full_token::FullImmediate, tgsi_full_token::FullInstruction, tgsi_parse_context::FullToken, tgsi_parse_context::FullVersion, tgsi_full_header::Header, tgsi_header::HeaderSize, tgsi_version::MajorVersion, tgsi_version::MinorVersion, tgsi_processor::Processor, tgsi_full_header::Processor, tgsi_token::Size, tgsi_default_full_declaration(), tgsi_default_full_instruction(), TGSI_DUMP_C_DEFAULT, TGSI_DUMP_C_IGNORED, tgsi_parse_end_of_tokens(), tgsi_parse_free(), tgsi_parse_init(), tgsi_parse_token(), TGSI_PROCESSOR_TYPES, TGSI_TOKEN_TYPE_DECLARATION, TGSI_TOKEN_TYPE_IMMEDIATE, TGSI_TOKEN_TYPE_INSTRUCTION, TGSI_TOKEN_TYPES, tgsi_full_token::Token, TXT, tgsi_token::Type, UID, and tgsi_full_version::Version.

00644 {
00645    struct tgsi_parse_context parse;
00646    struct tgsi_full_instruction fi;
00647    struct tgsi_full_declaration fd;
00648    uint ignored = flags & TGSI_DUMP_C_IGNORED;
00649    uint deflt = flags & TGSI_DUMP_C_DEFAULT;
00650    uint instno = 0;
00651 
00652    tgsi_parse_init( &parse, tokens );
00653 
00654    TXT( "tgsi-dump begin -----------------" );
00655 
00656    TXT( "\nMajorVersion: " );
00657    UID( parse.FullVersion.Version.MajorVersion );
00658    TXT( "\nMinorVersion: " );
00659    UID( parse.FullVersion.Version.MinorVersion );
00660    EOL();
00661 
00662    TXT( "\nHeaderSize: " );
00663    UID( parse.FullHeader.Header.HeaderSize );
00664    TXT( "\nBodySize  : " );
00665    UID( parse.FullHeader.Header.BodySize );
00666    TXT( "\nProcessor : " );
00667    ENM( parse.FullHeader.Processor.Processor, TGSI_PROCESSOR_TYPES );
00668    EOL();
00669 
00670    fi = tgsi_default_full_instruction();
00671    fd = tgsi_default_full_declaration();
00672 
00673    while( !tgsi_parse_end_of_tokens( &parse ) ) {
00674       tgsi_parse_token( &parse );
00675 
00676       TXT( "\nType       : " );
00677       ENM( parse.FullToken.Token.Type, TGSI_TOKEN_TYPES );
00678       if( ignored ) {
00679          TXT( "\nSize       : " );
00680          UID( parse.FullToken.Token.Size );
00681          if( deflt || parse.FullToken.Token.Extended ) {
00682             TXT( "\nExtended   : " );
00683             UID( parse.FullToken.Token.Extended );
00684          }
00685       }
00686 
00687       switch( parse.FullToken.Token.Type ) {
00688       case TGSI_TOKEN_TYPE_DECLARATION:
00689          dump_declaration_verbose(
00690             &parse.FullToken.FullDeclaration,
00691             ignored,
00692             deflt,
00693             &fd );
00694          break;
00695 
00696       case TGSI_TOKEN_TYPE_IMMEDIATE:
00697          dump_immediate_verbose(
00698             &parse.FullToken.FullImmediate,
00699             ignored );
00700          break;
00701 
00702       case TGSI_TOKEN_TYPE_INSTRUCTION:
00703          dump_instruction_verbose(
00704             &parse.FullToken.FullInstruction,
00705             ignored,
00706             deflt,
00707             &fi );
00708          break;
00709 
00710       default:
00711          assert( 0 );
00712       }
00713 
00714       EOL();
00715    }
00716 
00717    TXT( "\ntgsi-dump end -------------------\n" );
00718 
00719    tgsi_parse_free( &parse );
00720 }


Variable Documentation

const char* TGSI_CCS[] [static]

Initial value:

{
   "CC_GT",
   "CC_EQ",
   "CC_LT",
   "CC_UN",
   "CC_GE",
   "CC_LE",
   "CC_NE",
   "CC_TR",
   "CC_FL"
}

Definition at line 130 of file tgsi_dump_c.c.

const char* TGSI_DST_REGISTER_EXTS[] [static]

Initial value:

{
   "DST_REGISTER_EXT_TYPE_CONDCODE",
   "DST_REGISTER_EXT_TYPE_MODULATE"
}

Definition at line 200 of file tgsi_dump_c.c.

const char* TGSI_EXTSWIZZLES[] [static]

Initial value:

{
   "EXTSWIZZLE_X",
   "EXTSWIZZLE_Y",
   "EXTSWIZZLE_Z",
   "EXTSWIZZLE_W",
   "EXTSWIZZLE_ZERO",
   "EXTSWIZZLE_ONE"
}

Definition at line 170 of file tgsi_dump_c.c.

const char* TGSI_FILES[TGSI_FILE_COUNT] [static]

Initial value:

{
   "FILE_NULL",
   "FILE_CONSTANT",
   "FILE_INPUT",
   "FILE_OUTPUT",
   "FILE_TEMPORARY",
   "FILE_SAMPLER",
   "FILE_ADDRESS",
   "FILE_IMMEDIATE",
   "FILE_LOOP"
}

Definition at line 72 of file tgsi_dump_c.c.

const char* TGSI_IMMS[] [static]

Initial value:

{
   "IMM_FLOAT32"
}

Definition at line 103 of file tgsi_dump_c.c.

const char* TGSI_INSTRUCTION_EXTS[] [static]

Initial value:

{
   "INSTRUCTION_EXT_TYPE_NV",
   "INSTRUCTION_EXT_TYPE_LABEL",
   "INSTRUCTION_EXT_TYPE_TEXTURE"
}

Definition at line 115 of file tgsi_dump_c.c.

const char* TGSI_INTERPOLATES[] [static]

Initial value:

{
   "INTERPOLATE_CONSTANT",
   "INTERPOLATE_LINEAR",
   "INTERPOLATE_PERSPECTIVE"
}

Definition at line 85 of file tgsi_dump_c.c.

const char* TGSI_MODULATES[] [static]

Initial value:

{
   "MODULATE_1X",
   "MODULATE_2X",
   "MODULATE_4X",
   "MODULATE_8X",
   "MODULATE_HALF",
   "MODULATE_QUARTER",
   "MODULATE_EIGHTH"
}

Definition at line 206 of file tgsi_dump_c.c.

const char* TGSI_PRECISIONS[] [static]

Initial value:

{
   "PRECISION_DEFAULT",
   "PRECISION_FLOAT32",
   "PRECISION_FLOAT16",
   "PRECISION_FIXED12"
}

Definition at line 122 of file tgsi_dump_c.c.

const char* TGSI_PROCESSOR_TYPES[] [static]

Initial value:

{
   "PROCESSOR_FRAGMENT",
   "PROCESSOR_VERTEX",
   "PROCESSOR_GEOMETRY"
}

Definition at line 58 of file tgsi_dump_c.c.

const char* TGSI_SATS[] [static]

Initial value:

{
   "SAT_NONE",
   "SAT_ZERO_ONE",
   "SAT_MINUS_PLUS_ONE"
}

Definition at line 108 of file tgsi_dump_c.c.

const char* TGSI_SEMANTICS[] [static]

Initial value:

{
   "SEMANTIC_POSITION",
   "SEMANTIC_COLOR",
   "SEMANTIC_BCOLOR",
   "SEMANTIC_FOG",
   "SEMANTIC_PSIZE",
   "SEMANTIC_GENERIC",
   "SEMANTIC_NORMAL"
}

Definition at line 92 of file tgsi_dump_c.c.

const char* TGSI_SRC_REGISTER_EXTS[] [static]

Initial value:

{
   "SRC_REGISTER_EXT_TYPE_SWZ",
   "SRC_REGISTER_EXT_TYPE_MOD"
}

Definition at line 164 of file tgsi_dump_c.c.

const char* TGSI_SWIZZLES[] [static]

Initial value:

{
   "SWIZZLE_X",
   "SWIZZLE_Y",
   "SWIZZLE_Z",
   "SWIZZLE_W"
}

Definition at line 143 of file tgsi_dump_c.c.

const char* TGSI_TEXTURES[] [static]

Initial value:

{
   "TEXTURE_UNKNOWN",
   "TEXTURE_1D",
   "TEXTURE_2D",
   "TEXTURE_3D",
   "TEXTURE_CUBE",
   "TEXTURE_RECT",
   "TEXTURE_SHADOW1D",
   "TEXTURE_SHADOW2D",
   "TEXTURE_SHADOWRECT"
}

Definition at line 151 of file tgsi_dump_c.c.

const char* TGSI_TOKEN_TYPES[] [static]

Initial value:

{
   "TOKEN_TYPE_DECLARATION",
   "TOKEN_TYPE_IMMEDIATE",
   "TOKEN_TYPE_INSTRUCTION"
}

Definition at line 65 of file tgsi_dump_c.c.

const char* TGSI_WRITEMASKS[] [static]

Initial value:

{
   "0",
   "WRITEMASK_X",
   "WRITEMASK_Y",
   "WRITEMASK_XY",
   "WRITEMASK_Z",
   "WRITEMASK_XZ",
   "WRITEMASK_YZ",
   "WRITEMASK_XYZ",
   "WRITEMASK_W",
   "WRITEMASK_XW",
   "WRITEMASK_YW",
   "WRITEMASK_XYW",
   "WRITEMASK_ZW",
   "WRITEMASK_XZW",
   "WRITEMASK_YZW",
   "WRITEMASK_XYZW"
}

Definition at line 180 of file tgsi_dump_c.c.


Generated on Tue Sep 29 06:25:25 2009 for Gallium3D by  doxygen 1.5.4