public void DontSimplifySegmentStruct() { StructureType s = new StructureType(null, 0) { Fields = { { 0, PrimitiveType.Int32 } } }; s.IsSegment = true; DataType dt = s.Simplify(); Assert.AreEqual("(segment (0 int32 dw0000))", dt.ToString()); }
public void StrFldMerger_SingleMember() { StructureType str = new StructureType("foo", 0); str.Fields.Add(4, PrimitiveType.Word16); DataType dt = sfm.Merge(str); Assert.AreEqual("(struct \"foo\" (4 word16 w0004))", dt.ToString()); }
public void Setup() { var image = new LoadedImage(Address.Ptr32(0x00100000), new byte[1024]); var arch = new FakeArchitecture(); var program = new Program { Image = image, Architecture = arch, ImageMap = image.CreateImageMap(), Platform = new DefaultPlatform(null, arch), }; store = program.TypeStore; factory = program.TypeFactory; globals = program.Globals; store.EnsureExpressionTypeVariable(factory, globals); StructureType s = new StructureType(null, 0); s.Fields.Add(0x00100000, PrimitiveType.Word32, null); TypeVariable tvGlobals = store.EnsureExpressionTypeVariable(factory, globals); EquivalenceClass eqGlobals = new EquivalenceClass(tvGlobals); eqGlobals.DataType = s; globals.TypeVariable.DataType = new Pointer(eqGlobals, 4); globals.DataType = globals.TypeVariable.DataType; tcr = new TypedConstantRewriter(program); }
public void UnifyStructsSameSize() { StructureType s1 = new StructureType(null, 20); StructureType s2 = new StructureType(null, 20); StructureType m = (StructureType) un.Unify(s1, s2); Assert.AreEqual(20, m.Size); }
public AddStructure(Position position, StructureType structureType, Facing frontFace) : this() { Position = position; StructureType = structureType; FrontFace = frontFace; }
public DataType CreateDataType() { var str = new StructureType("foo", 0); str.Fields.Add(0, PrimitiveType.Int32); str.Fields.Add(4, new Pointer(str, 4)); return str; }
public void Setup() { mem = new MemoryArea(Address.Ptr32(0x00100000), new byte[1024]); var arch = new FakeArchitecture(); this.program = new Program { Architecture = arch, SegmentMap = new SegmentMap( mem.BaseAddress, new ImageSegment(".text", mem, AccessMode.ReadWriteExecute)), Platform = new DefaultPlatform(null, arch), }; store = program.TypeStore; factory = program.TypeFactory; globals = program.Globals; store.EnsureExpressionTypeVariable(factory, globals); StructureType s = new StructureType(null, 0); s.Fields.Add(0x00100000, PrimitiveType.Word32, null); TypeVariable tvGlobals = store.EnsureExpressionTypeVariable(factory, globals); EquivalenceClass eqGlobals = new EquivalenceClass(tvGlobals); eqGlobals.DataType = s; globals.TypeVariable.DataType = new Pointer(eqGlobals, 4); globals.DataType = globals.TypeVariable.DataType; }
public override DataType VisitStructure(StructureType str) { if (visitedTypes.Contains(str)) return str; visitedTypes.Add(str); return base.VisitStructure(str); }
public void MergeStaggeredArrays2() { StructureType s = new StructureType(null, 0); AddArrayField(s, 0, 8, PrimitiveType.Int32); AddArrayField(s, 4, 8, PrimitiveType.Int32); trans.MergeStaggeredArrays(s); Assert.AreEqual("(struct (0 (arr (struct 0008 (0 int32 dw0000) (4 int32 dw0004))) a0000))", s.ToString()); }
public void DTS_issue_113() { // This recursive structure shoudn't blow up the stack. var str = new StructureType("foo", 0); str.Fields.Add(0, new Pointer(str, 4), "bar"); var sStr = str.Accept(new DataTypeSerializer()); Assert.AreEqual("struct(foo, (0, bar, ptr(struct(foo, ))))", sStr.ToString()); }
public void UnifyStructs() { StructureType m1 = new StructureType { Fields = { { 4, PrimitiveType.Word32 } } }; StructureType m2 = new StructureType { Fields = { { 8, PrimitiveType.Word32 } } }; StructureType m = (StructureType) un.Unify(m1, m2); Assert.AreEqual(2, m.Fields.Count); }
public BlockStructure(string DefaultType) { if (DefaultType == "Tree") { MyBlocks.Size = new Vector3 (6, 9, 6); MyType = StructureType.Tree; } MyBlocks.InitilizeData (); UpdateBlockStructureWithType (); }
private StructureType BuildStaggeredArrays() { StructureType s = new StructureType(null, 0); s.Fields.Add(4, new ArrayType(new StructureType(null, 20) { Fields = { { 0, PrimitiveType.Int32 } } }, 0)); s.Fields.Add(8, new ArrayType(new StructureType(null, 20) { Fields = { { 0, PrimitiveType.Real64} } }, 0)); s.Fields.Add(12,new ArrayType(new StructureType(null, 20) { Fields = { { 0, PrimitiveType.Byte } } }, 0)); return s; }
private StructureType BuildDistinctArrays() { StructureType s = new StructureType(null, 0); AddArrayField(s, 0, 20, PrimitiveType.Int32); AddArrayField(s, 4, 20, PrimitiveType.Int32); AddArrayField(s, 40, 20, PrimitiveType.Real32); AddArrayField(s, 44, 20, PrimitiveType.Real32); return s; }
public void HasNoCoincidentFields() { StructureType s = new StructureType(null, 0); s.Fields.Add(4, new TypeVariable(1)); s.Fields.Add(5, PrimitiveType.Word16); Assert.AreEqual(2, s.Fields.Count); TypeTransformer trans = new TypeTransformer(factory, null, null); Assert.IsFalse(trans.HasCoincidentFields(s)); }
public Structure(Vector2Int location, User owner, StructureType type) { _commands = new Dictionary<string, Command>(); Squads = new List<Squad>(); Enabled = true; Location = location; Owner = owner; Type = type; }
public void MergeOffsetStructures() { StructureType s1 = new StructureType(null, 20); s1.Fields.Add(0, PrimitiveType.Int32); StructureType s2 = new StructureType(null, 20); s2.Fields.Add(0, PrimitiveType.Real32); DataType dt = trans.MergeOffsetStructures(s1, 4, s2, 8); Assert.AreEqual("(struct 0014 (0 int32 dw0000) (4 real32 r0004))", dt.ToString()); }
public Structure(StructureType structureType, int _floor) { IronTowerDBContext db = new IronTowerDBContext(); // Game game = db.Games.FirstOrDefault(); // this.Game = game; switch (structureType) { case StructureType.Laundry: this.Floor = _floor; this.Income = 1; this.InitialCost = 1; this.IsResidence = false; this.PopulationCost = 1; this.SupportedPopulation = 0; this.Type = StructureType.Laundry; this.UpKeep = 1; break; case StructureType.Restaurant: this.Floor = _floor; this.Income = 2; this.InitialCost = 1; this.IsResidence = false; this.PopulationCost = 3; this.SupportedPopulation = 0; this.Type = StructureType.Restaurant; this.UpKeep = 1; break; case StructureType.AmusementPark: this.Floor = _floor; this.Income = 3; this.InitialCost = 3; this.IsResidence = false; this.PopulationCost = 1; this.SupportedPopulation = 0; this.Type = StructureType.AmusementPark; this.UpKeep = 1; break; case StructureType.Residence: this.Floor = _floor; this.Income = 0; this.InitialCost = 1; this.IsResidence = true; this.PopulationCost = 0; this.SupportedPopulation = 5; this.Type = StructureType.Residence; this.UpKeep = 1; break; default: break; } }
public void CmpRecursiveEqualStructs() { // struct str1{struct *str2} == struct str2{struct *str1} StructureType s1 = new StructureType(); StructureType s2 = new StructureType(); s1.Fields.Add(0, new Pointer(s2, 4)); s2.Fields.Add(0, new Pointer(s1, 4)); DataTypeComparer c = new DataTypeComparer(); Assert.AreEqual(0, c.Compare(s1, s2)); }
public void StrFldMerger_FindOverlappingCluster() { StructureType str = new StructureType("foo", 0); str.Fields.Add(2, PrimitiveType.Word32); str.Fields.Add(4, PrimitiveType.Word32); foreach (List<StructureField> cluster in sfm.GetOverlappingClusters(str.Fields)) { Assert.AreEqual(2, cluster.Count); } }
public string GenerateTableStructure(ServerModel server, StructureType gentype, List<TableModel> tables) { try { return scriptData.GenerateTableStructure(server, gentype, tables); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void TyfoMem() { StructureType m = new StructureType( "foo", 0); m.Fields.Add(4, PrimitiveType.UInt16); m.Fields.Add(8, new Pointer(PrimitiveType.UInt32, 4)); tyfo.Write(m, "bar"); Assert.AreEqual( @"struct foo { uint16 w0004; // 4 uint32 * ptr0008; // 8 } bar", sw.ToString()); }
private void Globals(params StructureField[] fields) { var arch = new Mocks.FakeArchitecture(); this.prog = new Program( image, image.CreateImageMap(), arch, new DefaultPlatform(null, arch)); var globalStruct = new StructureType(); globalStruct.Fields.AddRange(fields); prog.Globals.TypeVariable = new TypeVariable("globals_t", 1) { DataType = globalStruct }; var ptr = new Pointer(globalStruct, 4); prog.Globals.TypeVariable.DataType = ptr; }
public ChartForm(BenchmarkType type, StructureType types, int start, int count, int step, int control) { InitializeComponent(); var task = Task.Factory.StartNew(() => GenerateBenchmarks(type, types, start, count, step, control), TaskCreationOptions.LongRunning); task.ContinueWith(ancestor => { foreach (var series in ConvertAllSeries(ancestor.Result, type == BenchmarkType.Memory)) Chart.Series.Add(series); Chart.Visible = true; ProgressBarPanel.Visible = false; if ((type & BenchmarkType.Memory) > 0) Chart.ChartAreas[0].AxisY.Title = "Memory (MB)"; }, TaskScheduler.FromCurrentSynchronizationContext()); }
public void StructureContainingArray() { ArrayType a = new ArrayType(PrimitiveType.Int32, 4); StructureType s = new StructureType(null, 0) { Fields = { { 8, a } } }; TypeVariable tv = store.CreateTypeVariable(factory); tv.Class.DataType = s; Assert.AreEqual(1, store.UsedEquivalenceClasses.Count); DataType dt = tv.Class.DataType.Accept(nct); Assert.AreEqual(1, store.UsedEquivalenceClasses.Count); Assert.AreEqual("(struct (8 (arr int32 4) a0008))", store.UsedEquivalenceClasses[0].DataType.ToString()); }
public void StrFldMerger_FindOverLappingClusterWithEqv() { StructureType str = new StructureType("foo", 0); UnionType u = new UnionType(null, null, PrimitiveType.Pointer32, PrimitiveType.Word16); EquivalenceClass eq = Eqv(u); str.Fields.Add(2, eq); str.Fields.Add(4, PrimitiveType.SegmentSelector); IEnumerable<List<StructureField>> eb = sfm.GetOverlappingClusters(str.Fields); IEnumerator<List<StructureField>> e = eb.GetEnumerator(); Assert.IsTrue(e.MoveNext()); Assert.AreEqual(3, e.Current.Count); List<StructureField> cluster = e.Current; }
public void Merge1() { TypeVariable tv1 = new TypeVariable(1); TypeVariable tv2 = new TypeVariable(2); StructureType s1 = new StructureType { Fields = { { 4, PrimitiveType.Pointer32 } } }; StructureType s2 = new StructureType { Fields = { { 4, PrimitiveType.Pointer32 } } }; EquivalenceClass c1 = new EquivalenceClass(tv1); EquivalenceClass c2 = new EquivalenceClass(tv2); c1.DataType = s1; c2.DataType = s2; StructureMerger sm = new StructureMerger(new StructureType[] { s1, s2 }, new EquivalenceClass[] { c1, c2 } ); sm.Merge(); Assert.AreEqual("(struct (4 ptr32 ptr0004))", c1.DataType.ToString()); }
/// <summary> /// Inserts a frame pointer assignment at the beginning of the procedure /// </summary> /// <remarks> /// The frame pointer assignment needs a block of its own, as placing it in the /// "entryBlock" wreaks havoc with SSA assignments &c. /// </remarks> public void InsertFramePointerAssignment(IProcessorArchitecture arch) { Block b = proc.AddBlock(proc.Name + "_frame_asgn"); Block s = proc.EntryBlock.Succ[0]; proc.ControlGraph.RemoveEdge(proc.EntryBlock, s); proc.ControlGraph.AddEdge(proc.EntryBlock, b); proc.ControlGraph.AddEdge(b, s); StructureType st = new StructureType(proc.Name + "_frame_t", 0); Identifier frame = proc.Frame.CreateTemporary(proc.Name + "_frame", st); b.Statements.Add( 0, new Assignment( proc.Frame.FramePointer, new UnaryExpression(Operator.AddrOf, arch.FramePointerType, frame))); }
public void CmpRecursiveNotEqualStructs() { // struct str1{struct *str2; int f1} != struct str2{struct *str1; float f2} DataType u32 = PrimitiveType.UInt32; DataType r32 = PrimitiveType.Real32; StructureType s1 = new StructureType(); StructureType s2 = new StructureType(); s1.Fields.Add(0, new Pointer(s2, 4)); s1.Fields.Add(4, u32); s2.Fields.Add(0, new Pointer(s1, 4)); s2.Fields.Add(4, r32); DataTypeComparer c = new DataTypeComparer(); Assert.AreNotEqual(0, c.Compare(s1, s2)); Assert.AreNotEqual(0, c.Compare(r32, u32)); }
public void Setup() { var image = new LoadedImage(Address.Ptr32(0x00400000), new byte[1024]); var arch = new FakeArchitecture(); program = new Program { Architecture = arch, Image = image, ImageMap = image.CreateImageMap(), Platform = new DefaultPlatform(null, arch) }; store = program.TypeStore; factory = program.TypeFactory; point = new StructureType(null, 0); point.Fields.Add(0, PrimitiveType.Word32, null); point.Fields.Add(4, PrimitiveType.Word32, null); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PhysicalDeviceSparseImageFormatInfo2); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.VideoEncodeH264SessionParametersCreateInfoExt); }
public PhysicalDeviceVulkan12Features ( StructureType sType = StructureType.PhysicalDeviceVulkan12Features, void *pNext = default, Bool32 samplerMirrorClampToEdge = default, Bool32 drawIndirectCount = default, Bool32 storageBuffer8BitAccess = default, Bool32 uniformAndStorageBuffer8BitAccess = default, Bool32 storagePushConstant8 = default, Bool32 shaderBufferInt64Atomics = default, Bool32 shaderSharedInt64Atomics = default, Bool32 shaderFloat16 = default, Bool32 shaderInt8 = default, Bool32 descriptorIndexing = default, Bool32 shaderInputAttachmentArrayDynamicIndexing = default, Bool32 shaderUniformTexelBufferArrayDynamicIndexing = default, Bool32 shaderStorageTexelBufferArrayDynamicIndexing = default, Bool32 shaderUniformBufferArrayNonUniformIndexing = default, Bool32 shaderSampledImageArrayNonUniformIndexing = default, Bool32 shaderStorageBufferArrayNonUniformIndexing = default, Bool32 shaderStorageImageArrayNonUniformIndexing = default, Bool32 shaderInputAttachmentArrayNonUniformIndexing = default, Bool32 shaderUniformTexelBufferArrayNonUniformIndexing = default, Bool32 shaderStorageTexelBufferArrayNonUniformIndexing = default, Bool32 descriptorBindingUniformBufferUpdateAfterBind = default, Bool32 descriptorBindingSampledImageUpdateAfterBind = default, Bool32 descriptorBindingStorageImageUpdateAfterBind = default, Bool32 descriptorBindingStorageBufferUpdateAfterBind = default, Bool32 descriptorBindingUniformTexelBufferUpdateAfterBind = default, Bool32 descriptorBindingStorageTexelBufferUpdateAfterBind = default, Bool32 descriptorBindingUpdateUnusedWhilePending = default, Bool32 descriptorBindingPartiallyBound = default, Bool32 descriptorBindingVariableDescriptorCount = default, Bool32 runtimeDescriptorArray = default, Bool32 samplerFilterMinmax = default, Bool32 scalarBlockLayout = default, Bool32 imagelessFramebuffer = default, Bool32 uniformBufferStandardLayout = default, Bool32 shaderSubgroupExtendedTypes = default, Bool32 separateDepthStencilLayouts = default, Bool32 hostQueryReset = default, Bool32 timelineSemaphore = default, Bool32 bufferDeviceAddress = default, Bool32 bufferDeviceAddressCaptureReplay = default, Bool32 bufferDeviceAddressMultiDevice = default, Bool32 vulkanMemoryModel = default, Bool32 vulkanMemoryModelDeviceScope = default, Bool32 vulkanMemoryModelAvailabilityVisibilityChains = default, Bool32 shaderOutputViewportIndex = default, Bool32 shaderOutputLayer = default, Bool32 subgroupBroadcastDynamicId = default ) { SType = sType; PNext = pNext; SamplerMirrorClampToEdge = samplerMirrorClampToEdge; DrawIndirectCount = drawIndirectCount; StorageBuffer8BitAccess = storageBuffer8BitAccess; UniformAndStorageBuffer8BitAccess = uniformAndStorageBuffer8BitAccess; StoragePushConstant8 = storagePushConstant8; ShaderBufferInt64Atomics = shaderBufferInt64Atomics; ShaderSharedInt64Atomics = shaderSharedInt64Atomics; ShaderFloat16 = shaderFloat16; ShaderInt8 = shaderInt8; DescriptorIndexing = descriptorIndexing; ShaderInputAttachmentArrayDynamicIndexing = shaderInputAttachmentArrayDynamicIndexing; ShaderUniformTexelBufferArrayDynamicIndexing = shaderUniformTexelBufferArrayDynamicIndexing; ShaderStorageTexelBufferArrayDynamicIndexing = shaderStorageTexelBufferArrayDynamicIndexing; ShaderUniformBufferArrayNonUniformIndexing = shaderUniformBufferArrayNonUniformIndexing; ShaderSampledImageArrayNonUniformIndexing = shaderSampledImageArrayNonUniformIndexing; ShaderStorageBufferArrayNonUniformIndexing = shaderStorageBufferArrayNonUniformIndexing; ShaderStorageImageArrayNonUniformIndexing = shaderStorageImageArrayNonUniformIndexing; ShaderInputAttachmentArrayNonUniformIndexing = shaderInputAttachmentArrayNonUniformIndexing; ShaderUniformTexelBufferArrayNonUniformIndexing = shaderUniformTexelBufferArrayNonUniformIndexing; ShaderStorageTexelBufferArrayNonUniformIndexing = shaderStorageTexelBufferArrayNonUniformIndexing; DescriptorBindingUniformBufferUpdateAfterBind = descriptorBindingUniformBufferUpdateAfterBind; DescriptorBindingSampledImageUpdateAfterBind = descriptorBindingSampledImageUpdateAfterBind; DescriptorBindingStorageImageUpdateAfterBind = descriptorBindingStorageImageUpdateAfterBind; DescriptorBindingStorageBufferUpdateAfterBind = descriptorBindingStorageBufferUpdateAfterBind; DescriptorBindingUniformTexelBufferUpdateAfterBind = descriptorBindingUniformTexelBufferUpdateAfterBind; DescriptorBindingStorageTexelBufferUpdateAfterBind = descriptorBindingStorageTexelBufferUpdateAfterBind; DescriptorBindingUpdateUnusedWhilePending = descriptorBindingUpdateUnusedWhilePending; DescriptorBindingPartiallyBound = descriptorBindingPartiallyBound; DescriptorBindingVariableDescriptorCount = descriptorBindingVariableDescriptorCount; RuntimeDescriptorArray = runtimeDescriptorArray; SamplerFilterMinmax = samplerFilterMinmax; ScalarBlockLayout = scalarBlockLayout; ImagelessFramebuffer = imagelessFramebuffer; UniformBufferStandardLayout = uniformBufferStandardLayout; ShaderSubgroupExtendedTypes = shaderSubgroupExtendedTypes; SeparateDepthStencilLayouts = separateDepthStencilLayouts; HostQueryReset = hostQueryReset; TimelineSemaphore = timelineSemaphore; BufferDeviceAddress = bufferDeviceAddress; BufferDeviceAddressCaptureReplay = bufferDeviceAddressCaptureReplay; BufferDeviceAddressMultiDevice = bufferDeviceAddressMultiDevice; VulkanMemoryModel = vulkanMemoryModel; VulkanMemoryModelDeviceScope = vulkanMemoryModelDeviceScope; VulkanMemoryModelAvailabilityVisibilityChains = vulkanMemoryModelAvailabilityVisibilityChains; ShaderOutputViewportIndex = shaderOutputViewportIndex; ShaderOutputLayer = shaderOutputLayer; SubgroupBroadcastDynamicId = subgroupBroadcastDynamicId; }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.AcquireNextImageInfoKhr); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.ImageResolve2Khr); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.FenceGetFDInfoKhr); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PhysicalDeviceConservativeRasterizationPropertiesExt); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PerformanceCounterDescriptionKhr); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PhysicalDeviceRepresentativeFragmentTestFeaturesNV); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.BufferOpaqueCaptureAddressCreateInfo); }
/// <summary> /// Initializes a new instance of the <see cref="DeviceGroupCommandBufferBeginInfoKhx"/> structure. /// </summary> /// <param name="deviceMask">The initial value of the command buffer's device mask.</param> /// <param name="next"> /// Is <see cref="IntPtr.Zero"/> or a pointer to an extension-specific structure. /// </param> public DeviceGroupCommandBufferBeginInfoKhx(int deviceMask, IntPtr next = default(IntPtr)) { Type = StructureType.DeviceGroupCommandBufferBeginInfoKhx; Next = next; DeviceMask = deviceMask; }
public int VisitStructure(StructureType str) { writer.Write("new StructureType({0})", str.Name ?? "<not-set>"); return(0); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PhysicalDeviceShaderFloat16Int8Features); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.DevicePrivateDataCreateInfoExt); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PhysicalDeviceExternalBufferInfo); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.MemoryAllocateFlagsInfo); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PipelineCreationFeedbackCreateInfoExt); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PhysicalDeviceProvokingVertexPropertiesExt); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PhysicalDeviceMaintenance4PropertiesKhr); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PipelineTessellationDomainOriginStateCreateInfo); }
public void Scanner_GlobalData() { var bytes = new byte[] { 0x48, 0x00, 0x21, 0x43, 0x00, 0x00, 0x00, 0x01, 0x53, 0x00, 0x21, 0x43, 0x28, 0x00, 0x21, 0x43, 0x00, 0x00, 0x00, 0x02, 0x63, 0x00, 0x21, 0x43, 0x38, 0x00, 0x21, 0x43, 0x00, 0x00, 0x00, 0x03, 0x73, 0x00, 0x21, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; Given_Program(Address.Ptr32(0x43210000), bytes); var project = new Project { Programs = { program } }; var sc = new Scanner( this.program, new ImportResolver(project, program, eventListener), this.sc ); var ft1 = Given_Serialized_Signature(new SerializedSignature { Convention = "__cdecl", ReturnValue = new Argument_v1 { Type = Int32() }, }); var ft2 = Given_Serialized_Signature(new SerializedSignature { ReturnValue = new Argument_v1 { Type = Char() } }); var str = new StructureType(); var fields = new StructureField[] { new StructureField(0, new Pointer(ft1, 32), "A"), new StructureField(4, PrimitiveType.Int32, "B"), new StructureField(8, new Pointer(ft2, 32), "C"), }; str.Fields.AddRange(fields); var elementType = new TypeReference("test", str); var arrayType = new ArrayType(elementType, 3); sc.EnqueueUserGlobalData(Address.Ptr32(0x43210000), arrayType, null); sc.ScanImage(); var sExpSig1 = @"Register ui32 sig1() // stackDelta: 4; fpuStackDelta: 0; fpuMaxParam: -1 "; var sExpSig2 = @"Register char sig2() // stackDelta: 4; fpuStackDelta: 0; fpuMaxParam: -1 "; Assert.AreEqual(6, program.Procedures.Count); Assert.AreEqual(sExpSig1, program.Procedures[Address.Ptr32(0x43210028)].Signature.ToString("sig1", FunctionType.EmitFlags.AllDetails)); Assert.AreEqual(sExpSig1, program.Procedures[Address.Ptr32(0x43210038)].Signature.ToString("sig1", FunctionType.EmitFlags.AllDetails)); Assert.AreEqual(sExpSig1, program.Procedures[Address.Ptr32(0x43210048)].Signature.ToString("sig1", FunctionType.EmitFlags.AllDetails)); Assert.AreEqual(sExpSig2, program.Procedures[Address.Ptr32(0x43210053)].Signature.ToString("sig2", FunctionType.EmitFlags.AllDetails)); Assert.AreEqual(sExpSig2, program.Procedures[Address.Ptr32(0x43210063)].Signature.ToString("sig2", FunctionType.EmitFlags.AllDetails)); Assert.AreEqual(sExpSig2, program.Procedures[Address.Ptr32(0x43210073)].Signature.ToString("sig2", FunctionType.EmitFlags.AllDetails)); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.RayTracingShaderGroupCreateInfoKhr); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.InitializePerformanceApiInfoIntel); }
/// <summary> /// Write instruction operands into bytecode stream. /// </summary> /// <param name="writer">Bytecode writer.</param> public override void WriteOperands(WordWriter writer) { StructureType.Write(writer); Member.Write(writer); Decoration.Write(writer); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PipelineExecutablePropertiesKhr); }
/// <exception cref="ArgumentNullException"> /// <paramref name="structType"/> is null. /// </exception> internal StructureShape(StructureType structure) : base(structure) { this.structure = structure; UpdateMinSize(); }
public int VisitStructure(StructureType str) { throw new NotImplementedException(); }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.SamplerYcbcrConversionImageFormatProperties); }
public ExpressionTypeAscenderBase(Program program, TypeFactory factory) { this.platform = program.Platform; this.globalFields = program.GlobalFields; this.factory = factory; }
/// <inheritdoc /> StructureType IStructuredType.StructureType() { return(SType = StructureType.PhysicalDeviceVulkan11Features); }