// ----------------------------------------------------------- // wanderer // ----------------------------------------------------------- void createWanderer(ds::World* world) { ds::ActionDefinition wsd[] = { { new ds::CollisionActionSettings(ds::PST_CIRCLE) }, { new ds::RotateBySettings(DEGTORAD(180.0f),2.0f) } }; world->createBehavior("wanderer_start", wsd, 2); ds::ActionDefinition wmv[] = { { new ds::MoveBySettings(100.0f, 5.0f, true) }, { new ds::ScaleSettings(v3(1.0f), v3(0.8f), 0.4f) } }; world->createBehavior("wanderer_move", wmv, 2); ds::ActionDefinition wrt[] = { { new ds::RotateBySettings(DEGTORAD(180.0f), 2.0f) }, { new ds::ScaleSettings(v3(0.8f), v3(1.0f), 0.4f) } }; world->createBehavior("wanderer_rotate", wrt, 2); ds::ConnectionDefinition wandererConnections[] = { { SID("start_up"), ds::AT_SCALE_BY_PATH, SID("wanderer_start") }, { SID("wanderer_start"), ds::AT_ROTATE_BY, SID("wanderer_move") }, { SID("wanderer_move"), ds::AT_MOVE_BY, SID("wanderer_rotate") }, { SID("wanderer_rotate"), ds::AT_ROTATE_BY, SID("wanderer_move") } }; world->connectBehaviors(wandererConnections, 4, OT_WANDERER); }
int in6_addr2scopeid(struct ifnet *ifp, struct in6_addr *addr) { int scope = in6_addrscope(addr); int retid = 0; struct scope6_id *sid; if_inet6data_lock_shared(ifp); if (IN6_IFEXTRA(ifp) == NULL) goto err; sid = SID(ifp); switch (scope) { case IPV6_ADDR_SCOPE_NODELOCAL: retid = -1; /* XXX: is this an appropriate value? */ break; case IPV6_ADDR_SCOPE_LINKLOCAL: retid = sid->s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL]; break; case IPV6_ADDR_SCOPE_SITELOCAL: retid = sid->s6id_list[IPV6_ADDR_SCOPE_SITELOCAL]; break; case IPV6_ADDR_SCOPE_ORGLOCAL: retid = sid->s6id_list[IPV6_ADDR_SCOPE_ORGLOCAL]; break; default: break; /* XXX: value 0, treat as global. */ } err: if_inet6data_lock_done(ifp); return (retid); }
/* * Determine the appropriate scope zone ID for in6 and ifp. If ret_id is * non NULL, it is set to the zone ID. If the zone ID needs to be embedded * in the in6_addr structure, in6 will be modified. * * ret_id - unnecessary? */ int in6_setscope(struct in6_addr *in6, struct ifnet *ifp, u_int32_t *ret_id) { int scope; u_int32_t zoneid = 0; struct scope6_id *sid = SID(ifp); #ifdef DIAGNOSTIC if (sid == NULL) { /* should not happen */ panic("in6_setscope: scope array is NULL"); /* NOTREACHED */ } #endif /* * special case: the loopback address can only belong to a loopback * interface. */ if (IN6_IS_ADDR_LOOPBACK(in6)) { if (!(ifp->if_flags & IFF_LOOPBACK)) return (EINVAL); else { if (ret_id != NULL) *ret_id = 0; /* there's no ambiguity */ return (0); } } scope = in6_addrscope(in6); switch (scope) { case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */ zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL]; break; case IPV6_ADDR_SCOPE_LINKLOCAL: zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL]; break; case IPV6_ADDR_SCOPE_SITELOCAL: zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_SITELOCAL]; break; case IPV6_ADDR_SCOPE_ORGLOCAL: zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_ORGLOCAL]; break; default: zoneid = 0; /* XXX: treat as global. */ break; } if (ret_id != NULL) *ret_id = zoneid; if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6)) in6->s6_addr16[1] = htons(zoneid & 0xffff); /* XXX */ return (0); }
static void dump_imm_data(struct tgsi_iterate_context *iter, union tgsi_immediate_data *data, unsigned num_tokens, unsigned data_type) { struct dump_ctx *ctx = (struct dump_ctx *)iter; unsigned i ; TXT( " {" ); assert( num_tokens <= 4 ); for (i = 0; i < num_tokens; i++) { switch (data_type) { case TGSI_IMM_FLOAT32: FLT( data[i].Float ); break; case TGSI_IMM_UINT32: UID(data[i].Uint); break; case TGSI_IMM_INT32: SID(data[i].Int); break; default: assert( 0 ); } if (i < num_tokens - 1) TXT( ", " ); } TXT( "}" ); }
static void _dump_register_src( struct dump_ctx *ctx, const struct tgsi_full_src_register *src ) { ENM(src->Register.File, tgsi_file_names); if (src->Register.Dimension) { if (src->Dimension.Indirect) { CHR( '[' ); ENM( src->DimIndirect.File, tgsi_file_names ); CHR( '[' ); SID( src->DimIndirect.Index ); TXT( "]." ); ENM( src->DimIndirect.Swizzle, tgsi_swizzle_names ); if (src->Dimension.Index != 0) { if (src->Dimension.Index > 0) CHR( '+' ); SID( src->Dimension.Index ); } CHR( ']' ); if (src->DimIndirect.ArrayID) { CHR( '(' ); SID( src->DimIndirect.ArrayID ); CHR( ')' ); } } else { CHR('['); SID(src->Dimension.Index); CHR(']'); } } if (src->Register.Indirect) { CHR( '[' ); ENM( src->Indirect.File, tgsi_file_names ); CHR( '[' ); SID( src->Indirect.Index ); TXT( "]." ); ENM( src->Indirect.Swizzle, tgsi_swizzle_names ); if (src->Register.Index != 0) { if (src->Register.Index > 0) CHR( '+' ); SID( src->Register.Index ); } CHR( ']' ); if (src->Indirect.ArrayID) { CHR( '(' ); SID( src->Indirect.ArrayID ); CHR( ')' ); } } else { CHR( '[' ); SID( src->Register.Index ); CHR( ']' ); } }
int scope6_set(struct ifnet *ifp, const struct scope6_id *idlist) { int i; int error = 0; struct scope6_id *sid = SID(ifp); if (!sid) /* paranoid? */ return (EINVAL); /* * XXX: We need more consistency checks of the relationship among * scopes (e.g. an organization should be larger than a site). */ /* * TODO(XXX): after setting, we should reflect the changes to * interface addresses, routing table entries, PCB entries... */ for (i = 0; i < 16; i++) { if (idlist->s6id_list[i] && idlist->s6id_list[i] != sid->s6id_list[i]) { int s; /* * An interface zone ID must be the corresponding * interface index by definition. */ if (i == IPV6_ADDR_SCOPE_INTFACELOCAL && idlist->s6id_list[i] != ifp->if_index) return (EINVAL); s = pserialize_read_enter(); if (i == IPV6_ADDR_SCOPE_LINKLOCAL && !if_byindex(idlist->s6id_list[i])) { /* * XXX: theoretically, there should be no * relationship between link IDs and interface * IDs, but we check the consistency for * safety in later use. */ pserialize_read_exit(s); return (EINVAL); } pserialize_read_exit(s); /* * XXX: we must need lots of work in this case, * but we simply set the new value in this initial * implementation. */ sid->s6id_list[i] = idlist->s6id_list[i]; } } return (error); }
int SpriteSheet::findIndex(const char* name) const { StaticHash hash = SID(name); for (uint32_t i = 0; i < _entries.size(); ++i) { if (_entries[i].hash == hash) { return i; } } XASSERT(1 == 2, "No matching spritesheet found for '%s'", name); return -1; }
// ----------------------------------------------------------- // basic beahvior // ----------------------------------------------------------- void createBasicBehaviors(ds::World* world, ds::V3Path *path) { ds::ActionDefinition startups[] = { { new ds::ScaleByPathActionSettings(path, 1.0f, 0.2f) }, { new ds::LookAtSettings(SID("Player"), 0.0f) } }; world->createBehavior("start_up", startups, 2); ID attach = world->createBehavior("attach_collider"); world->addSettings(attach, new ds::CollisionActionSettings(ds::PST_CIRCLE)); }
void Sav5::trade(std::shared_ptr<PKX> pk) { if (pk->egg() && (otName() != pk->otName() || TID() != pk->TID() || SID() != pk->SID() || gender() != pk->otGender())) { pk->metDay(Configuration::getInstance().day()); pk->metMonth(Configuration::getInstance().month()); pk->metYear(Configuration::getInstance().year() - 2000); pk->metLocation(30003); } }
/* * Determine the appropriate scope zone ID for in6 and ifp. If ret_id is * non NULL, it is set to the zone ID. If the zone ID needs to be embedded * in the in6_addr structure, in6 will be modified. */ int in6_setscope(struct in6_addr *in6, const struct ifnet *ifp, uint32_t *ret_id) { int scope; uint32_t zoneid = 0; const struct scope6_id *sid = SID(ifp); if (sid == NULL) return EINVAL; /* * special case: the loopback address can only belong to a loopback * interface. */ if (IN6_IS_ADDR_LOOPBACK(in6)) { if (!(ifp->if_flags & IFF_LOOPBACK)) return (EINVAL); else { if (ret_id != NULL) *ret_id = 0; /* there's no ambiguity */ return (0); } } scope = in6_addrscope(in6); switch (scope) { case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */ zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL]; break; case IPV6_ADDR_SCOPE_LINKLOCAL: zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL]; break; case IPV6_ADDR_SCOPE_SITELOCAL: zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_SITELOCAL]; break; case IPV6_ADDR_SCOPE_ORGLOCAL: zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_ORGLOCAL]; break; default: zoneid = 0; /* XXX: treat as global. */ break; } if (ret_id != NULL) *ret_id = zoneid; return in6_setzoneid(in6, zoneid); }
void OnEvent(const sht::utility::Event * event) final { switch (event->type()) { case SID("editor_mode_changed"): if (object_manager_->editor_mode()) camera_manager_->MakeFree(0); // CameraID else camera_manager_->SetCurrent(0); // i guess CameraID will be 0 break; } }
int scope6_get(struct ifnet *ifp, struct scope6_id *idlist) { struct scope6_id *sid = SID(ifp); if (sid == NULL) /* paranoid? */ return (EINVAL); *idlist = *sid; return (0); }
int scope6_get(const struct ifnet *ifp, struct scope6_id *idlist) { /* We only need to lock the interface's afdata for SID() to work. */ const struct scope6_id *sid = SID(ifp); if (sid == NULL) /* paranoid? */ return EINVAL; *idlist = *sid; return 0; }
// ----------------------------------------------------------- // spotter behavior // ----------------------------------------------------------- void createSpotterBehavior(ds::World* world) { ID spotterLook = world->createBehavior("spotter_look"); world->addSettings(spotterLook, new ds::LookAtSettings(SID("Player"), 1.0f)); ds::ActionDefinition sm[] = { { new ds::MoveBySettings(150.0f, 5.0f, true) }, { new ds::WiggleSettings(50.0f, 8.0f, 5.0f) }, { new ds::AlignToForceSettings(5.0f) } }; world->createBehavior("spotter_move", sm, 3); ds::ConnectionDefinition cd[] = { { SID("start_up"), ds::AT_SCALE_BY_PATH, SID("attach_collider") }, { SID("attach_collider"), ds::AT_COLLIDER_ATTACHED, SID("spotter_look") }, { SID("spotter_look"), ds::AT_LOOK_AT, SID("spotter_move") }, { SID("spotter_move"), ds::AT_MOVE_BY, SID("spotter_look") } }; world->connectBehaviors(cd, 4, OT_SPOTTER); }
int scope6_get(struct ifnet *ifp, struct scope6_id *idlist) { struct scope6_id *sid; /* We only need to lock the interface's afdata for SID() to work. */ IF_AFDATA_RLOCK(ifp); sid = SID(ifp); if (sid == NULL) { /* paranoid? */ IF_AFDATA_RUNLOCK(ifp); return (EINVAL); } *idlist = *sid; IF_AFDATA_RUNLOCK(ifp); return (0); }
static boolean iter_immediate( struct tgsi_iterate_context *iter, struct tgsi_full_immediate *imm ) { struct dump_ctx *ctx = (struct dump_ctx *) iter; TXT( "IMM[" ); SID( ctx->immno++ ); TXT( "] " ); ENM( imm->Immediate.DataType, tgsi_immediate_type_names ); dump_imm_data(iter, imm->u, imm->Immediate.NrTokens - 1, imm->Immediate.DataType); EOL(); return TRUE; }
static void dump_imm_data(struct tgsi_iterate_context *iter, union tgsi_immediate_data *data, unsigned num_tokens, unsigned data_type) { struct dump_ctx *ctx = (struct dump_ctx *)iter; unsigned i ; TXT( " {" ); assert( num_tokens <= 4 ); for (i = 0; i < num_tokens; i++) { switch (data_type) { case TGSI_IMM_FLOAT64: { union di d; d.ui = data[i].Uint | (uint64_t)data[i+1].Uint << 32; DBL( d.d ); i++; break; } case TGSI_IMM_FLOAT32: if (ctx->dump_float_as_hex) HFLT( data[i].Float ); else FLT( data[i].Float ); break; case TGSI_IMM_UINT32: UID(data[i].Uint); break; case TGSI_IMM_INT32: SID(data[i].Int); break; default: assert( 0 ); } if (i < num_tokens - 1) TXT( ", " ); } TXT( "}" ); }
void scope6_ifattach(struct ifnet *ifp) { struct scope6_id *sid; VERIFY(IN6_IFEXTRA(ifp) != NULL); if_inet6data_lock_exclusive(ifp); sid = SID(ifp); /* N.B.: the structure is already zero'ed */ /* * XXX: IPV6_ADDR_SCOPE_xxx macros are not standard. * Should we rather hardcode here? */ sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL] = ifp->if_index; sid->s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL] = ifp->if_index; #if MULTI_SCOPE /* by default, we don't care about scope boundary for these scopes. */ sid->s6id_list[IPV6_ADDR_SCOPE_SITELOCAL] = 1; sid->s6id_list[IPV6_ADDR_SCOPE_ORGLOCAL] = 1; #endif if_inet6data_lock_done(ifp); }
/* * Determine the appropriate scope zone ID for in6 and ifp. If ret_id is * non NULL, it is set to the zone ID. If the zone ID needs to be embedded * in the in6_addr structure, in6 will be modified. * * ret_id - unnecessary? */ int in6_setscope(struct in6_addr *in6, struct ifnet *ifp, u_int32_t *ret_id) { int scope; u_int32_t zoneid = 0; struct scope6_id *sid; /* * special case: the loopback address can only belong to a loopback * interface. */ if (IN6_IS_ADDR_LOOPBACK(in6)) { if (!(ifp->if_flags & IFF_LOOPBACK)) return (EINVAL); } else { scope = in6_addrscope(in6); if (scope == IPV6_ADDR_SCOPE_INTFACELOCAL || scope == IPV6_ADDR_SCOPE_LINKLOCAL) { /* * Currently we use interface indeces as the * zone IDs for interface-local and link-local * scopes. */ zoneid = ifp->if_index; in6->s6_addr16[1] = htons(zoneid & 0xffff); /* XXX */ } else if (scope != IPV6_ADDR_SCOPE_GLOBAL) { IF_AFDATA_RLOCK(ifp); sid = SID(ifp); zoneid = sid->s6id_list[scope]; IF_AFDATA_RUNLOCK(ifp); } } if (ret_id != NULL) *ret_id = zoneid; return (0); }
static void _dump_register_dst( struct dump_ctx *ctx, const struct tgsi_full_dst_register *dst ) { ENM(dst->Register.File, tgsi_file_names); if (dst->Register.Dimension) { if (dst->Dimension.Indirect) { CHR( '[' ); ENM( dst->DimIndirect.File, tgsi_file_names ); CHR( '[' ); SID( dst->DimIndirect.Index ); TXT( "]." ); ENM( dst->DimIndirect.SwizzleX, tgsi_swizzle_names ); if (dst->Dimension.Index != 0) { if (dst->Dimension.Index > 0) CHR( '+' ); SID( dst->Dimension.Index ); } CHR( ']' ); } else { CHR('['); SID(dst->Dimension.Index); CHR(']'); } } if (dst->Register.Indirect) { CHR( '[' ); ENM( dst->Indirect.File, tgsi_file_names ); CHR( '[' ); SID( dst->Indirect.Index ); TXT( "]." ); ENM( dst->Indirect.SwizzleX, tgsi_swizzle_names ); if (dst->Register.Index != 0) { if (dst->Register.Index > 0) CHR( '+' ); SID( dst->Register.Index ); } CHR( ']' ); } else { CHR( '[' ); SID( dst->Register.Index ); CHR( ']' ); } }
static boolean iter_property( struct tgsi_iterate_context *iter, struct tgsi_full_property *prop ) { unsigned i; struct dump_ctx *ctx = (struct dump_ctx *)iter; TXT( "PROPERTY " ); ENM(prop->Property.PropertyName, tgsi_property_names); if (prop->Property.NrTokens > 1) TXT(" "); for (i = 0; i < prop->Property.NrTokens - 1; ++i) { switch (prop->Property.PropertyName) { case TGSI_PROPERTY_GS_INPUT_PRIM: case TGSI_PROPERTY_GS_OUTPUT_PRIM: ENM(prop->u[i].Data, tgsi_primitive_names); break; case TGSI_PROPERTY_FS_COORD_ORIGIN: ENM(prop->u[i].Data, tgsi_fs_coord_origin_names); break; case TGSI_PROPERTY_FS_COORD_PIXEL_CENTER: ENM(prop->u[i].Data, tgsi_fs_coord_pixel_center_names); break; default: SID( prop->u[i].Data ); break; } if (i < prop->Property.NrTokens - 2) TXT( ", " ); } EOL(); return TRUE; }
// ----------------------------------------------------------- // follower behavior // ----------------------------------------------------------- void createFollowerBehavior(ds::World* world, ds::V3Path *path, GameSettings* settings) { ds::ActionDefinition startups[] = { { new ds::ScaleByPathActionSettings(path, 1.0f, 0.2f) }, { new ds::LookAtSettings(SID("Player"), 0.0f) }, { new ds::MoveBySettings(settings->follower.initialVelocity,0.2f) } }; world->createBehavior("follower_start_up", startups, 3); ds::ActionDefinition follow[] = { { new ds::SeparateSettings(OT_FOLLOWER, settings->follower.separationDistance, settings->follower.relaxation) }, { new ds::SeekSettings(SID("Player"), settings->follower.seekVelocity) }, }; world->createBehavior("follower_follow", follow, 2); ds::ConnectionDefinition cd[] = { { SID("follower_start_up"), ds::AT_SCALE_BY_PATH, SID("attach_collider") }, { SID("attach_collider"), ds::AT_COLLIDER_ATTACHED, SID("follower_follow") } }; world->connectBehaviors(cd, 2, OT_FOLLOWER); }
int scope6_set(struct ifnet *ifp, struct scope6_id *idlist) { int i, s; int error = 0; struct scope6_id *sid = SID(ifp); if (sid == NULL) /* paranoid? */ return (EINVAL); /* * XXX: We need more consistency checks of the relationship among * scopes (e.g. an organization should be larger than a site). */ /* * TODO(XXX): after setting, we should reflect the changes to * interface addresses, routing table entries, PCB entries... */ #if defined(__NetBSD__) || defined(__OpenBSD__) s = splsoftnet(); #else s = splnet(); #endif for (i = 0; i < 16; i++) { if (idlist->s6id_list[i] && idlist->s6id_list[i] != sid->s6id_list[i]) { /* * An interface zone ID must be the corresponding * interface index by definition. */ if (i == IPV6_ADDR_SCOPE_INTFACELOCAL && idlist->s6id_list[i] != ifp->if_index) { splx(s); return (EINVAL); } if (i == IPV6_ADDR_SCOPE_LINKLOCAL) { if (idlist->s6id_list[i] >= if_indexlim || #ifdef __FreeBSD__ ifnet_byindex(idlist->s6id_list[i]) == NULL #else ifindex2ifnet[idlist->s6id_list[i]] == NULL #endif ) { /* * XXX: theoretically, there should be * no relationship between link IDs and * interface IDs, but we check the * consistency for safety in later use. */ splx(s); return (EINVAL); } } /* * XXX: we must need lots of work in this case, * but we simply set the new value in this initial * implementation. */ sid->s6id_list[i] = idlist->s6id_list[i]; } } splx(s); return (error); }
static boolean iter_declaration( struct tgsi_iterate_context *iter, struct tgsi_full_declaration *decl ) { struct dump_ctx *ctx = (struct dump_ctx *)iter; TXT( "DCL " ); ENM(decl->Declaration.File, tgsi_file_names); /* all geometry shader inputs are two dimensional */ if (decl->Declaration.File == TGSI_FILE_INPUT && iter->processor.Processor == TGSI_PROCESSOR_GEOMETRY) { TXT("[]"); } if (decl->Declaration.Dimension) { CHR('['); SID(decl->Dim.Index2D); CHR(']'); } CHR('['); SID(decl->Range.First); if (decl->Range.First != decl->Range.Last) { TXT(".."); SID(decl->Range.Last); } CHR(']'); _dump_writemask( ctx, decl->Declaration.UsageMask ); if (decl->Declaration.Local) TXT( ", LOCAL" ); if (decl->Declaration.Semantic) { TXT( ", " ); ENM( decl->Semantic.Name, tgsi_semantic_names ); if (decl->Semantic.Index != 0 || decl->Semantic.Name == TGSI_SEMANTIC_GENERIC) { CHR( '[' ); UID( decl->Semantic.Index ); CHR( ']' ); } } if (decl->Declaration.File == TGSI_FILE_RESOURCE) { TXT(", "); ENM(decl->Resource.Resource, tgsi_texture_names); if (decl->Resource.Writable) TXT(", WR"); if (decl->Resource.Raw) TXT(", RAW"); } if (decl->Declaration.File == TGSI_FILE_SAMPLER_VIEW) { TXT(", "); ENM(decl->SamplerView.Resource, tgsi_texture_names); TXT(", "); if ((decl->SamplerView.ReturnTypeX == decl->SamplerView.ReturnTypeY) && (decl->SamplerView.ReturnTypeX == decl->SamplerView.ReturnTypeZ) && (decl->SamplerView.ReturnTypeX == decl->SamplerView.ReturnTypeW)) { ENM(decl->SamplerView.ReturnTypeX, tgsi_type_names); } else { ENM(decl->SamplerView.ReturnTypeX, tgsi_type_names); TXT(", "); ENM(decl->SamplerView.ReturnTypeY, tgsi_type_names); TXT(", "); ENM(decl->SamplerView.ReturnTypeZ, tgsi_type_names); TXT(", "); ENM(decl->SamplerView.ReturnTypeW, tgsi_type_names); } } if (decl->Declaration.Interpolate) { if (iter->processor.Processor == TGSI_PROCESSOR_FRAGMENT && decl->Declaration.File == TGSI_FILE_INPUT) { TXT( ", " ); ENM( decl->Interp.Interpolate, tgsi_interpolate_names ); } if (decl->Interp.Centroid) { TXT( ", CENTROID" ); } if (decl->Interp.CylindricalWrap) { TXT(", CYLWRAP_"); if (decl->Interp.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_X) { CHR('X'); } if (decl->Interp.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_Y) { CHR('Y'); } if (decl->Interp.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_Z) { CHR('Z'); } if (decl->Interp.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_W) { CHR('W'); } } } if (decl->Declaration.Invariant) { TXT( ", INVARIANT" ); } if (decl->Declaration.File == TGSI_FILE_IMMEDIATE_ARRAY) { unsigned i; char range_indent[4]; TXT(" {"); if (decl->Range.Last < 10) range_indent[0] = '\0'; else if (decl->Range.Last < 100) { range_indent[0] = ' '; range_indent[1] = '\0'; } else if (decl->Range.Last < 1000) { range_indent[0] = ' '; range_indent[1] = ' '; range_indent[2] = '\0'; } else { range_indent[0] = ' '; range_indent[1] = ' '; range_indent[2] = ' '; range_indent[3] = '\0'; } dump_imm_data(iter, decl->ImmediateData.u, 4, TGSI_IMM_FLOAT32); for(i = 1; i <= decl->Range.Last; ++i) { /* indent by strlen of: * "DCL IMMX[0..1] {" */ CHR('\n'); TXT( " " ); TXT( range_indent ); dump_imm_data(iter, decl->ImmediateData.u + i, 4, TGSI_IMM_FLOAT32); } TXT(" }"); } EOL(); return TRUE; }
static boolean iter_instruction( struct tgsi_iterate_context *iter, struct tgsi_full_instruction *inst ) { struct dump_ctx *ctx = (struct dump_ctx *) iter; uint instno = ctx->instno++; const struct tgsi_opcode_info *info = tgsi_get_opcode_info( inst->Instruction.Opcode ); uint i; boolean first_reg = TRUE; INSTID( instno ); TXT( ": " ); ctx->indent -= info->pre_dedent; for(i = 0; (int)i < ctx->indent; ++i) TXT( " " ); ctx->indent += info->post_indent; if (inst->Instruction.Predicate) { CHR( '(' ); if (inst->Predicate.Negate) CHR( '!' ); TXT( "PRED[" ); SID( inst->Predicate.Index ); CHR( ']' ); if (inst->Predicate.SwizzleX != TGSI_SWIZZLE_X || inst->Predicate.SwizzleY != TGSI_SWIZZLE_Y || inst->Predicate.SwizzleZ != TGSI_SWIZZLE_Z || inst->Predicate.SwizzleW != TGSI_SWIZZLE_W) { CHR( '.' ); ENM( inst->Predicate.SwizzleX, tgsi_swizzle_names ); ENM( inst->Predicate.SwizzleY, tgsi_swizzle_names ); ENM( inst->Predicate.SwizzleZ, tgsi_swizzle_names ); ENM( inst->Predicate.SwizzleW, tgsi_swizzle_names ); } TXT( ") " ); } TXT( info->mnemonic ); switch (inst->Instruction.Saturate) { case TGSI_SAT_NONE: break; case TGSI_SAT_ZERO_ONE: TXT( "_SAT" ); break; case TGSI_SAT_MINUS_PLUS_ONE: TXT( "_SATNV" ); break; default: assert( 0 ); } for (i = 0; i < inst->Instruction.NumDstRegs; i++) { const struct tgsi_full_dst_register *dst = &inst->Dst[i]; if (!first_reg) CHR( ',' ); CHR( ' ' ); _dump_register_dst( ctx, dst ); _dump_writemask( ctx, dst->Register.WriteMask ); first_reg = FALSE; } for (i = 0; i < inst->Instruction.NumSrcRegs; i++) { const struct tgsi_full_src_register *src = &inst->Src[i]; if (!first_reg) CHR( ',' ); CHR( ' ' ); if (src->Register.Negate) CHR( '-' ); if (src->Register.Absolute) CHR( '|' ); _dump_register_src(ctx, src); if (src->Register.SwizzleX != TGSI_SWIZZLE_X || src->Register.SwizzleY != TGSI_SWIZZLE_Y || src->Register.SwizzleZ != TGSI_SWIZZLE_Z || src->Register.SwizzleW != TGSI_SWIZZLE_W) { CHR( '.' ); ENM( src->Register.SwizzleX, tgsi_swizzle_names ); ENM( src->Register.SwizzleY, tgsi_swizzle_names ); ENM( src->Register.SwizzleZ, tgsi_swizzle_names ); ENM( src->Register.SwizzleW, tgsi_swizzle_names ); } if (src->Register.Absolute) CHR( '|' ); first_reg = FALSE; } if (inst->Instruction.Texture) { TXT( ", " ); ENM( inst->Texture.Texture, tgsi_texture_names ); for (i = 0; i < inst->Texture.NumOffsets; i++) { TXT( ", " ); ENM( inst->TexOffsets[i].File, tgsi_file_names); CHR( '[' ); SID( inst->TexOffsets[i].Index ); CHR( ']' ); CHR( '.' ); ENM( inst->TexOffsets[i].SwizzleX, tgsi_swizzle_names); ENM( inst->TexOffsets[i].SwizzleY, tgsi_swizzle_names); ENM( inst->TexOffsets[i].SwizzleZ, tgsi_swizzle_names); } } switch (inst->Instruction.Opcode) { case TGSI_OPCODE_IF: case TGSI_OPCODE_UIF: case TGSI_OPCODE_ELSE: case TGSI_OPCODE_BGNLOOP: case TGSI_OPCODE_ENDLOOP: case TGSI_OPCODE_CAL: TXT( " :" ); UID( inst->Label.Label ); break; } /* update indentation */ if (inst->Instruction.Opcode == TGSI_OPCODE_IF || inst->Instruction.Opcode == TGSI_OPCODE_UIF || inst->Instruction.Opcode == TGSI_OPCODE_ELSE || inst->Instruction.Opcode == TGSI_OPCODE_BGNLOOP) { ctx->indentation += indent_spaces; } EOL(); return TRUE; }
void Sav6::trade(std::shared_ptr<PKX> pk) { PK6 *pk6 = (PK6*)pk.get(); if (pk6->egg()) { if (otName() != pk6->otName() || TID() != pk6->TID() || SID() != pk6->SID() || gender() != pk6->otGender()) { pk6->metDay(Configuration::getInstance().day()); pk6->metMonth(Configuration::getInstance().month()); pk6->metYear(Configuration::getInstance().year() - 2000); pk6->metLocation(30002); } return; } else if (otName() == pk6->otName() && TID() == pk6->TID() && SID() == pk6->SID() && gender() == pk6->otGender()) { pk6->currentHandler(0); if (!pk6->untraded() && (country() != pk6->geoCountry(0) || subRegion() != pk6->geoRegion(0))) { for (int i = 4; i > 0; i--) { pk6->geoCountry(pk6->geoCountry(i - 1), i); pk6->geoRegion(pk6->geoRegion(i - 1), i); } pk6->geoCountry(country()); pk6->geoRegion(subRegion()); } } else { if (otName() != pk6->htName() || gender() != pk6->htGender() || (pk6->geoCountry(0) == 0 && pk6->geoRegion(0) == 0 && !pk6->untradedEvent())) { for (int i = 4; i > 0; i--) { pk6->geoCountry(pk6->geoCountry(i - 1), i); pk6->geoRegion(pk6->geoRegion(i - 1), i); } pk6->geoCountry(country()); pk6->geoRegion(subRegion()); } if (pk6->htName() != otName()) { pk6->htFriendship(pk6->baseFriendship()); pk6->htAffection(0); pk6->htName(otName()); } pk6->currentHandler(1); pk6->htGender(gender()); if (pk6->htMemory() == 0) { pk6->htMemory(4); pk6->htTextVar(9); pk6->htIntensity(1); /*static constexpr u32 memoryBits[70] = { 0x000000, 0x04CBFD, 0x004BFD, 0x04CBFD, 0x04CBFD, 0xFFFBFB, 0x84FFF9, 0x47FFFF, 0xBF7FFA, 0x7660B0, 0x80BDF9, 0x88FB7A, 0x083F79, 0x0001FE, 0xCFEFFF, 0x84EBAF, 0xB368B0, 0x091F7E, 0x0320A0, 0x080DDD, 0x081A7B, 0x404030, 0x0FFFFF, 0x9A08BC, 0x089A7B, 0x0032AA, 0x80FF7A, 0x0FFFFF, 0x0805FD, 0x098278, 0x0B3FFF, 0x8BBFFA, 0x8BBFFE, 0x81A97C, 0x8BB97C, 0x8BBF7F, 0x8BBF7F, 0x8BBF7F, 0x8BBF7F, 0xAC3ABE, 0xBFFFFF, 0x8B837C, 0x848AFA, 0x88FFFE, 0x8B0B7C, 0xB76AB2, 0x8B1FFF, 0xBE7AB8, 0xB77EB8, 0x8C9FFD, 0xBF9BFF, 0xF408B0, 0xBCFE7A, 0x8F3F72, 0x90DB7A, 0xBCEBFF, 0xBC5838, 0x9C3FFE, 0x9CFFFF, 0x96D83A, 0xB770B0, 0x881F7A, 0x839F7A, 0x839F7A, 0x839F7A, 0x53897F, 0x41BB6F, 0x0C35FF, 0x8BBF7F, 0x8BBF7F };*/ u32 bits = 0x04CBFD; //memoryBits[pk6->htMemory()]; while (true) { u32 feel = randomNumbers() % 20; if ((bits & (1 << feel)) != 0) { pk6->htFeeling(feel); break; } } } } }
void SpriteSheet::add(const char* name, const Rect& r) { SheetEntry entry; entry.hash = SID(name); entry.texture = Texture(r); _entries.push_back(entry); }
static boolean iter_declaration( struct tgsi_iterate_context *iter, struct tgsi_full_declaration *decl ) { struct dump_ctx *ctx = (struct dump_ctx *)iter; TXT( "DCL " ); ENM(decl->Declaration.File, tgsi_file_names); /* all geometry shader inputs are two dimensional */ if (decl->Declaration.File == TGSI_FILE_INPUT && iter->processor.Processor == TGSI_PROCESSOR_GEOMETRY) { TXT("[]"); } if (decl->Declaration.Dimension) { CHR('['); SID(decl->Dim.Index2D); CHR(']'); } CHR('['); SID(decl->Range.First); if (decl->Range.First != decl->Range.Last) { TXT(".."); SID(decl->Range.Last); } CHR(']'); _dump_writemask( ctx, decl->Declaration.UsageMask ); if (decl->Declaration.Array) { TXT( ", ARRAY(" ); SID(decl->Array.ArrayID); CHR(')'); } if (decl->Declaration.Local) TXT( ", LOCAL" ); if (decl->Declaration.Semantic) { TXT( ", " ); ENM( decl->Semantic.Name, tgsi_semantic_names ); if (decl->Semantic.Index != 0 || decl->Semantic.Name == TGSI_SEMANTIC_TEXCOORD || decl->Semantic.Name == TGSI_SEMANTIC_GENERIC) { CHR( '[' ); UID( decl->Semantic.Index ); CHR( ']' ); } } if (decl->Declaration.File == TGSI_FILE_RESOURCE) { TXT(", "); ENM(decl->Resource.Resource, tgsi_texture_names); if (decl->Resource.Writable) TXT(", WR"); if (decl->Resource.Raw) TXT(", RAW"); } if (decl->Declaration.File == TGSI_FILE_SAMPLER_VIEW) { TXT(", "); ENM(decl->SamplerView.Resource, tgsi_texture_names); TXT(", "); if ((decl->SamplerView.ReturnTypeX == decl->SamplerView.ReturnTypeY) && (decl->SamplerView.ReturnTypeX == decl->SamplerView.ReturnTypeZ) && (decl->SamplerView.ReturnTypeX == decl->SamplerView.ReturnTypeW)) { ENM(decl->SamplerView.ReturnTypeX, tgsi_type_names); } else { ENM(decl->SamplerView.ReturnTypeX, tgsi_type_names); TXT(", "); ENM(decl->SamplerView.ReturnTypeY, tgsi_type_names); TXT(", "); ENM(decl->SamplerView.ReturnTypeZ, tgsi_type_names); TXT(", "); ENM(decl->SamplerView.ReturnTypeW, tgsi_type_names); } } if (decl->Declaration.Interpolate) { if (iter->processor.Processor == TGSI_PROCESSOR_FRAGMENT && decl->Declaration.File == TGSI_FILE_INPUT) { TXT( ", " ); ENM( decl->Interp.Interpolate, tgsi_interpolate_names ); } if (decl->Interp.Centroid) { TXT( ", CENTROID" ); } if (decl->Interp.CylindricalWrap) { TXT(", CYLWRAP_"); if (decl->Interp.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_X) { CHR('X'); } if (decl->Interp.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_Y) { CHR('Y'); } if (decl->Interp.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_Z) { CHR('Z'); } if (decl->Interp.CylindricalWrap & TGSI_CYLINDRICAL_WRAP_W) { CHR('W'); } } } if (decl->Declaration.Invariant) { TXT( ", INVARIANT" ); } EOL(); return TRUE; }
/* * Determine the appropriate scope zone ID for in6 and ifp. If ret_id is * non NULL, it is set to the zone ID. If the zone ID needs to be embedded * in the in6_addr structure, in6 will be modified. * * ret_id - unnecessary? */ int in6_setscope(struct in6_addr *in6, struct ifnet *ifp, u_int32_t *ret_id) { int scope; u_int32_t zoneid = 0; struct scope6_id *sid; /* * special case: the loopback address can only belong to a loopback * interface. */ if (IN6_IS_ADDR_LOOPBACK(in6)) { if (!(ifp->if_flags & IFF_LOOPBACK)) { return (EINVAL); } else { if (ret_id != NULL) *ret_id = 0; /* there's no ambiguity */ return (0); } } scope = in6_addrscope(in6); if_inet6data_lock_shared(ifp); if (IN6_IFEXTRA(ifp) == NULL) { if_inet6data_lock_done(ifp); if (ret_id) *ret_id = 0; return (EINVAL); } sid = SID(ifp); switch (scope) { case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */ zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL]; break; case IPV6_ADDR_SCOPE_LINKLOCAL: zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL]; break; case IPV6_ADDR_SCOPE_SITELOCAL: zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_SITELOCAL]; break; case IPV6_ADDR_SCOPE_ORGLOCAL: zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_ORGLOCAL]; break; default: zoneid = 0; /* XXX: treat as global. */ break; } if_inet6data_lock_done(ifp); if (ret_id != NULL) *ret_id = zoneid; if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6)) in6->s6_addr16[1] = htons(zoneid & 0xffff); /* XXX */ return (0); }
static void dump_instruction_verbose( struct tgsi_full_instruction *inst, unsigned ignored, unsigned deflt, struct tgsi_full_instruction *fi ) { unsigned i; TXT( "\nOpcode : OPCODE_" ); TXT( tgsi_get_opcode_info( inst->Instruction.Opcode )->mnemonic ); if( deflt || fi->Instruction.Saturate != inst->Instruction.Saturate ) { TXT( "\nSaturate : " ); ENM( inst->Instruction.Saturate, TGSI_SATS ); } if( deflt || fi->Instruction.NumDstRegs != inst->Instruction.NumDstRegs ) { TXT( "\nNumDstRegs : " ); UID( inst->Instruction.NumDstRegs ); } if( deflt || fi->Instruction.NumSrcRegs != inst->Instruction.NumSrcRegs ) { TXT( "\nNumSrcRegs : " ); UID( inst->Instruction.NumSrcRegs ); } if( ignored ) { TXT( "\nPadding : " ); UIX( inst->Instruction.Padding ); } if( deflt || tgsi_compare_instruction_ext_nv( inst->InstructionExtNv, fi->InstructionExtNv ) ) { EOL(); TXT( "\nType : " ); ENM( inst->InstructionExtNv.Type, TGSI_INSTRUCTION_EXTS ); if( deflt || fi->InstructionExtNv.Precision != inst->InstructionExtNv.Precision ) { TXT( "\nPrecision : " ); ENM( inst->InstructionExtNv.Precision, TGSI_PRECISIONS ); } if( deflt || fi->InstructionExtNv.CondDstIndex != inst->InstructionExtNv.CondDstIndex ) { TXT( "\nCondDstIndex : " ); UID( inst->InstructionExtNv.CondDstIndex ); } if( deflt || fi->InstructionExtNv.CondFlowIndex != inst->InstructionExtNv.CondFlowIndex ) { TXT( "\nCondFlowIndex : " ); UID( inst->InstructionExtNv.CondFlowIndex ); } if( deflt || fi->InstructionExtNv.CondMask != inst->InstructionExtNv.CondMask ) { TXT( "\nCondMask : " ); ENM( inst->InstructionExtNv.CondMask, TGSI_CCS ); } if( deflt || fi->InstructionExtNv.CondSwizzleX != inst->InstructionExtNv.CondSwizzleX ) { TXT( "\nCondSwizzleX : " ); ENM( inst->InstructionExtNv.CondSwizzleX, TGSI_SWIZZLES ); } if( deflt || fi->InstructionExtNv.CondSwizzleY != inst->InstructionExtNv.CondSwizzleY ) { TXT( "\nCondSwizzleY : " ); ENM( inst->InstructionExtNv.CondSwizzleY, TGSI_SWIZZLES ); } if( deflt || fi->InstructionExtNv.CondSwizzleZ != inst->InstructionExtNv.CondSwizzleZ ) { TXT( "\nCondSwizzleZ : " ); ENM( inst->InstructionExtNv.CondSwizzleZ, TGSI_SWIZZLES ); } if( deflt || fi->InstructionExtNv.CondSwizzleW != inst->InstructionExtNv.CondSwizzleW ) { TXT( "\nCondSwizzleW : " ); ENM( inst->InstructionExtNv.CondSwizzleW, TGSI_SWIZZLES ); } if( deflt || fi->InstructionExtNv.CondDstUpdate != inst->InstructionExtNv.CondDstUpdate ) { TXT( "\nCondDstUpdate : " ); UID( inst->InstructionExtNv.CondDstUpdate ); } if( deflt || fi->InstructionExtNv.CondFlowEnable != inst->InstructionExtNv.CondFlowEnable ) { TXT( "\nCondFlowEnable: " ); UID( inst->InstructionExtNv.CondFlowEnable ); } if( ignored ) { TXT( "\nPadding : " ); UIX( inst->InstructionExtNv.Padding ); if( deflt || fi->InstructionExtNv.Extended != inst->InstructionExtNv.Extended ) { TXT( "\nExtended : " ); UID( inst->InstructionExtNv.Extended ); } } } if( deflt || tgsi_compare_instruction_ext_label( inst->InstructionExtLabel, fi->InstructionExtLabel ) ) { EOL(); TXT( "\nType : " ); ENM( inst->InstructionExtLabel.Type, TGSI_INSTRUCTION_EXTS ); if( deflt || fi->InstructionExtLabel.Label != inst->InstructionExtLabel.Label ) { TXT( "\nLabel : " ); UID( inst->InstructionExtLabel.Label ); } if( ignored ) { TXT( "\nPadding : " ); UIX( inst->InstructionExtLabel.Padding ); if( deflt || fi->InstructionExtLabel.Extended != inst->InstructionExtLabel.Extended ) { TXT( "\nExtended: " ); UID( inst->InstructionExtLabel.Extended ); } } } if( deflt || tgsi_compare_instruction_ext_texture( inst->InstructionExtTexture, fi->InstructionExtTexture ) ) { EOL(); TXT( "\nType : " ); ENM( inst->InstructionExtTexture.Type, TGSI_INSTRUCTION_EXTS ); if( deflt || fi->InstructionExtTexture.Texture != inst->InstructionExtTexture.Texture ) { TXT( "\nTexture : " ); ENM( inst->InstructionExtTexture.Texture, TGSI_TEXTURES ); } if( ignored ) { TXT( "\nPadding : " ); UIX( inst->InstructionExtTexture.Padding ); if( deflt || fi->InstructionExtTexture.Extended != inst->InstructionExtTexture.Extended ) { TXT( "\nExtended: " ); UID( inst->InstructionExtTexture.Extended ); } } } for( i = 0; i < inst->Instruction.NumDstRegs; i++ ) { struct tgsi_full_dst_register *dst = &inst->FullDstRegisters[i]; struct tgsi_full_dst_register *fd = &fi->FullDstRegisters[i]; EOL(); TXT( "\nFile : " ); ENM( dst->DstRegister.File, TGSI_FILES ); if( deflt || fd->DstRegister.WriteMask != dst->DstRegister.WriteMask ) { TXT( "\nWriteMask: " ); ENM( dst->DstRegister.WriteMask, TGSI_WRITEMASKS ); } if( ignored ) { if( deflt || fd->DstRegister.Indirect != dst->DstRegister.Indirect ) { TXT( "\nIndirect : " ); UID( dst->DstRegister.Indirect ); } if( deflt || fd->DstRegister.Dimension != dst->DstRegister.Dimension ) { TXT( "\nDimension: " ); UID( dst->DstRegister.Dimension ); } } if( deflt || fd->DstRegister.Index != dst->DstRegister.Index ) { TXT( "\nIndex : " ); SID( dst->DstRegister.Index ); } if( ignored ) { TXT( "\nPadding : " ); UIX( dst->DstRegister.Padding ); if( deflt || fd->DstRegister.Extended != dst->DstRegister.Extended ) { TXT( "\nExtended : " ); UID( dst->DstRegister.Extended ); } } if( deflt || tgsi_compare_dst_register_ext_concode( dst->DstRegisterExtConcode, fd->DstRegisterExtConcode ) ) { EOL(); TXT( "\nType : " ); ENM( dst->DstRegisterExtConcode.Type, TGSI_DST_REGISTER_EXTS ); if( deflt || fd->DstRegisterExtConcode.CondMask != dst->DstRegisterExtConcode.CondMask ) { TXT( "\nCondMask : " ); ENM( dst->DstRegisterExtConcode.CondMask, TGSI_CCS ); } if( deflt || fd->DstRegisterExtConcode.CondSwizzleX != dst->DstRegisterExtConcode.CondSwizzleX ) { TXT( "\nCondSwizzleX: " ); ENM( dst->DstRegisterExtConcode.CondSwizzleX, TGSI_SWIZZLES ); } if( deflt || fd->DstRegisterExtConcode.CondSwizzleY != dst->DstRegisterExtConcode.CondSwizzleY ) { TXT( "\nCondSwizzleY: " ); ENM( dst->DstRegisterExtConcode.CondSwizzleY, TGSI_SWIZZLES ); } if( deflt || fd->DstRegisterExtConcode.CondSwizzleZ != dst->DstRegisterExtConcode.CondSwizzleZ ) { TXT( "\nCondSwizzleZ: " ); ENM( dst->DstRegisterExtConcode.CondSwizzleZ, TGSI_SWIZZLES ); } if( deflt || fd->DstRegisterExtConcode.CondSwizzleW != dst->DstRegisterExtConcode.CondSwizzleW ) { TXT( "\nCondSwizzleW: " ); ENM( dst->DstRegisterExtConcode.CondSwizzleW, TGSI_SWIZZLES ); } if( deflt || fd->DstRegisterExtConcode.CondSrcIndex != dst->DstRegisterExtConcode.CondSrcIndex ) { TXT( "\nCondSrcIndex: " ); UID( dst->DstRegisterExtConcode.CondSrcIndex ); } if( ignored ) { TXT( "\nPadding : " ); UIX( dst->DstRegisterExtConcode.Padding ); if( deflt || fd->DstRegisterExtConcode.Extended != dst->DstRegisterExtConcode.Extended ) { TXT( "\nExtended : " ); UID( dst->DstRegisterExtConcode.Extended ); } } } if( deflt || tgsi_compare_dst_register_ext_modulate( dst->DstRegisterExtModulate, fd->DstRegisterExtModulate ) ) { EOL(); TXT( "\nType : " ); ENM( dst->DstRegisterExtModulate.Type, TGSI_DST_REGISTER_EXTS ); if( deflt || fd->DstRegisterExtModulate.Modulate != dst->DstRegisterExtModulate.Modulate ) { TXT( "\nModulate: " ); ENM( dst->DstRegisterExtModulate.Modulate, TGSI_MODULATES ); } if( ignored ) { TXT( "\nPadding : " ); UIX( dst->DstRegisterExtModulate.Padding ); if( deflt || fd->DstRegisterExtModulate.Extended != dst->DstRegisterExtModulate.Extended ) { TXT( "\nExtended: " ); UID( dst->DstRegisterExtModulate.Extended ); } } } } for( i = 0; i < inst->Instruction.NumSrcRegs; i++ ) { struct tgsi_full_src_register *src = &inst->FullSrcRegisters[i]; struct tgsi_full_src_register *fs = &fi->FullSrcRegisters[i]; EOL(); TXT( "\nFile : "); ENM( src->SrcRegister.File, TGSI_FILES ); if( deflt || fs->SrcRegister.SwizzleX != src->SrcRegister.SwizzleX ) { TXT( "\nSwizzleX : " ); ENM( src->SrcRegister.SwizzleX, TGSI_SWIZZLES ); } if( deflt || fs->SrcRegister.SwizzleY != src->SrcRegister.SwizzleY ) { TXT( "\nSwizzleY : " ); ENM( src->SrcRegister.SwizzleY, TGSI_SWIZZLES ); } if( deflt || fs->SrcRegister.SwizzleZ != src->SrcRegister.SwizzleZ ) { TXT( "\nSwizzleZ : " ); ENM( src->SrcRegister.SwizzleZ, TGSI_SWIZZLES ); } if( deflt || fs->SrcRegister.SwizzleW != src->SrcRegister.SwizzleW ) { TXT( "\nSwizzleW : " ); ENM( src->SrcRegister.SwizzleW, TGSI_SWIZZLES ); } if( deflt || fs->SrcRegister.Negate != src->SrcRegister.Negate ) { TXT( "\nNegate : " ); UID( src->SrcRegister.Negate ); } if( ignored ) { if( deflt || fs->SrcRegister.Indirect != src->SrcRegister.Indirect ) { TXT( "\nIndirect : " ); UID( src->SrcRegister.Indirect ); } if( deflt || fs->SrcRegister.Dimension != src->SrcRegister.Dimension ) { TXT( "\nDimension: " ); UID( src->SrcRegister.Dimension ); } } if( deflt || fs->SrcRegister.Index != src->SrcRegister.Index ) { TXT( "\nIndex : " ); SID( src->SrcRegister.Index ); } if( ignored ) { if( deflt || fs->SrcRegister.Extended != src->SrcRegister.Extended ) { TXT( "\nExtended : " ); UID( src->SrcRegister.Extended ); } } if( deflt || tgsi_compare_src_register_ext_swz( src->SrcRegisterExtSwz, fs->SrcRegisterExtSwz ) ) { EOL(); TXT( "\nType : " ); ENM( src->SrcRegisterExtSwz.Type, TGSI_SRC_REGISTER_EXTS ); if( deflt || fs->SrcRegisterExtSwz.ExtSwizzleX != src->SrcRegisterExtSwz.ExtSwizzleX ) { TXT( "\nExtSwizzleX: " ); ENM( src->SrcRegisterExtSwz.ExtSwizzleX, TGSI_EXTSWIZZLES ); } if( deflt || fs->SrcRegisterExtSwz.ExtSwizzleY != src->SrcRegisterExtSwz.ExtSwizzleY ) { TXT( "\nExtSwizzleY: " ); ENM( src->SrcRegisterExtSwz.ExtSwizzleY, TGSI_EXTSWIZZLES ); } if( deflt || fs->SrcRegisterExtSwz.ExtSwizzleZ != src->SrcRegisterExtSwz.ExtSwizzleZ ) { TXT( "\nExtSwizzleZ: " ); ENM( src->SrcRegisterExtSwz.ExtSwizzleZ, TGSI_EXTSWIZZLES ); } if( deflt || fs->SrcRegisterExtSwz.ExtSwizzleW != src->SrcRegisterExtSwz.ExtSwizzleW ) { TXT( "\nExtSwizzleW: " ); ENM( src->SrcRegisterExtSwz.ExtSwizzleW, TGSI_EXTSWIZZLES ); } if( deflt || fs->SrcRegisterExtSwz.NegateX != src->SrcRegisterExtSwz.NegateX ) { TXT( "\nNegateX : " ); UID( src->SrcRegisterExtSwz.NegateX ); } if( deflt || fs->SrcRegisterExtSwz.NegateY != src->SrcRegisterExtSwz.NegateY ) { TXT( "\nNegateY : " ); UID( src->SrcRegisterExtSwz.NegateY ); } if( deflt || fs->SrcRegisterExtSwz.NegateZ != src->SrcRegisterExtSwz.NegateZ ) { TXT( "\nNegateZ : " ); UID( src->SrcRegisterExtSwz.NegateZ ); } if( deflt || fs->SrcRegisterExtSwz.NegateW != src->SrcRegisterExtSwz.NegateW ) { TXT( "\nNegateW : " ); UID( src->SrcRegisterExtSwz.NegateW ); } if( ignored ) { TXT( "\nPadding : " ); UIX( src->SrcRegisterExtSwz.Padding ); if( deflt || fs->SrcRegisterExtSwz.Extended != src->SrcRegisterExtSwz.Extended ) { TXT( "\nExtended : " ); UID( src->SrcRegisterExtSwz.Extended ); } } } if( deflt || tgsi_compare_src_register_ext_mod( src->SrcRegisterExtMod, fs->SrcRegisterExtMod ) ) { EOL(); TXT( "\nType : " ); ENM( src->SrcRegisterExtMod.Type, TGSI_SRC_REGISTER_EXTS ); if( deflt || fs->SrcRegisterExtMod.Complement != src->SrcRegisterExtMod.Complement ) { TXT( "\nComplement: " ); UID( src->SrcRegisterExtMod.Complement ); } if( deflt || fs->SrcRegisterExtMod.Bias != src->SrcRegisterExtMod.Bias ) { TXT( "\nBias : " ); UID( src->SrcRegisterExtMod.Bias ); } if( deflt || fs->SrcRegisterExtMod.Scale2X != src->SrcRegisterExtMod.Scale2X ) { TXT( "\nScale2X : " ); UID( src->SrcRegisterExtMod.Scale2X ); } if( deflt || fs->SrcRegisterExtMod.Absolute != src->SrcRegisterExtMod.Absolute ) { TXT( "\nAbsolute : " ); UID( src->SrcRegisterExtMod.Absolute ); } if( deflt || fs->SrcRegisterExtMod.Negate != src->SrcRegisterExtMod.Negate ) { TXT( "\nNegate : " ); UID( src->SrcRegisterExtMod.Negate ); } if( ignored ) { TXT( "\nPadding : " ); UIX( src->SrcRegisterExtMod.Padding ); if( deflt || fs->SrcRegisterExtMod.Extended != src->SrcRegisterExtMod.Extended ) { TXT( "\nExtended : " ); UID( src->SrcRegisterExtMod.Extended ); } } } } }