Go to the source code of this file.
static void declaration_grow | ( | struct tgsi_declaration * | declaration, | |
struct tgsi_header * | header | |||
) | [static] |
Definition at line 159 of file tgsi_build.c.
References assert, header_bodysize_grow(), and tgsi_declaration::Size.
00162 { 00163 assert( declaration->Size < 0xFF ); 00164 00165 declaration->Size++; 00166 00167 header_bodysize_grow( header ); 00168 }
static void header_bodysize_grow | ( | struct tgsi_header * | header | ) | [static] |
static void header_headersize_grow | ( | struct tgsi_header * | header | ) | [static] |
Definition at line 65 of file tgsi_build.c.
References assert, tgsi_header::BodySize, and tgsi_header::HeaderSize.
00066 { 00067 assert( header->HeaderSize < 0xFF ); 00068 assert( header->BodySize == 0 ); 00069 00070 header->HeaderSize++; 00071 }
static void immediate_grow | ( | struct tgsi_immediate * | immediate, | |
struct tgsi_header * | header | |||
) | [static] |
Definition at line 344 of file tgsi_build.c.
References assert, header_bodysize_grow(), and tgsi_immediate::Size.
00347 { 00348 assert( immediate->Size < 0xFF ); 00349 00350 immediate->Size++; 00351 00352 header_bodysize_grow( header ); 00353 }
static void instruction_grow | ( | struct tgsi_instruction * | instruction, | |
struct tgsi_header * | header | |||
) | [static] |
Definition at line 452 of file tgsi_build.c.
References assert, header_bodysize_grow(), and tgsi_instruction::Size.
00455 { 00456 assert (instruction->Size < 0xFF); 00457 00458 instruction->Size++; 00459 00460 header_bodysize_grow( header ); 00461 }
struct tgsi_declaration tgsi_build_declaration | ( | unsigned | file, | |
unsigned | usage_mask, | |||
unsigned | interpolate, | |||
unsigned | semantic, | |||
unsigned | centroid, | |||
unsigned | invariant, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 131 of file tgsi_build.c.
References assert, tgsi_declaration::Centroid, tgsi_declaration::File, header_bodysize_grow(), tgsi_declaration::Interpolate, tgsi_declaration::Invariant, tgsi_declaration::Semantic, tgsi_default_declaration(), TGSI_FILE_COUNT, TGSI_INTERPOLATE_PERSPECTIVE, and tgsi_declaration::UsageMask.
00139 { 00140 struct tgsi_declaration declaration; 00141 00142 assert(file < TGSI_FILE_COUNT); 00143 assert( interpolate <= TGSI_INTERPOLATE_PERSPECTIVE ); 00144 00145 declaration = tgsi_default_declaration(); 00146 declaration.File = file; 00147 declaration.UsageMask = usage_mask; 00148 declaration.Interpolate = interpolate; 00149 declaration.Semantic = semantic; 00150 declaration.Centroid = centroid; 00151 declaration.Invariant = invariant; 00152 00153 header_bodysize_grow( header ); 00154 00155 return declaration; 00156 }
struct tgsi_declaration_range tgsi_build_declaration_range | ( | unsigned | first, | |
unsigned | last, | |||
struct tgsi_declaration * | declaration, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 248 of file tgsi_build.c.
References assert, declaration_grow(), tgsi_declaration_range::First, tgsi_declaration_range::Last, and tgsi_default_declaration_range().
00253 { 00254 struct tgsi_declaration_range declaration_range; 00255 00256 assert( last >= first ); 00257 assert( last <= 0xFFFF ); 00258 00259 declaration_range = tgsi_default_declaration_range(); 00260 declaration_range.First = first; 00261 declaration_range.Last = last; 00262 00263 declaration_grow( declaration, header ); 00264 00265 return declaration_range; 00266 }
struct tgsi_declaration_semantic tgsi_build_declaration_semantic | ( | unsigned | semantic_name, | |
unsigned | semantic_index, | |||
struct tgsi_declaration * | declaration, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 281 of file tgsi_build.c.
References assert, declaration_grow(), tgsi_declaration_semantic::SemanticIndex, tgsi_declaration_semantic::SemanticName, tgsi_default_declaration_semantic(), and TGSI_SEMANTIC_COUNT.
00286 { 00287 struct tgsi_declaration_semantic ds; 00288 00289 assert( semantic_name <= TGSI_SEMANTIC_COUNT ); 00290 assert( semantic_index <= 0xFFFF ); 00291 00292 ds = tgsi_default_declaration_semantic(); 00293 ds.SemanticName = semantic_name; 00294 ds.SemanticIndex = semantic_index; 00295 00296 declaration_grow( declaration, header ); 00297 00298 return ds; 00299 }
struct tgsi_dimension tgsi_build_dimension | ( | unsigned | indirect, | |
unsigned | index, | |||
struct tgsi_instruction * | instruction, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 1156 of file tgsi_build.c.
References instruction_grow(), and tgsi_default_dimension().
01161 { 01162 struct tgsi_dimension dimension; 01163 01164 dimension = tgsi_default_dimension(); 01165 dimension.Indirect = indirect; 01166 dimension.Index = index; 01167 01168 instruction_grow( instruction, header ); 01169 01170 return dimension; 01171 }
struct tgsi_dst_register tgsi_build_dst_register | ( | unsigned | file, | |
unsigned | mask, | |||
int | index, | |||
struct tgsi_instruction * | instruction, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 1190 of file tgsi_build.c.
References assert, tgsi_dst_register::File, tgsi_dst_register::Index, instruction_grow(), tgsi_default_dst_register(), TGSI_FILE_COUNT, TGSI_WRITEMASK_XYZW, and tgsi_dst_register::WriteMask.
01196 { 01197 struct tgsi_dst_register dst_register; 01198 01199 assert(file < TGSI_FILE_COUNT); 01200 assert( mask <= TGSI_WRITEMASK_XYZW ); 01201 assert( index >= -32768 && index <= 32767 ); 01202 01203 dst_register = tgsi_default_dst_register(); 01204 dst_register.File = file; 01205 dst_register.WriteMask = mask; 01206 dst_register.Index = index; 01207 01208 instruction_grow( instruction, header ); 01209 01210 return dst_register; 01211 }
struct tgsi_dst_register_ext_concode tgsi_build_dst_register_ext_concode | ( | unsigned | cc, | |
unsigned | swizzle_x, | |||
unsigned | swizzle_y, | |||
unsigned | swizzle_z, | |||
unsigned | swizzle_w, | |||
int | index, | |||
struct tgsi_token * | prev_token, | |||
struct tgsi_instruction * | instruction, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 1256 of file tgsi_build.c.
References assert, tgsi_dst_register_ext_concode::CondMask, tgsi_dst_register_ext_concode::CondSrcIndex, tgsi_dst_register_ext_concode::CondSwizzleW, tgsi_dst_register_ext_concode::CondSwizzleX, tgsi_dst_register_ext_concode::CondSwizzleY, tgsi_dst_register_ext_concode::CondSwizzleZ, tgsi_dst_register_ext_concode::Extended, instruction_grow(), TGSI_CC_FL, tgsi_default_dst_register_ext_concode(), and TGSI_SWIZZLE_W.
01266 { 01267 struct tgsi_dst_register_ext_concode dst_register_ext_concode; 01268 01269 assert( cc <= TGSI_CC_FL ); 01270 assert( swizzle_x <= TGSI_SWIZZLE_W ); 01271 assert( swizzle_y <= TGSI_SWIZZLE_W ); 01272 assert( swizzle_z <= TGSI_SWIZZLE_W ); 01273 assert( swizzle_w <= TGSI_SWIZZLE_W ); 01274 assert( index >= -32768 && index <= 32767 ); 01275 01276 dst_register_ext_concode = tgsi_default_dst_register_ext_concode(); 01277 dst_register_ext_concode.CondMask = cc; 01278 dst_register_ext_concode.CondSwizzleX = swizzle_x; 01279 dst_register_ext_concode.CondSwizzleY = swizzle_y; 01280 dst_register_ext_concode.CondSwizzleZ = swizzle_z; 01281 dst_register_ext_concode.CondSwizzleW = swizzle_w; 01282 dst_register_ext_concode.CondSrcIndex = index; 01283 01284 prev_token->Extended = 1; 01285 instruction_grow( instruction, header ); 01286 01287 return dst_register_ext_concode; 01288 }
struct tgsi_dst_register_ext_modulate tgsi_build_dst_register_ext_modulate | ( | unsigned | modulate, | |
struct tgsi_token * | prev_token, | |||
struct tgsi_instruction * | instruction, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 1314 of file tgsi_build.c.
References assert, tgsi_dst_register_ext_modulate::Extended, instruction_grow(), tgsi_dst_register_ext_modulate::Modulate, tgsi_default_dst_register_ext_modulate(), and TGSI_MODULATE_EIGHTH.
01319 { 01320 struct tgsi_dst_register_ext_modulate dst_register_ext_modulate; 01321 01322 assert( modulate <= TGSI_MODULATE_EIGHTH ); 01323 01324 dst_register_ext_modulate = tgsi_default_dst_register_ext_modulate(); 01325 dst_register_ext_modulate.Modulate = modulate; 01326 01327 prev_token->Extended = 1; 01328 instruction_grow( instruction, header ); 01329 01330 return dst_register_ext_modulate; 01331 }
unsigned tgsi_build_full_declaration | ( | const struct tgsi_full_declaration * | full_decl, | |
struct tgsi_token * | tokens, | |||
struct tgsi_header * | header, | |||
unsigned | maxsize | |||
) |
Definition at line 183 of file tgsi_build.c.
References tgsi_declaration::Centroid, tgsi_full_declaration::Declaration, tgsi_full_declaration::DeclarationRange, tgsi_declaration::File, tgsi_declaration_range::First, tgsi_declaration::Interpolate, tgsi_declaration::Invariant, tgsi_declaration_range::Last, tgsi_full_declaration::Semantic, tgsi_declaration::Semantic, tgsi_declaration_semantic::SemanticIndex, tgsi_declaration_semantic::SemanticName, tgsi_build_declaration(), tgsi_build_declaration_range(), tgsi_build_declaration_semantic(), and tgsi_declaration::UsageMask.
00188 { 00189 unsigned size = 0; 00190 struct tgsi_declaration *declaration; 00191 struct tgsi_declaration_range *dr; 00192 00193 if( maxsize <= size ) 00194 return 0; 00195 declaration = (struct tgsi_declaration *) &tokens[size]; 00196 size++; 00197 00198 *declaration = tgsi_build_declaration( 00199 full_decl->Declaration.File, 00200 full_decl->Declaration.UsageMask, 00201 full_decl->Declaration.Interpolate, 00202 full_decl->Declaration.Semantic, 00203 full_decl->Declaration.Centroid, 00204 full_decl->Declaration.Invariant, 00205 header ); 00206 00207 if (maxsize <= size) 00208 return 0; 00209 dr = (struct tgsi_declaration_range *) &tokens[size]; 00210 size++; 00211 00212 *dr = tgsi_build_declaration_range( 00213 full_decl->DeclarationRange.First, 00214 full_decl->DeclarationRange.Last, 00215 declaration, 00216 header ); 00217 00218 if( full_decl->Declaration.Semantic ) { 00219 struct tgsi_declaration_semantic *ds; 00220 00221 if( maxsize <= size ) 00222 return 0; 00223 ds = (struct tgsi_declaration_semantic *) &tokens[size]; 00224 size++; 00225 00226 *ds = tgsi_build_declaration_semantic( 00227 full_decl->Semantic.SemanticName, 00228 full_decl->Semantic.SemanticIndex, 00229 declaration, 00230 header ); 00231 } 00232 00233 return size; 00234 }
unsigned tgsi_build_full_immediate | ( | const struct tgsi_full_immediate * | full_imm, | |
struct tgsi_token * | tokens, | |||
struct tgsi_header * | header, | |||
unsigned | maxsize | |||
) |
Definition at line 371 of file tgsi_build.c.
References tgsi_immediate_float32::Float, tgsi_full_immediate::Immediate, tgsi_full_immediate::ImmediateFloat32, tgsi_immediate::Size, tgsi_build_immediate(), tgsi_build_immediate_float32(), and tgsi_full_immediate::u.
00376 { 00377 unsigned size = 0, i; 00378 struct tgsi_immediate *immediate; 00379 00380 if( maxsize <= size ) 00381 return 0; 00382 immediate = (struct tgsi_immediate *) &tokens[size]; 00383 size++; 00384 00385 *immediate = tgsi_build_immediate( header ); 00386 00387 for( i = 0; i < full_imm->Immediate.Size - 1; i++ ) { 00388 struct tgsi_immediate_float32 *if32; 00389 00390 if( maxsize <= size ) 00391 return 0; 00392 if32 = (struct tgsi_immediate_float32 *) &tokens[size]; 00393 size++; 00394 00395 *if32 = tgsi_build_immediate_float32( 00396 full_imm->u.ImmediateFloat32[i].Float, 00397 immediate, 00398 header ); 00399 } 00400 00401 return size; 00402 }
unsigned tgsi_build_full_instruction | ( | const struct tgsi_full_instruction * | full_inst, | |
struct tgsi_token * | tokens, | |||
struct tgsi_header * | header, | |||
unsigned | maxsize | |||
) |
Definition at line 484 of file tgsi_build.c.
References tgsi_src_register_ext_mod::Absolute, assert, 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_dimension::Dimension, tgsi_src_register::Dimension, tgsi_full_dst_register::DstRegister, tgsi_full_dst_register::DstRegisterExtConcode, tgsi_full_dst_register::DstRegisterExtModulate, tgsi_src_register_ext_swz::ExtSwizzleW, tgsi_src_register_ext_swz::ExtSwizzleX, tgsi_src_register_ext_swz::ExtSwizzleY, tgsi_src_register_ext_swz::ExtSwizzleZ, FALSE, tgsi_src_register::File, tgsi_dst_register::File, tgsi_full_instruction::FullDstRegisters, tgsi_full_instruction::FullSrcRegisters, tgsi_dimension::Index, tgsi_src_register::Index, tgsi_dst_register::Index, tgsi_dimension::Indirect, tgsi_src_register::Indirect, tgsi_full_instruction::Instruction, tgsi_full_instruction::InstructionExtLabel, tgsi_full_instruction::InstructionExtNv, tgsi_full_instruction::InstructionExtTexture, tgsi_instruction_ext_label::Label, 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_instruction_ext_nv::Precision, tgsi_instruction::Saturate, tgsi_src_register_ext_mod::Scale2X, tgsi_full_src_register::SrcRegister, tgsi_full_src_register::SrcRegisterDim, tgsi_full_src_register::SrcRegisterDimInd, tgsi_full_src_register::SrcRegisterExtMod, tgsi_full_src_register::SrcRegisterExtSwz, tgsi_full_src_register::SrcRegisterInd, tgsi_src_register::SwizzleW, tgsi_src_register::SwizzleX, tgsi_src_register::SwizzleY, tgsi_src_register::SwizzleZ, tgsi_instruction_ext_texture::Texture, tgsi_build_dimension(), tgsi_build_dst_register(), tgsi_build_dst_register_ext_concode(), tgsi_build_dst_register_ext_modulate(), tgsi_build_instruction(), tgsi_build_instruction_ext_label(), tgsi_build_instruction_ext_nv(), tgsi_build_instruction_ext_texture(), tgsi_build_src_register(), tgsi_build_src_register_ext_mod(), tgsi_build_src_register_ext_swz(), 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_default_dst_register_ext_concode(), tgsi_default_dst_register_ext_modulate(), tgsi_default_instruction_ext_label(), tgsi_default_instruction_ext_nv(), tgsi_default_instruction_ext_texture(), tgsi_default_src_register_ext_mod(), tgsi_default_src_register_ext_swz(), TGSI_SWIZZLE_W, TGSI_SWIZZLE_X, TGSI_SWIZZLE_Y, TGSI_SWIZZLE_Z, and tgsi_dst_register::WriteMask.
00489 { 00490 unsigned size = 0; 00491 unsigned i; 00492 struct tgsi_instruction *instruction; 00493 struct tgsi_token *prev_token; 00494 00495 if( maxsize <= size ) 00496 return 0; 00497 instruction = (struct tgsi_instruction *) &tokens[size]; 00498 size++; 00499 00500 *instruction = tgsi_build_instruction( 00501 full_inst->Instruction.Opcode, 00502 full_inst->Instruction.Saturate, 00503 full_inst->Instruction.NumDstRegs, 00504 full_inst->Instruction.NumSrcRegs, 00505 header ); 00506 prev_token = (struct tgsi_token *) instruction; 00507 00508 if( tgsi_compare_instruction_ext_nv( 00509 full_inst->InstructionExtNv, 00510 tgsi_default_instruction_ext_nv() ) ) { 00511 struct tgsi_instruction_ext_nv *instruction_ext_nv; 00512 00513 if( maxsize <= size ) 00514 return 0; 00515 instruction_ext_nv = 00516 (struct tgsi_instruction_ext_nv *) &tokens[size]; 00517 size++; 00518 00519 *instruction_ext_nv = tgsi_build_instruction_ext_nv( 00520 full_inst->InstructionExtNv.Precision, 00521 full_inst->InstructionExtNv.CondDstIndex, 00522 full_inst->InstructionExtNv.CondFlowIndex, 00523 full_inst->InstructionExtNv.CondMask, 00524 full_inst->InstructionExtNv.CondSwizzleX, 00525 full_inst->InstructionExtNv.CondSwizzleY, 00526 full_inst->InstructionExtNv.CondSwizzleZ, 00527 full_inst->InstructionExtNv.CondSwizzleW, 00528 full_inst->InstructionExtNv.CondDstUpdate, 00529 full_inst->InstructionExtNv.CondFlowEnable, 00530 prev_token, 00531 instruction, 00532 header ); 00533 prev_token = (struct tgsi_token *) instruction_ext_nv; 00534 } 00535 00536 if( tgsi_compare_instruction_ext_label( 00537 full_inst->InstructionExtLabel, 00538 tgsi_default_instruction_ext_label() ) ) { 00539 struct tgsi_instruction_ext_label *instruction_ext_label; 00540 00541 if( maxsize <= size ) 00542 return 0; 00543 instruction_ext_label = 00544 (struct tgsi_instruction_ext_label *) &tokens[size]; 00545 size++; 00546 00547 *instruction_ext_label = tgsi_build_instruction_ext_label( 00548 full_inst->InstructionExtLabel.Label, 00549 prev_token, 00550 instruction, 00551 header ); 00552 prev_token = (struct tgsi_token *) instruction_ext_label; 00553 } 00554 00555 if( tgsi_compare_instruction_ext_texture( 00556 full_inst->InstructionExtTexture, 00557 tgsi_default_instruction_ext_texture() ) ) { 00558 struct tgsi_instruction_ext_texture *instruction_ext_texture; 00559 00560 if( maxsize <= size ) 00561 return 0; 00562 instruction_ext_texture = 00563 (struct tgsi_instruction_ext_texture *) &tokens[size]; 00564 size++; 00565 00566 *instruction_ext_texture = tgsi_build_instruction_ext_texture( 00567 full_inst->InstructionExtTexture.Texture, 00568 prev_token, 00569 instruction, 00570 header ); 00571 prev_token = (struct tgsi_token *) instruction_ext_texture; 00572 } 00573 00574 for( i = 0; i < full_inst->Instruction.NumDstRegs; i++ ) { 00575 const struct tgsi_full_dst_register *reg = &full_inst->FullDstRegisters[i]; 00576 struct tgsi_dst_register *dst_register; 00577 struct tgsi_token *prev_token; 00578 00579 if( maxsize <= size ) 00580 return 0; 00581 dst_register = (struct tgsi_dst_register *) &tokens[size]; 00582 size++; 00583 00584 *dst_register = tgsi_build_dst_register( 00585 reg->DstRegister.File, 00586 reg->DstRegister.WriteMask, 00587 reg->DstRegister.Index, 00588 instruction, 00589 header ); 00590 prev_token = (struct tgsi_token *) dst_register; 00591 00592 if( tgsi_compare_dst_register_ext_concode( 00593 reg->DstRegisterExtConcode, 00594 tgsi_default_dst_register_ext_concode() ) ) { 00595 struct tgsi_dst_register_ext_concode *dst_register_ext_concode; 00596 00597 if( maxsize <= size ) 00598 return 0; 00599 dst_register_ext_concode = 00600 (struct tgsi_dst_register_ext_concode *) &tokens[size]; 00601 size++; 00602 00603 *dst_register_ext_concode = tgsi_build_dst_register_ext_concode( 00604 reg->DstRegisterExtConcode.CondMask, 00605 reg->DstRegisterExtConcode.CondSwizzleX, 00606 reg->DstRegisterExtConcode.CondSwizzleY, 00607 reg->DstRegisterExtConcode.CondSwizzleZ, 00608 reg->DstRegisterExtConcode.CondSwizzleW, 00609 reg->DstRegisterExtConcode.CondSrcIndex, 00610 prev_token, 00611 instruction, 00612 header ); 00613 prev_token = (struct tgsi_token *) dst_register_ext_concode; 00614 } 00615 00616 if( tgsi_compare_dst_register_ext_modulate( 00617 reg->DstRegisterExtModulate, 00618 tgsi_default_dst_register_ext_modulate() ) ) { 00619 struct tgsi_dst_register_ext_modulate *dst_register_ext_modulate; 00620 00621 if( maxsize <= size ) 00622 return 0; 00623 dst_register_ext_modulate = 00624 (struct tgsi_dst_register_ext_modulate *) &tokens[size]; 00625 size++; 00626 00627 *dst_register_ext_modulate = tgsi_build_dst_register_ext_modulate( 00628 reg->DstRegisterExtModulate.Modulate, 00629 prev_token, 00630 instruction, 00631 header ); 00632 prev_token = (struct tgsi_token *) dst_register_ext_modulate; 00633 } 00634 } 00635 00636 for( i = 0; i < full_inst->Instruction.NumSrcRegs; i++ ) { 00637 const struct tgsi_full_src_register *reg = &full_inst->FullSrcRegisters[i]; 00638 struct tgsi_src_register *src_register; 00639 struct tgsi_token *prev_token; 00640 00641 if( maxsize <= size ) 00642 return 0; 00643 src_register = (struct tgsi_src_register *) &tokens[size]; 00644 size++; 00645 00646 *src_register = tgsi_build_src_register( 00647 reg->SrcRegister.File, 00648 reg->SrcRegister.SwizzleX, 00649 reg->SrcRegister.SwizzleY, 00650 reg->SrcRegister.SwizzleZ, 00651 reg->SrcRegister.SwizzleW, 00652 reg->SrcRegister.Negate, 00653 reg->SrcRegister.Indirect, 00654 reg->SrcRegister.Dimension, 00655 reg->SrcRegister.Index, 00656 instruction, 00657 header ); 00658 prev_token = (struct tgsi_token *) src_register; 00659 00660 if( tgsi_compare_src_register_ext_swz( 00661 reg->SrcRegisterExtSwz, 00662 tgsi_default_src_register_ext_swz() ) ) { 00663 struct tgsi_src_register_ext_swz *src_register_ext_swz; 00664 00665 /* Use of the extended swizzle requires the simple swizzle to be identity. 00666 */ 00667 assert( reg->SrcRegister.SwizzleX == TGSI_SWIZZLE_X ); 00668 assert( reg->SrcRegister.SwizzleY == TGSI_SWIZZLE_Y ); 00669 assert( reg->SrcRegister.SwizzleZ == TGSI_SWIZZLE_Z ); 00670 assert( reg->SrcRegister.SwizzleW == TGSI_SWIZZLE_W ); 00671 assert( reg->SrcRegister.Negate == FALSE ); 00672 00673 if( maxsize <= size ) 00674 return 0; 00675 src_register_ext_swz = 00676 (struct tgsi_src_register_ext_swz *) &tokens[size]; 00677 size++; 00678 00679 *src_register_ext_swz = tgsi_build_src_register_ext_swz( 00680 reg->SrcRegisterExtSwz.ExtSwizzleX, 00681 reg->SrcRegisterExtSwz.ExtSwizzleY, 00682 reg->SrcRegisterExtSwz.ExtSwizzleZ, 00683 reg->SrcRegisterExtSwz.ExtSwizzleW, 00684 reg->SrcRegisterExtSwz.NegateX, 00685 reg->SrcRegisterExtSwz.NegateY, 00686 reg->SrcRegisterExtSwz.NegateZ, 00687 reg->SrcRegisterExtSwz.NegateW, 00688 prev_token, 00689 instruction, 00690 header ); 00691 prev_token = (struct tgsi_token *) src_register_ext_swz; 00692 } 00693 00694 if( tgsi_compare_src_register_ext_mod( 00695 reg->SrcRegisterExtMod, 00696 tgsi_default_src_register_ext_mod() ) ) { 00697 struct tgsi_src_register_ext_mod *src_register_ext_mod; 00698 00699 if( maxsize <= size ) 00700 return 0; 00701 src_register_ext_mod = 00702 (struct tgsi_src_register_ext_mod *) &tokens[size]; 00703 size++; 00704 00705 *src_register_ext_mod = tgsi_build_src_register_ext_mod( 00706 reg->SrcRegisterExtMod.Complement, 00707 reg->SrcRegisterExtMod.Bias, 00708 reg->SrcRegisterExtMod.Scale2X, 00709 reg->SrcRegisterExtMod.Absolute, 00710 reg->SrcRegisterExtMod.Negate, 00711 prev_token, 00712 instruction, 00713 header ); 00714 prev_token = (struct tgsi_token *) src_register_ext_mod; 00715 } 00716 00717 if( reg->SrcRegister.Indirect ) { 00718 struct tgsi_src_register *ind; 00719 00720 if( maxsize <= size ) 00721 return 0; 00722 ind = (struct tgsi_src_register *) &tokens[size]; 00723 size++; 00724 00725 *ind = tgsi_build_src_register( 00726 reg->SrcRegisterInd.File, 00727 reg->SrcRegisterInd.SwizzleX, 00728 reg->SrcRegisterInd.SwizzleY, 00729 reg->SrcRegisterInd.SwizzleZ, 00730 reg->SrcRegisterInd.SwizzleW, 00731 reg->SrcRegisterInd.Negate, 00732 reg->SrcRegisterInd.Indirect, 00733 reg->SrcRegisterInd.Dimension, 00734 reg->SrcRegisterInd.Index, 00735 instruction, 00736 header ); 00737 } 00738 00739 if( reg->SrcRegister.Dimension ) { 00740 struct tgsi_dimension *dim; 00741 00742 assert( !reg->SrcRegisterDim.Dimension ); 00743 00744 if( maxsize <= size ) 00745 return 0; 00746 dim = (struct tgsi_dimension *) &tokens[size]; 00747 size++; 00748 00749 *dim = tgsi_build_dimension( 00750 reg->SrcRegisterDim.Indirect, 00751 reg->SrcRegisterDim.Index, 00752 instruction, 00753 header ); 00754 00755 if( reg->SrcRegisterDim.Indirect ) { 00756 struct tgsi_src_register *ind; 00757 00758 if( maxsize <= size ) 00759 return 0; 00760 ind = (struct tgsi_src_register *) &tokens[size]; 00761 size++; 00762 00763 *ind = tgsi_build_src_register( 00764 reg->SrcRegisterDimInd.File, 00765 reg->SrcRegisterDimInd.SwizzleX, 00766 reg->SrcRegisterDimInd.SwizzleY, 00767 reg->SrcRegisterDimInd.SwizzleZ, 00768 reg->SrcRegisterDimInd.SwizzleW, 00769 reg->SrcRegisterDimInd.Negate, 00770 reg->SrcRegisterDimInd.Indirect, 00771 reg->SrcRegisterDimInd.Dimension, 00772 reg->SrcRegisterDimInd.Index, 00773 instruction, 00774 header ); 00775 } 00776 } 00777 } 00778 00779 return size; 00780 }
struct tgsi_header tgsi_build_header | ( | void | ) | [read] |
Definition at line 54 of file tgsi_build.c.
References tgsi_header::BodySize, and tgsi_header::HeaderSize.
00055 { 00056 struct tgsi_header header; 00057 00058 header.HeaderSize = 1; 00059 header.BodySize = 0; 00060 00061 return header; 00062 }
struct tgsi_immediate tgsi_build_immediate | ( | struct tgsi_header * | header | ) | [read] |
Definition at line 320 of file tgsi_build.c.
References header_bodysize_grow(), and tgsi_default_immediate().
00322 { 00323 struct tgsi_immediate immediate; 00324 00325 immediate = tgsi_default_immediate(); 00326 00327 header_bodysize_grow( header ); 00328 00329 return immediate; 00330 }
struct tgsi_immediate_float32 tgsi_build_immediate_float32 | ( | float | value, | |
struct tgsi_immediate * | immediate, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 356 of file tgsi_build.c.
References tgsi_immediate_float32::Float, and immediate_grow().
00360 { 00361 struct tgsi_immediate_float32 immediate_float32; 00362 00363 immediate_float32.Float = value; 00364 00365 immediate_grow( immediate, header ); 00366 00367 return immediate_float32; 00368 }
struct tgsi_instruction tgsi_build_instruction | ( | unsigned | opcode, | |
unsigned | saturate, | |||
unsigned | num_dst_regs, | |||
unsigned | num_src_regs, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 426 of file tgsi_build.c.
References assert, header_bodysize_grow(), tgsi_instruction::NumDstRegs, tgsi_instruction::NumSrcRegs, tgsi_instruction::Opcode, tgsi_instruction::Saturate, tgsi_default_instruction(), TGSI_OPCODE_LAST, and TGSI_SAT_MINUS_PLUS_ONE.
00432 { 00433 struct tgsi_instruction instruction; 00434 00435 assert (opcode <= TGSI_OPCODE_LAST); 00436 assert (saturate <= TGSI_SAT_MINUS_PLUS_ONE); 00437 assert (num_dst_regs <= 3); 00438 assert (num_src_regs <= 15); 00439 00440 instruction = tgsi_default_instruction(); 00441 instruction.Opcode = opcode; 00442 instruction.Saturate = saturate; 00443 instruction.NumDstRegs = num_dst_regs; 00444 instruction.NumSrcRegs = num_src_regs; 00445 00446 header_bodysize_grow( header ); 00447 00448 return instruction; 00449 }
struct tgsi_instruction_ext_label tgsi_build_instruction_ext_label | ( | unsigned | label, | |
struct tgsi_token * | prev_token, | |||
struct tgsi_instruction * | instruction, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 879 of file tgsi_build.c.
References tgsi_instruction_ext_label::Extended, instruction_grow(), and tgsi_default_instruction_ext_label().
00884 { 00885 struct tgsi_instruction_ext_label instruction_ext_label; 00886 00887 instruction_ext_label = tgsi_default_instruction_ext_label(); 00888 instruction_ext_label.Label = label; 00889 00890 prev_token->Extended = 1; 00891 instruction_grow( instruction, header ); 00892 00893 return instruction_ext_label; 00894 }
struct tgsi_instruction_ext_nv tgsi_build_instruction_ext_nv | ( | unsigned | precision, | |
unsigned | cond_dst_index, | |||
unsigned | cond_flow_index, | |||
unsigned | cond_mask, | |||
unsigned | cond_swizzle_x, | |||
unsigned | cond_swizzle_y, | |||
unsigned | cond_swizzle_z, | |||
unsigned | cond_swizzle_w, | |||
unsigned | cond_dst_update, | |||
unsigned | cond_flow_enable, | |||
struct tgsi_token * | prev_token, | |||
struct tgsi_instruction * | instruction, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 820 of file tgsi_build.c.
References tgsi_instruction_ext_nv::Extended, instruction_grow(), and tgsi_default_instruction_ext_nv().
00834 { 00835 struct tgsi_instruction_ext_nv instruction_ext_nv; 00836 00837 instruction_ext_nv = tgsi_default_instruction_ext_nv(); 00838 instruction_ext_nv.Precision = precision; 00839 instruction_ext_nv.CondDstIndex = cond_dst_index; 00840 instruction_ext_nv.CondFlowIndex = cond_flow_index; 00841 instruction_ext_nv.CondMask = cond_mask; 00842 instruction_ext_nv.CondSwizzleX = cond_swizzle_x; 00843 instruction_ext_nv.CondSwizzleY = cond_swizzle_y; 00844 instruction_ext_nv.CondSwizzleZ = cond_swizzle_z; 00845 instruction_ext_nv.CondSwizzleW = cond_swizzle_w; 00846 instruction_ext_nv.CondDstUpdate = cond_dst_update; 00847 instruction_ext_nv.CondFlowEnable = cond_flow_enable; 00848 00849 prev_token->Extended = 1; 00850 instruction_grow( instruction, header ); 00851 00852 return instruction_ext_nv; 00853 }
struct tgsi_instruction_ext_texture tgsi_build_instruction_ext_texture | ( | unsigned | texture, | |
struct tgsi_token * | prev_token, | |||
struct tgsi_instruction * | instruction, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 920 of file tgsi_build.c.
References tgsi_instruction_ext_texture::Extended, instruction_grow(), and tgsi_default_instruction_ext_texture().
00925 { 00926 struct tgsi_instruction_ext_texture instruction_ext_texture; 00927 00928 instruction_ext_texture = tgsi_default_instruction_ext_texture(); 00929 instruction_ext_texture.Texture = texture; 00930 00931 prev_token->Extended = 1; 00932 instruction_grow( instruction, header ); 00933 00934 return instruction_ext_texture; 00935 }
struct tgsi_processor tgsi_build_processor | ( | unsigned | type, | |
struct tgsi_header * | header | |||
) | [read] |
Definition at line 93 of file tgsi_build.c.
References header_headersize_grow(), and tgsi_default_processor().
00096 { 00097 struct tgsi_processor processor; 00098 00099 processor = tgsi_default_processor(); 00100 processor.Processor = type; 00101 00102 header_headersize_grow( header ); 00103 00104 return processor; 00105 }
struct tgsi_src_register tgsi_build_src_register | ( | unsigned | file, | |
unsigned | swizzle_x, | |||
unsigned | swizzle_y, | |||
unsigned | swizzle_z, | |||
unsigned | swizzle_w, | |||
unsigned | negate, | |||
unsigned | indirect, | |||
unsigned | dimension, | |||
int | index, | |||
struct tgsi_instruction * | instruction, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 957 of file tgsi_build.c.
References assert, tgsi_src_register::Dimension, tgsi_src_register::File, tgsi_src_register::Index, tgsi_src_register::Indirect, instruction_grow(), tgsi_src_register::Negate, negate(), tgsi_src_register::SwizzleW, tgsi_src_register::SwizzleX, tgsi_src_register::SwizzleY, tgsi_src_register::SwizzleZ, tgsi_default_src_register(), TGSI_FILE_COUNT, and TGSI_SWIZZLE_W.
00969 { 00970 struct tgsi_src_register src_register; 00971 00972 assert(file < TGSI_FILE_COUNT); 00973 assert( swizzle_x <= TGSI_SWIZZLE_W ); 00974 assert( swizzle_y <= TGSI_SWIZZLE_W ); 00975 assert( swizzle_z <= TGSI_SWIZZLE_W ); 00976 assert( swizzle_w <= TGSI_SWIZZLE_W ); 00977 assert( negate <= 1 ); 00978 assert( index >= -0x8000 && index <= 0x7FFF ); 00979 00980 src_register = tgsi_default_src_register(); 00981 src_register.File = file; 00982 src_register.SwizzleX = swizzle_x; 00983 src_register.SwizzleY = swizzle_y; 00984 src_register.SwizzleZ = swizzle_z; 00985 src_register.SwizzleW = swizzle_w; 00986 src_register.Negate = negate; 00987 src_register.Indirect = indirect; 00988 src_register.Dimension = dimension; 00989 src_register.Index = index; 00990 00991 instruction_grow( instruction, header ); 00992 00993 return src_register; 00994 }
struct tgsi_src_register_ext_mod tgsi_build_src_register_ext_mod | ( | unsigned | complement, | |
unsigned | bias, | |||
unsigned | scale_2x, | |||
unsigned | absolute, | |||
unsigned | negate, | |||
struct tgsi_token * | prev_token, | |||
struct tgsi_instruction * | instruction, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 1110 of file tgsi_build.c.
References tgsi_src_register_ext_mod::Absolute, assert, tgsi_src_register_ext_mod::Bias, tgsi_src_register_ext_mod::Complement, tgsi_src_register_ext_mod::Extended, instruction_grow(), tgsi_src_register_ext_mod::Negate, negate(), tgsi_src_register_ext_mod::Scale2X, and tgsi_default_src_register_ext_mod().
01119 { 01120 struct tgsi_src_register_ext_mod src_register_ext_mod; 01121 01122 assert( complement <= 1 ); 01123 assert( bias <= 1 ); 01124 assert( scale_2x <= 1 ); 01125 assert( absolute <= 1 ); 01126 assert( negate <= 1 ); 01127 01128 src_register_ext_mod = tgsi_default_src_register_ext_mod(); 01129 src_register_ext_mod.Complement = complement; 01130 src_register_ext_mod.Bias = bias; 01131 src_register_ext_mod.Scale2X = scale_2x; 01132 src_register_ext_mod.Absolute = absolute; 01133 src_register_ext_mod.Negate = negate; 01134 01135 prev_token->Extended = 1; 01136 instruction_grow( instruction, header ); 01137 01138 return src_register_ext_mod; 01139 }
struct tgsi_src_register_ext_swz tgsi_build_src_register_ext_swz | ( | unsigned | ext_swizzle_x, | |
unsigned | ext_swizzle_y, | |||
unsigned | ext_swizzle_z, | |||
unsigned | ext_swizzle_w, | |||
unsigned | negate_x, | |||
unsigned | negate_y, | |||
unsigned | negate_z, | |||
unsigned | negate_w, | |||
struct tgsi_token * | prev_token, | |||
struct tgsi_instruction * | instruction, | |||
struct tgsi_header * | header | |||
) | [read] |
Definition at line 1042 of file tgsi_build.c.
References assert, tgsi_src_register_ext_swz::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, instruction_grow(), 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_default_src_register_ext_swz(), and TGSI_EXTSWIZZLE_ONE.
01054 { 01055 struct tgsi_src_register_ext_swz src_register_ext_swz; 01056 01057 assert( ext_swizzle_x <= TGSI_EXTSWIZZLE_ONE ); 01058 assert( ext_swizzle_y <= TGSI_EXTSWIZZLE_ONE ); 01059 assert( ext_swizzle_z <= TGSI_EXTSWIZZLE_ONE ); 01060 assert( ext_swizzle_w <= TGSI_EXTSWIZZLE_ONE ); 01061 assert( negate_x <= 1 ); 01062 assert( negate_y <= 1 ); 01063 assert( negate_z <= 1 ); 01064 assert( negate_w <= 1 ); 01065 01066 src_register_ext_swz = tgsi_default_src_register_ext_swz(); 01067 src_register_ext_swz.ExtSwizzleX = ext_swizzle_x; 01068 src_register_ext_swz.ExtSwizzleY = ext_swizzle_y; 01069 src_register_ext_swz.ExtSwizzleZ = ext_swizzle_z; 01070 src_register_ext_swz.ExtSwizzleW = ext_swizzle_w; 01071 src_register_ext_swz.NegateX = negate_x; 01072 src_register_ext_swz.NegateY = negate_y; 01073 src_register_ext_swz.NegateZ = negate_z; 01074 src_register_ext_swz.NegateW = negate_w; 01075 01076 prev_token->Extended = 1; 01077 instruction_grow( instruction, header ); 01078 01079 return src_register_ext_swz; 01080 }
struct tgsi_version tgsi_build_version | ( | void | ) | [read] |
Definition at line 38 of file tgsi_build.c.
References tgsi_version::MajorVersion, tgsi_version::MinorVersion, and tgsi_version::Padding.
00039 { 00040 struct tgsi_version version; 00041 00042 version.MajorVersion = 1; 00043 version.MinorVersion = 1; 00044 version.Padding = 0; 00045 00046 return version; 00047 }
unsigned tgsi_compare_dst_register_ext_concode | ( | struct tgsi_dst_register_ext_concode | a, | |
struct tgsi_dst_register_ext_concode | b | |||
) |
Definition at line 1246 of file tgsi_build.c.
References tgsi_dst_register_ext_concode::Extended, and tgsi_dst_register_ext_concode::Padding.
01249 { 01250 a.Padding = b.Padding = 0; 01251 a.Extended = b.Extended = 0; 01252 return ((union token_u32 *) &a)->u32 != ((union token_u32 *) &b)->u32; 01253 }
unsigned tgsi_compare_dst_register_ext_modulate | ( | struct tgsi_dst_register_ext_modulate | a, | |
struct tgsi_dst_register_ext_modulate | b | |||
) |
Definition at line 1304 of file tgsi_build.c.
References tgsi_dst_register_ext_modulate::Extended, and tgsi_dst_register_ext_modulate::Padding.
01307 { 01308 a.Padding = b.Padding = 0; 01309 a.Extended = b.Extended = 0; 01310 return ((union token_u32 *) &a)->u32 != ((union token_u32 *) &b)->u32; 01311 }
unsigned tgsi_compare_instruction_ext_label | ( | struct tgsi_instruction_ext_label | a, | |
struct tgsi_instruction_ext_label | b | |||
) |
Definition at line 869 of file tgsi_build.c.
References tgsi_instruction_ext_label::Extended, and tgsi_instruction_ext_label::Padding.
00872 { 00873 a.Padding = b.Padding = 0; 00874 a.Extended = b.Extended = 0; 00875 return ((union token_u32 *) &a)->u32 != ((union token_u32 *) &b)->u32; 00876 }
unsigned tgsi_compare_instruction_ext_nv | ( | struct tgsi_instruction_ext_nv | a, | |
struct tgsi_instruction_ext_nv | b | |||
) |
Definition at line 810 of file tgsi_build.c.
References tgsi_instruction_ext_nv::Extended, and tgsi_instruction_ext_nv::Padding.
00813 { 00814 a.Padding = b.Padding = 0; 00815 a.Extended = b.Extended = 0; 00816 return ((union token_u32 *) &a)->u32 != ((union token_u32 *) &b)->u32; 00817 }
unsigned tgsi_compare_instruction_ext_texture | ( | struct tgsi_instruction_ext_texture | a, | |
struct tgsi_instruction_ext_texture | b | |||
) |
Definition at line 910 of file tgsi_build.c.
References tgsi_instruction_ext_texture::Extended, and tgsi_instruction_ext_texture::Padding.
00913 { 00914 a.Padding = b.Padding = 0; 00915 a.Extended = b.Extended = 0; 00916 return ((union token_u32 *) &a)->u32 != ((union token_u32 *) &b)->u32; 00917 }
unsigned tgsi_compare_src_register_ext_mod | ( | struct tgsi_src_register_ext_mod | a, | |
struct tgsi_src_register_ext_mod | b | |||
) |
Definition at line 1100 of file tgsi_build.c.
References tgsi_src_register_ext_mod::Extended, and tgsi_src_register_ext_mod::Padding.
01103 { 01104 a.Padding = b.Padding = 0; 01105 a.Extended = b.Extended = 0; 01106 return ((union token_u32 *) &a)->u32 != ((union token_u32 *) &b)->u32; 01107 }
unsigned tgsi_compare_src_register_ext_swz | ( | struct tgsi_src_register_ext_swz | a, | |
struct tgsi_src_register_ext_swz | b | |||
) |
Definition at line 1032 of file tgsi_build.c.
References tgsi_src_register_ext_swz::Extended, and tgsi_src_register_ext_swz::Padding.
01035 { 01036 a.Padding = b.Padding = 0; 01037 a.Extended = b.Extended = 0; 01038 return ((union token_u32 *) &a)->u32 != ((union token_u32 *) &b)->u32; 01039 }
struct tgsi_declaration tgsi_default_declaration | ( | void | ) | [read] |
Definition at line 112 of file tgsi_build.c.
References tgsi_declaration::Centroid, tgsi_declaration::Extended, tgsi_declaration::File, tgsi_declaration::Interpolate, tgsi_declaration::Invariant, tgsi_declaration::Padding, tgsi_declaration::Semantic, tgsi_declaration::Size, TGSI_FILE_NULL, TGSI_INTERPOLATE_CONSTANT, TGSI_TOKEN_TYPE_DECLARATION, TGSI_WRITEMASK_XYZW, tgsi_declaration::Type, and tgsi_declaration::UsageMask.
00113 { 00114 struct tgsi_declaration declaration; 00115 00116 declaration.Type = TGSI_TOKEN_TYPE_DECLARATION; 00117 declaration.Size = 1; 00118 declaration.File = TGSI_FILE_NULL; 00119 declaration.UsageMask = TGSI_WRITEMASK_XYZW; 00120 declaration.Interpolate = TGSI_INTERPOLATE_CONSTANT; 00121 declaration.Semantic = 0; 00122 declaration.Centroid = 0; 00123 declaration.Invariant = 0; 00124 declaration.Padding = 0; 00125 declaration.Extended = 0; 00126 00127 return declaration; 00128 }
struct tgsi_declaration_range tgsi_default_declaration_range | ( | void | ) | [read] |
Definition at line 237 of file tgsi_build.c.
References tgsi_declaration_range::First, and tgsi_declaration_range::Last.
00238 { 00239 struct tgsi_declaration_range dr; 00240 00241 dr.First = 0; 00242 dr.Last = 0; 00243 00244 return dr; 00245 }
struct tgsi_declaration_semantic tgsi_default_declaration_semantic | ( | void | ) | [read] |
Definition at line 269 of file tgsi_build.c.
References tgsi_declaration_semantic::Padding, tgsi_declaration_semantic::SemanticIndex, tgsi_declaration_semantic::SemanticName, and TGSI_SEMANTIC_POSITION.
00270 { 00271 struct tgsi_declaration_semantic ds; 00272 00273 ds.SemanticName = TGSI_SEMANTIC_POSITION; 00274 ds.SemanticIndex = 0; 00275 ds.Padding = 0; 00276 00277 return ds; 00278 }
struct tgsi_dimension tgsi_default_dimension | ( | void | ) | [read] |
Definition at line 1142 of file tgsi_build.c.
References tgsi_dimension::Dimension, tgsi_dimension::Extended, tgsi_dimension::Index, tgsi_dimension::Indirect, and tgsi_dimension::Padding.
01143 { 01144 struct tgsi_dimension dimension; 01145 01146 dimension.Indirect = 0; 01147 dimension.Dimension = 0; 01148 dimension.Padding = 0; 01149 dimension.Index = 0; 01150 dimension.Extended = 0; 01151 01152 return dimension; 01153 }
struct tgsi_dst_register tgsi_default_dst_register | ( | void | ) | [read] |
Definition at line 1174 of file tgsi_build.c.
References tgsi_dst_register::Dimension, tgsi_dst_register::Extended, tgsi_dst_register::File, tgsi_dst_register::Index, tgsi_dst_register::Indirect, tgsi_dst_register::Padding, TGSI_FILE_NULL, TGSI_WRITEMASK_XYZW, and tgsi_dst_register::WriteMask.
01175 { 01176 struct tgsi_dst_register dst_register; 01177 01178 dst_register.File = TGSI_FILE_NULL; 01179 dst_register.WriteMask = TGSI_WRITEMASK_XYZW; 01180 dst_register.Indirect = 0; 01181 dst_register.Dimension = 0; 01182 dst_register.Index = 0; 01183 dst_register.Padding = 0; 01184 dst_register.Extended = 0; 01185 01186 return dst_register; 01187 }
struct tgsi_dst_register_ext_concode tgsi_default_dst_register_ext_concode | ( | void | ) | [read] |
Definition at line 1228 of file tgsi_build.c.
References tgsi_dst_register_ext_concode::CondMask, tgsi_dst_register_ext_concode::CondSrcIndex, tgsi_dst_register_ext_concode::CondSwizzleW, tgsi_dst_register_ext_concode::CondSwizzleX, tgsi_dst_register_ext_concode::CondSwizzleY, tgsi_dst_register_ext_concode::CondSwizzleZ, tgsi_dst_register_ext_concode::Extended, tgsi_dst_register_ext_concode::Padding, TGSI_CC_TR, TGSI_DST_REGISTER_EXT_TYPE_CONDCODE, TGSI_SWIZZLE_W, TGSI_SWIZZLE_X, TGSI_SWIZZLE_Y, TGSI_SWIZZLE_Z, and tgsi_dst_register_ext_concode::Type.
01229 { 01230 struct tgsi_dst_register_ext_concode dst_register_ext_concode; 01231 01232 dst_register_ext_concode.Type = TGSI_DST_REGISTER_EXT_TYPE_CONDCODE; 01233 dst_register_ext_concode.CondMask = TGSI_CC_TR; 01234 dst_register_ext_concode.CondSwizzleX = TGSI_SWIZZLE_X; 01235 dst_register_ext_concode.CondSwizzleY = TGSI_SWIZZLE_Y; 01236 dst_register_ext_concode.CondSwizzleZ = TGSI_SWIZZLE_Z; 01237 dst_register_ext_concode.CondSwizzleW = TGSI_SWIZZLE_W; 01238 dst_register_ext_concode.CondSrcIndex = 0; 01239 dst_register_ext_concode.Padding = 0; 01240 dst_register_ext_concode.Extended = 0; 01241 01242 return dst_register_ext_concode; 01243 }
struct tgsi_dst_register_ext_modulate tgsi_default_dst_register_ext_modulate | ( | void | ) | [read] |
Definition at line 1291 of file tgsi_build.c.
References tgsi_dst_register_ext_modulate::Extended, tgsi_dst_register_ext_modulate::Modulate, tgsi_dst_register_ext_modulate::Padding, TGSI_DST_REGISTER_EXT_TYPE_MODULATE, TGSI_MODULATE_1X, and tgsi_dst_register_ext_modulate::Type.
01292 { 01293 struct tgsi_dst_register_ext_modulate dst_register_ext_modulate; 01294 01295 dst_register_ext_modulate.Type = TGSI_DST_REGISTER_EXT_TYPE_MODULATE; 01296 dst_register_ext_modulate.Modulate = TGSI_MODULATE_1X; 01297 dst_register_ext_modulate.Padding = 0; 01298 dst_register_ext_modulate.Extended = 0; 01299 01300 return dst_register_ext_modulate; 01301 }
struct tgsi_full_declaration tgsi_default_full_declaration | ( | void | ) | [read] |
Definition at line 171 of file tgsi_build.c.
References tgsi_full_declaration::Declaration, tgsi_full_declaration::DeclarationRange, tgsi_full_declaration::Semantic, tgsi_default_declaration(), tgsi_default_declaration_range(), and tgsi_default_declaration_semantic().
00172 { 00173 struct tgsi_full_declaration full_declaration; 00174 00175 full_declaration.Declaration = tgsi_default_declaration(); 00176 full_declaration.DeclarationRange = tgsi_default_declaration_range(); 00177 full_declaration.Semantic = tgsi_default_declaration_semantic(); 00178 00179 return full_declaration; 00180 }
struct tgsi_full_dst_register tgsi_default_full_dst_register | ( | void | ) | [read] |
Definition at line 1214 of file tgsi_build.c.
References tgsi_full_dst_register::DstRegister, tgsi_full_dst_register::DstRegisterExtConcode, tgsi_full_dst_register::DstRegisterExtModulate, tgsi_default_dst_register(), tgsi_default_dst_register_ext_concode(), and tgsi_default_dst_register_ext_modulate().
01215 { 01216 struct tgsi_full_dst_register full_dst_register; 01217 01218 full_dst_register.DstRegister = tgsi_default_dst_register(); 01219 full_dst_register.DstRegisterExtConcode = 01220 tgsi_default_dst_register_ext_concode(); 01221 full_dst_register.DstRegisterExtModulate = 01222 tgsi_default_dst_register_ext_modulate(); 01223 01224 return full_dst_register; 01225 }
struct tgsi_full_immediate tgsi_default_full_immediate | ( | void | ) | [read] |
Definition at line 333 of file tgsi_build.c.
References tgsi_full_immediate::Immediate, tgsi_full_immediate::Pointer, tgsi_default_immediate(), and tgsi_full_immediate::u.
00334 { 00335 struct tgsi_full_immediate fullimm; 00336 00337 fullimm.Immediate = tgsi_default_immediate(); 00338 fullimm.u.Pointer = (void *) 0; 00339 00340 return fullimm; 00341 }
struct tgsi_full_instruction tgsi_default_full_instruction | ( | void | ) | [read] |
Definition at line 464 of file tgsi_build.c.
References tgsi_full_instruction::FullDstRegisters, tgsi_full_instruction::FullSrcRegisters, tgsi_full_instruction::Instruction, tgsi_full_instruction::InstructionExtLabel, tgsi_full_instruction::InstructionExtNv, tgsi_full_instruction::InstructionExtTexture, tgsi_default_full_dst_register(), tgsi_default_full_src_register(), tgsi_default_instruction(), tgsi_default_instruction_ext_label(), tgsi_default_instruction_ext_nv(), tgsi_default_instruction_ext_texture(), TGSI_FULL_MAX_DST_REGISTERS, and TGSI_FULL_MAX_SRC_REGISTERS.
00465 { 00466 struct tgsi_full_instruction full_instruction; 00467 unsigned i; 00468 00469 full_instruction.Instruction = tgsi_default_instruction(); 00470 full_instruction.InstructionExtNv = tgsi_default_instruction_ext_nv(); 00471 full_instruction.InstructionExtLabel = tgsi_default_instruction_ext_label(); 00472 full_instruction.InstructionExtTexture = tgsi_default_instruction_ext_texture(); 00473 for( i = 0; i < TGSI_FULL_MAX_DST_REGISTERS; i++ ) { 00474 full_instruction.FullDstRegisters[i] = tgsi_default_full_dst_register(); 00475 } 00476 for( i = 0; i < TGSI_FULL_MAX_SRC_REGISTERS; i++ ) { 00477 full_instruction.FullSrcRegisters[i] = tgsi_default_full_src_register(); 00478 } 00479 00480 return full_instruction; 00481 }
struct tgsi_full_src_register tgsi_default_full_src_register | ( | void | ) | [read] |
Definition at line 997 of file tgsi_build.c.
References tgsi_full_src_register::SrcRegister, tgsi_full_src_register::SrcRegisterDim, tgsi_full_src_register::SrcRegisterDimInd, tgsi_full_src_register::SrcRegisterExtMod, tgsi_full_src_register::SrcRegisterExtSwz, tgsi_full_src_register::SrcRegisterInd, tgsi_default_dimension(), tgsi_default_src_register(), tgsi_default_src_register_ext_mod(), and tgsi_default_src_register_ext_swz().
00998 { 00999 struct tgsi_full_src_register full_src_register; 01000 01001 full_src_register.SrcRegister = tgsi_default_src_register(); 01002 full_src_register.SrcRegisterExtSwz = tgsi_default_src_register_ext_swz(); 01003 full_src_register.SrcRegisterExtMod = tgsi_default_src_register_ext_mod(); 01004 full_src_register.SrcRegisterInd = tgsi_default_src_register(); 01005 full_src_register.SrcRegisterDim = tgsi_default_dimension(); 01006 full_src_register.SrcRegisterDimInd = tgsi_default_src_register(); 01007 01008 return full_src_register; 01009 }
struct tgsi_immediate tgsi_default_immediate | ( | void | ) | [read] |
Definition at line 306 of file tgsi_build.c.
References tgsi_immediate::DataType, tgsi_immediate::Extended, tgsi_immediate::Padding, tgsi_immediate::Size, TGSI_IMM_FLOAT32, TGSI_TOKEN_TYPE_IMMEDIATE, and tgsi_immediate::Type.
00307 { 00308 struct tgsi_immediate immediate; 00309 00310 immediate.Type = TGSI_TOKEN_TYPE_IMMEDIATE; 00311 immediate.Size = 1; 00312 immediate.DataType = TGSI_IMM_FLOAT32; 00313 immediate.Padding = 0; 00314 immediate.Extended = 0; 00315 00316 return immediate; 00317 }
struct tgsi_instruction tgsi_default_instruction | ( | void | ) | [read] |
Definition at line 409 of file tgsi_build.c.
References tgsi_instruction::Extended, tgsi_instruction::NumDstRegs, tgsi_instruction::NumSrcRegs, tgsi_instruction::Opcode, tgsi_instruction::Padding, tgsi_instruction::Saturate, tgsi_instruction::Size, TGSI_OPCODE_MOV, TGSI_SAT_NONE, TGSI_TOKEN_TYPE_INSTRUCTION, and tgsi_instruction::Type.
00410 { 00411 struct tgsi_instruction instruction; 00412 00413 instruction.Type = TGSI_TOKEN_TYPE_INSTRUCTION; 00414 instruction.Size = 1; 00415 instruction.Opcode = TGSI_OPCODE_MOV; 00416 instruction.Saturate = TGSI_SAT_NONE; 00417 instruction.NumDstRegs = 1; 00418 instruction.NumSrcRegs = 1; 00419 instruction.Padding = 0; 00420 instruction.Extended = 0; 00421 00422 return instruction; 00423 }
struct tgsi_instruction_ext_label tgsi_default_instruction_ext_label | ( | void | ) | [read] |
Definition at line 856 of file tgsi_build.c.
References tgsi_instruction_ext_label::Extended, tgsi_instruction_ext_label::Label, tgsi_instruction_ext_label::Padding, TGSI_INSTRUCTION_EXT_TYPE_LABEL, and tgsi_instruction_ext_label::Type.
00857 { 00858 struct tgsi_instruction_ext_label instruction_ext_label; 00859 00860 instruction_ext_label.Type = TGSI_INSTRUCTION_EXT_TYPE_LABEL; 00861 instruction_ext_label.Label = 0; 00862 instruction_ext_label.Padding = 0; 00863 instruction_ext_label.Extended = 0; 00864 00865 return instruction_ext_label; 00866 }
struct tgsi_instruction_ext_nv tgsi_default_instruction_ext_nv | ( | void | ) | [read] |
Definition at line 783 of file tgsi_build.c.
References tgsi_instruction_ext_nv::CondDstIndex, tgsi_instruction_ext_nv::CondDstUpdate, tgsi_instruction_ext_nv::CondFlowEnable, tgsi_instruction_ext_nv::CondFlowIndex, tgsi_instruction_ext_nv::CondMask, tgsi_instruction_ext_nv::CondSwizzleW, tgsi_instruction_ext_nv::CondSwizzleX, tgsi_instruction_ext_nv::CondSwizzleY, tgsi_instruction_ext_nv::CondSwizzleZ, tgsi_instruction_ext_nv::Extended, tgsi_instruction_ext_nv::Padding, tgsi_instruction_ext_nv::Precision, TGSI_CC_TR, TGSI_INSTRUCTION_EXT_TYPE_NV, TGSI_PRECISION_DEFAULT, TGSI_SWIZZLE_W, TGSI_SWIZZLE_X, TGSI_SWIZZLE_Y, TGSI_SWIZZLE_Z, and tgsi_instruction_ext_nv::Type.
00784 { 00785 struct tgsi_instruction_ext_nv instruction_ext_nv; 00786 00787 instruction_ext_nv.Type = TGSI_INSTRUCTION_EXT_TYPE_NV; 00788 instruction_ext_nv.Precision = TGSI_PRECISION_DEFAULT; 00789 instruction_ext_nv.CondDstIndex = 0; 00790 instruction_ext_nv.CondFlowIndex = 0; 00791 instruction_ext_nv.CondMask = TGSI_CC_TR; 00792 instruction_ext_nv.CondSwizzleX = TGSI_SWIZZLE_X; 00793 instruction_ext_nv.CondSwizzleY = TGSI_SWIZZLE_Y; 00794 instruction_ext_nv.CondSwizzleZ = TGSI_SWIZZLE_Z; 00795 instruction_ext_nv.CondSwizzleW = TGSI_SWIZZLE_W; 00796 instruction_ext_nv.CondDstUpdate = 0; 00797 instruction_ext_nv.CondFlowEnable = 0; 00798 instruction_ext_nv.Padding = 0; 00799 instruction_ext_nv.Extended = 0; 00800 00801 return instruction_ext_nv; 00802 }
struct tgsi_instruction_ext_texture tgsi_default_instruction_ext_texture | ( | void | ) | [read] |
Definition at line 897 of file tgsi_build.c.
References tgsi_instruction_ext_texture::Extended, tgsi_instruction_ext_texture::Padding, tgsi_instruction_ext_texture::Texture, TGSI_INSTRUCTION_EXT_TYPE_TEXTURE, TGSI_TEXTURE_UNKNOWN, and tgsi_instruction_ext_texture::Type.
00898 { 00899 struct tgsi_instruction_ext_texture instruction_ext_texture; 00900 00901 instruction_ext_texture.Type = TGSI_INSTRUCTION_EXT_TYPE_TEXTURE; 00902 instruction_ext_texture.Texture = TGSI_TEXTURE_UNKNOWN; 00903 instruction_ext_texture.Padding = 0; 00904 instruction_ext_texture.Extended = 0; 00905 00906 return instruction_ext_texture; 00907 }
struct tgsi_processor tgsi_default_processor | ( | void | ) | [read] |
Definition at line 82 of file tgsi_build.c.
References tgsi_processor::Padding, tgsi_processor::Processor, and TGSI_PROCESSOR_FRAGMENT.
00083 { 00084 struct tgsi_processor processor; 00085 00086 processor.Processor = TGSI_PROCESSOR_FRAGMENT; 00087 processor.Padding = 0; 00088 00089 return processor; 00090 }
struct tgsi_src_register tgsi_default_src_register | ( | void | ) | [read] |
Definition at line 938 of file tgsi_build.c.
References tgsi_src_register::Dimension, tgsi_src_register::Extended, tgsi_src_register::File, tgsi_src_register::Index, tgsi_src_register::Indirect, tgsi_src_register::Negate, tgsi_src_register::SwizzleW, tgsi_src_register::SwizzleX, tgsi_src_register::SwizzleY, tgsi_src_register::SwizzleZ, TGSI_FILE_NULL, TGSI_SWIZZLE_W, TGSI_SWIZZLE_X, TGSI_SWIZZLE_Y, and TGSI_SWIZZLE_Z.
00939 { 00940 struct tgsi_src_register src_register; 00941 00942 src_register.File = TGSI_FILE_NULL; 00943 src_register.SwizzleX = TGSI_SWIZZLE_X; 00944 src_register.SwizzleY = TGSI_SWIZZLE_Y; 00945 src_register.SwizzleZ = TGSI_SWIZZLE_Z; 00946 src_register.SwizzleW = TGSI_SWIZZLE_W; 00947 src_register.Negate = 0; 00948 src_register.Indirect = 0; 00949 src_register.Dimension = 0; 00950 src_register.Index = 0; 00951 src_register.Extended = 0; 00952 00953 return src_register; 00954 }
struct tgsi_src_register_ext_mod tgsi_default_src_register_ext_mod | ( | void | ) | [read] |
Definition at line 1083 of file tgsi_build.c.
References tgsi_src_register_ext_mod::Absolute, tgsi_src_register_ext_mod::Bias, tgsi_src_register_ext_mod::Complement, tgsi_src_register_ext_mod::Extended, tgsi_src_register_ext_mod::Negate, tgsi_src_register_ext_mod::Padding, tgsi_src_register_ext_mod::Scale2X, TGSI_SRC_REGISTER_EXT_TYPE_MOD, and tgsi_src_register_ext_mod::Type.
01084 { 01085 struct tgsi_src_register_ext_mod src_register_ext_mod; 01086 01087 src_register_ext_mod.Type = TGSI_SRC_REGISTER_EXT_TYPE_MOD; 01088 src_register_ext_mod.Complement = 0; 01089 src_register_ext_mod.Bias = 0; 01090 src_register_ext_mod.Scale2X = 0; 01091 src_register_ext_mod.Absolute = 0; 01092 src_register_ext_mod.Negate = 0; 01093 src_register_ext_mod.Padding = 0; 01094 src_register_ext_mod.Extended = 0; 01095 01096 return src_register_ext_mod; 01097 }
struct tgsi_src_register_ext_swz tgsi_default_src_register_ext_swz | ( | void | ) | [read] |
Definition at line 1012 of file tgsi_build.c.
References tgsi_src_register_ext_swz::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_ext_swz::NegateW, tgsi_src_register_ext_swz::NegateX, tgsi_src_register_ext_swz::NegateY, tgsi_src_register_ext_swz::NegateZ, tgsi_src_register_ext_swz::Padding, TGSI_EXTSWIZZLE_W, TGSI_EXTSWIZZLE_X, TGSI_EXTSWIZZLE_Y, TGSI_EXTSWIZZLE_Z, TGSI_SRC_REGISTER_EXT_TYPE_SWZ, and tgsi_src_register_ext_swz::Type.
01013 { 01014 struct tgsi_src_register_ext_swz src_register_ext_swz; 01015 01016 src_register_ext_swz.Type = TGSI_SRC_REGISTER_EXT_TYPE_SWZ; 01017 src_register_ext_swz.ExtSwizzleX = TGSI_EXTSWIZZLE_X; 01018 src_register_ext_swz.ExtSwizzleY = TGSI_EXTSWIZZLE_Y; 01019 src_register_ext_swz.ExtSwizzleZ = TGSI_EXTSWIZZLE_Z; 01020 src_register_ext_swz.ExtSwizzleW = TGSI_EXTSWIZZLE_W; 01021 src_register_ext_swz.NegateX = 0; 01022 src_register_ext_swz.NegateY = 0; 01023 src_register_ext_swz.NegateZ = 0; 01024 src_register_ext_swz.NegateW = 0; 01025 src_register_ext_swz.Padding = 0; 01026 src_register_ext_swz.Extended = 0; 01027 01028 return src_register_ext_swz; 01029 }