public unsafe void Update_ThenMapRead_1D() { if (!GD.Features.Texture1D) { return; } Texture tex1D = RF.CreateTexture( TextureDescription.Texture1D(100, 1, 1, PixelFormat.R16_UNorm, TextureUsage.Staging)); ushort[] data = Enumerable.Range(0, (int)tex1D.Width).Select(i => (ushort)(i * 2)).ToArray(); fixed(ushort *dataPtr = &data[0]) { GD.UpdateTexture(tex1D, (IntPtr)dataPtr, (uint)(data.Length * sizeof(ushort)), 0, 0, 0, tex1D.Width, 1, 1, 0, 0); } MappedResourceView <ushort> view = GD.Map <ushort>(tex1D, MapMode.Read); for (int i = 0; i < view.Count; i++) { Assert.Equal((ushort)(i * 2), view[i]); } GD.Unmap(tex1D); }
public void Copy_DifferentMip_1DTo2D() { Texture tex1D = RF.CreateTexture( TextureDescription.Texture1D(200, 2, 1, PixelFormat.R16_UNorm, TextureUsage.Staging)); Texture tex2D = RF.CreateTexture( TextureDescription.Texture2D(100, 10, 1, 1, PixelFormat.R16_UNorm, TextureUsage.Staging)); MappedResourceView <ushort> writeView = GD.Map <ushort>(tex1D, MapMode.Write, 1); Assert.Equal(tex2D.Width, (uint)writeView.Count); for (int i = 0; i < writeView.Count; i++) { writeView[i] = (ushort)(i * 2); } GD.Unmap(tex1D, 1); CommandList cl = RF.CreateCommandList(); cl.Begin(); cl.CopyTexture( tex1D, 0, 0, 0, 1, 0, tex2D, 0, 5, 0, 0, 0, tex2D.Width, 1, 1, 1); cl.End(); GD.SubmitCommands(cl); GD.DisposeWhenIdle(cl); GD.WaitForIdle(); MappedResourceView <ushort> readView = GD.Map <ushort>(tex2D, MapMode.Read); for (int i = 0; i < tex2D.Width; i++) { Assert.Equal((ushort)(i * 2), readView[i, 5]); } GD.Unmap(tex2D); }
public void FSPT_UpdateContent() { var repo = RF.ResolveInstance <FileInfoRepository>(); using (RF.TransactionScope(repo)) { var file = new FileInfo { Content = Encoding.UTF8.GetBytes("File Content") }; repo.Save(file); var file2 = repo.GetById(file.Id); file2.Content = Encoding.UTF8.GetBytes("File Content 2"); repo.Save(file2); var file3 = repo.GetById(file.Id); Assert.IsNotNull(file3.Content); var content = Encoding.UTF8.GetString(file3.Content); Assert.AreEqual("File Content 2", content); } }
public void APT_Login_Success() { var repo = RF.ResolveInstance <UserRepository>(); using (RF.TransactionScope(repo)) { var controller = DomainControllerFactory.Create <AccountController>(); controller.Register(new User { UserName = "******", RealName = "hqf", Password = controller.EncodePassword("hqf") }); User user = null; var res = controller.LoginByUserName("hqf", "hqf", out user); Assert.IsTrue(res.Success); Assert.IsNotNull(user); Assert.AreEqual("hqf", user.UserName); Assert.AreEqual("hqf", user.RealName); Assert.AreEqual(controller.EncodePassword("hqf"), user.Password); } }
private void VerifyOrCreateSolutionFolders(string folder) { foreach (RepositoryFolderBase RF in mSolutionRootFolders) { string dir = Path.Combine(mSolutionFolderPath, RF.FolderRelativePath.Replace(cSolutionRootFolderSign, "")); if (!Directory.Exists(PathHelper.GetLongPath(dir))) { Directory.CreateDirectory(PathHelper.GetLongPath(dir)); } RF.StartFileWatcher(); } //After we made sure we have root folders, we verify all again including sub folders var SRIIs = from x in mSolutionRepositoryItemInfoDictionary select x.Value; foreach (SolutionRepositoryItemInfoBase SRII in SRIIs) { string dir = Path.Combine(mSolutionFolderPath, SRII.ItemFileSystemRootFolder.Replace(cSolutionRootFolderSign, "")); if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } } }
public unsafe void Update_ThenMapRead_Succeeds_R16UNorm() { Texture texture = RF.CreateTexture( TextureDescription.Texture2D(1024, 1024, 1, 1, PixelFormat.R16_UNorm, TextureUsage.Staging)); ushort[] data = Enumerable.Range(0, 1024 * 1024).Select(i => (ushort)i).ToArray(); fixed(ushort *dataPtr = data) { GD.UpdateTexture(texture, (IntPtr)dataPtr, 1024 * 1024 * sizeof(ushort), 0, 0, 0, 1024, 1024, 1, 0, 0); } MappedResource map = GD.Map(texture, MapMode.Read, 0); ushort * mappedFloatPtr = (ushort *)map.Data; for (int y = 0; y < 1024; y++) { for (int x = 0; x < 1024; x++) { ushort index = (ushort)(y * 1024 + x); Assert.Equal(index, mappedFloatPtr[index]); } } }
public unsafe void UnusualSize() { DeviceBuffer src = RF.CreateBuffer( new BufferDescription(208, BufferUsage.UniformBuffer)); DeviceBuffer dst = RF.CreateBuffer( new BufferDescription(208, BufferUsage.Staging)); byte[] data = Enumerable.Range(0, 208).Select(i => (byte)(i * 150)).ToArray(); GD.UpdateBuffer(src, 0, data); CommandList cl = RF.CreateCommandList(); cl.Begin(); cl.CopyBuffer(src, 0, dst, 0, src.SizeInBytes); cl.End(); GD.SubmitCommands(cl); GD.WaitForIdle(); MappedResource readMap = GD.Map(dst, MapMode.Read); for (int i = 0; i < readMap.SizeInBytes; i++) { Assert.Equal((byte)(i * 150), ((byte *)readMap.Data)[i]); } }
public unsafe void Update_ThenMapRead_Succeeds_R32Float() { Texture texture = RF.CreateTexture( new TextureDescription(1024, 1024, 1, 1, 1, PixelFormat.R32_Float, TextureUsage.Staging)); float[] data = Enumerable.Range(0, 1024 * 1024).Select(i => (float)i).ToArray(); fixed(float *dataPtr = data) { GD.UpdateTexture(texture, (IntPtr)dataPtr, 1024 * 1024 * 4, 0, 0, 0, 1024, 1024, 1, 0, 0); } MappedResource map = GD.Map(texture, MapMode.Read, 0); float * mappedFloatPtr = (float *)map.Data; for (int y = 0; y < 1024; y++) { for (int x = 0; x < 1024; x++) { int index = y * 1024 + x; Assert.Equal(index, mappedFloatPtr[index]); } } }
public void EIT_StringId_Insert_DeplicateKey() { var repo = RF.ResolveInstance <HouseRepository>(); using (RF.TransactionScope(repo)) { repo.Save(new House { Id = "Id1" }); bool error = false; try { repo.Save(new House { Id = "Id1" }); } catch { error = true; } Assert.IsTrue(error, "重复的主键,必须报错。"); } }
private DeviceBuffer CreateBuffer(uint size, BufferUsage usage) { return(RF.CreateBuffer(new BufferDescription(size, usage))); }
public override void Execute(LogicalView view) { view.DataLoader.LoadDataAsync(() => RF.ResolveInstance <FrameworkInfoItemRepository>().GetAllOnClient()); }
/// <summary> /// 注册指定的用户。 /// </summary> /// <param name="user"></param> /// <returns></returns> public virtual Result Register(User user) { if (user == null) { throw new ArgumentNullException("user"); } var userNameAsId = _identityMode.HasFlag(UserIdentityMode.UserName); if (userNameAsId && string.IsNullOrEmpty(user.UserName)) { return(new Result(ResultCodes.RegisterUserNameInvalid, "用户名不能为空。")); } var emailAsId = _identityMode.HasFlag(UserIdentityMode.Email); if (emailAsId && !TextFormatter.ReEmail.IsMatch(user.Email)) { return(new Result(ResultCodes.RegisterEmailInvalid, "邮箱格式不正确。")); } if (!userNameAsId && !emailAsId) { throw new InvalidProgramException("!userNameAsId && !useEmailAsId"); } //验证其它属性。 var brokenRules = Validator.Validate(user); if (brokenRules.Count > 0) { return(new Result(ResultCodes.RegisterPropertiesInvalid, brokenRules.ToString())); } //检查用户名、邮箱的重复性。 var repo = RF.Concrete <UserRepository>(); var criteria = new CommonQueryCriteria(); criteria.Concat = BinaryOperator.Or; if (userNameAsId) { criteria.Add(new PropertyMatch(User.UserNameProperty, user.UserName)); } if (emailAsId) { criteria.Add(new PropertyMatch(User.EmailProperty, user.Email)); } var exists = repo.GetFirstBy(criteria); if (exists != null) { if (emailAsId && exists.Email == user.Email) { return(new Result(ResultCodes.RegisterEmailDuplicated, string.Format("注册失败,已经存在邮箱为:{0} 的用户。", user.Email))); } else { return(new Result(ResultCodes.RegisterUserNameDuplicated, string.Format("注册失败,已经存在用户名为:{0} 的用户。", user.UserName))); } } //保存这个用户 user.PersistenceStatus = PersistenceStatus.New; repo.Save(user); this.OnRegisterSuccessed(user); return(true); }
public void ET_Repository_SplitFiles() { var repo = RF.Find <Car>(); Assert.IsTrue(repo is CarRepository, "仓库和实体可以分离到两个项目中。"); }
public void BasicCompute() { if (!GD.Features.ComputeShader) { return; } ResourceLayout layout = RF.CreateResourceLayout(new ResourceLayoutDescription( new ResourceLayoutElementDescription("Params", ResourceKind.UniformBuffer, ShaderStages.Compute), new ResourceLayoutElementDescription("Source", ResourceKind.StructuredBufferReadWrite, ShaderStages.Compute), new ResourceLayoutElementDescription("Destination", ResourceKind.StructuredBufferReadWrite, ShaderStages.Compute))); uint width = 1024; uint height = 1024; DeviceBuffer paramsBuffer = RF.CreateBuffer(new BufferDescription((uint)Unsafe.SizeOf <BasicComputeTestParams>(), BufferUsage.UniformBuffer)); DeviceBuffer sourceBuffer = RF.CreateBuffer(new BufferDescription(width * height * 4, BufferUsage.StructuredBufferReadWrite, 4)); DeviceBuffer destinationBuffer = RF.CreateBuffer(new BufferDescription(width * height * 4, BufferUsage.StructuredBufferReadWrite, 4)); GD.UpdateBuffer(paramsBuffer, 0, new BasicComputeTestParams { Width = width, Height = height }); float[] sourceData = new float[width * height]; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int index = y * (int)width + x; sourceData[index] = index; } } GD.UpdateBuffer(sourceBuffer, 0, sourceData); ResourceSet rs = RF.CreateResourceSet(new ResourceSetDescription(layout, paramsBuffer, sourceBuffer, destinationBuffer)); Pipeline pipeline = RF.CreateComputePipeline(new ComputePipelineDescription( TestShaders.LoadCompute(RF, "BasicComputeTest"), layout, 16, 16, 1)); CommandList cl = RF.CreateCommandList(); cl.Begin(); cl.SetPipeline(pipeline); cl.SetComputeResourceSet(0, rs); cl.Dispatch(width / 16, width / 16, 1); cl.End(); GD.SubmitCommands(cl); GD.WaitForIdle(); DeviceBuffer sourceReadback = GetReadback(sourceBuffer); DeviceBuffer destinationReadback = GetReadback(destinationBuffer); MappedResourceView <float> sourceReadView = GD.Map <float>(sourceReadback, MapMode.Read); MappedResourceView <float> destinationReadView = GD.Map <float>(destinationReadback, MapMode.Read); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int index = y * (int)width + x; Assert.Equal(2 * sourceData[index], sourceReadView[index]); Assert.Equal(sourceData[index], destinationReadView[index]); } } GD.Unmap(sourceReadback); GD.Unmap(destinationReadback); }
public override string GetOddsString() { return("3|" + WinOdds.ToString("F2") + ",0|" + LoseOdds.ToString("F2") + ",RF|" + RF.ToString("F2")); }
public void ComputeShader3dTexture() { // Just a dumb compute shader that fills a 3D texture with the same value from a uniform multiplied by the depth. string shaderText = @" #version 450 layout(set = 0, binding = 0, rgba32f) uniform image3D TextureToFill; layout(set = 0, binding = 1) uniform FillValueBuffer { float FillValue; float Padding1; float Padding2; float Padding3; }; layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; void main() { ivec3 textureCoordinate = ivec3(gl_GlobalInvocationID.xyz); float dataToStore = FillValue * (textureCoordinate.z + 1); imageStore(TextureToFill, textureCoordinate, vec4(dataToStore)); } "; const float FillValue = 42.42f; const uint OutputTextureSize = 32; using Shader computeShader = RF.CreateFromSpirv(new ShaderDescription( ShaderStages.Compute, Encoding.ASCII.GetBytes(shaderText), "main")); using ResourceLayout computeLayout = RF.CreateResourceLayout(new ResourceLayoutDescription( new ResourceLayoutElementDescription("TextureToFill", ResourceKind.TextureReadWrite, ShaderStages.Compute), new ResourceLayoutElementDescription("FillValueBuffer", ResourceKind.UniformBuffer, ShaderStages.Compute))); using Pipeline computePipeline = RF.CreateComputePipeline(new ComputePipelineDescription( computeShader, computeLayout, 16, 16, 1)); using DeviceBuffer fillValueBuffer = RF.CreateBuffer(new BufferDescription((uint)Marshal.SizeOf <FillValueStruct>(), BufferUsage.UniformBuffer)); // Create our output texture. using Texture computeTargetTexture = RF.CreateTexture(TextureDescription.Texture3D( OutputTextureSize, OutputTextureSize, OutputTextureSize, 1, PixelFormat.R32_G32_B32_A32_Float, TextureUsage.Sampled | TextureUsage.Storage)); using TextureView computeTargetTextureView = RF.CreateTextureView(computeTargetTexture); using ResourceSet computeResourceSet = RF.CreateResourceSet(new ResourceSetDescription( computeLayout, computeTargetTextureView, fillValueBuffer)); using CommandList cl = RF.CreateCommandList(); cl.Begin(); cl.UpdateBuffer(fillValueBuffer, 0, new FillValueStruct(FillValue)); // Use the compute shader to fill the texture. cl.SetPipeline(computePipeline); cl.SetComputeResourceSet(0, computeResourceSet); const uint GroupDivisorXY = 16; cl.Dispatch(OutputTextureSize / GroupDivisorXY, OutputTextureSize / GroupDivisorXY, OutputTextureSize); cl.End(); GD.SubmitCommands(cl); GD.WaitForIdle(); // Read back from our texture and make sure it has been properly filled. for (uint depth = 0; depth < computeTargetTexture.Depth; depth++) { RgbaFloat expectedFillValue = new RgbaFloat(new System.Numerics.Vector4(FillValue * (depth + 1))); int notFilledCount = CountTexelsNotFilledAtDepth(GD, computeTargetTexture, expectedFillValue, depth); if (notFilledCount == 0) { // Expected behavior: Console.WriteLine($"All texels were properly set at depth {depth}"); } else { // Unexpected behavior: uint totalTexels = computeTargetTexture.Width * computeTargetTexture.Height; throw new Exception($"{notFilledCount} of {totalTexels} texels were not properly set at depth {depth}"); } } }
public void TestInitialize() { RF.ResolveInstance <PBSTypeRepository>().ClientCache.ClearOnClient(); RF.ResolveInstance <PBSRepository>().ClientCache.ClearOnClient(); VersionSyncMgr.Repository.Clear(); }
private static TestUserList QueryUserList(ODataQueryCriteria criteria) { return(RF.ResolveInstance <TestUserRepository>().GetBy(criteria) as TestUserList); }
public HitTestResult(Shape shape, Cursor cursor, RF resizeFlags) : base(shape, cursor) { ResizeFlags = resizeFlags; }
public override bool Equals(I_JingCai_Odds odds) { return(WinOdds.Equals(odds.GetOdds("3")) && LoseOdds.Equals(odds.GetOdds("0")) && RF.Equals(odds.GetOdds("RF"))); }
public RafyDbVersionProvider() { this._versionRepo = RF.Concrete <DbVersionRepository>(); }
public XzqyController() { repo = RF.Concrete <IXzqyRepository>(); }
private static TestUserList QueryUserList(ODataQueryCriteria criteria) { return(RF.Concrete <TestUserRepository>().GetBy(criteria) as TestUserList); }
public void FillBuffer_WithOffsets(uint srcSetMultiple, uint srcBindingMultiple, uint dstSetMultiple, uint dstBindingMultiple, bool combinedLayout) { if (!GD.Features.ComputeShader) { return; } Debug.Assert((GD.StructuredBufferMinOffsetAlignment % sizeof(uint)) == 0); uint valueCount = 512; uint dataSize = valueCount * sizeof(uint); uint totalSrcAlignment = GD.StructuredBufferMinOffsetAlignment * (srcSetMultiple + srcBindingMultiple); uint totalDstAlignment = GD.StructuredBufferMinOffsetAlignment * (dstSetMultiple + dstBindingMultiple); DeviceBuffer copySrc = RF.CreateBuffer( new BufferDescription(totalSrcAlignment + dataSize, BufferUsage.StructuredBufferReadOnly, sizeof(uint))); DeviceBuffer copyDst = RF.CreateBuffer( new BufferDescription(totalDstAlignment + dataSize, BufferUsage.StructuredBufferReadWrite, sizeof(uint))); ResourceLayout[] layouts; ResourceSet[] sets; DeviceBufferRange srcRange = new DeviceBufferRange(copySrc, srcSetMultiple * GD.StructuredBufferMinOffsetAlignment, dataSize); DeviceBufferRange dstRange = new DeviceBufferRange(copyDst, dstSetMultiple * GD.StructuredBufferMinOffsetAlignment, dataSize); if (combinedLayout) { layouts = new[] { RF.CreateResourceLayout(new ResourceLayoutDescription( new ResourceLayoutElementDescription( "CopySrc", ResourceKind.StructuredBufferReadOnly, ShaderStages.Compute, ResourceLayoutElementOptions.DynamicBinding), new ResourceLayoutElementDescription( "CopyDst", ResourceKind.StructuredBufferReadWrite, ShaderStages.Compute, ResourceLayoutElementOptions.DynamicBinding))) }; sets = new[] { RF.CreateResourceSet(new ResourceSetDescription(layouts[0], srcRange, dstRange)) }; } else { layouts = new[] { RF.CreateResourceLayout(new ResourceLayoutDescription( new ResourceLayoutElementDescription( "CopySrc", ResourceKind.StructuredBufferReadOnly, ShaderStages.Compute, ResourceLayoutElementOptions.DynamicBinding))), RF.CreateResourceLayout(new ResourceLayoutDescription( new ResourceLayoutElementDescription( "CopyDst", ResourceKind.StructuredBufferReadWrite, ShaderStages.Compute, ResourceLayoutElementOptions.DynamicBinding))) }; sets = new[] { RF.CreateResourceSet(new ResourceSetDescription(layouts[0], srcRange)), RF.CreateResourceSet(new ResourceSetDescription(layouts[1], dstRange)), }; } Pipeline pipeline = RF.CreateComputePipeline(new ComputePipelineDescription( TestShaders.LoadCompute(RF, combinedLayout ? "FillBuffer" : "FillBuffer_SeparateLayout"), layouts, 1, 1, 1)); uint[] srcData = Enumerable.Range(0, (int)copySrc.SizeInBytes / sizeof(uint)).Select(i => (uint)i).ToArray(); GD.UpdateBuffer(copySrc, 0, srcData); CommandList cl = RF.CreateCommandList(); cl.Begin(); cl.SetPipeline(pipeline); if (combinedLayout) { uint[] offsets = new[] { srcBindingMultiple *GD.StructuredBufferMinOffsetAlignment, dstBindingMultiple *GD.StructuredBufferMinOffsetAlignment }; cl.SetComputeResourceSet(0, sets[0], offsets); } else { uint offset = srcBindingMultiple * GD.StructuredBufferMinOffsetAlignment; cl.SetComputeResourceSet(0, sets[0], 1, ref offset); offset = dstBindingMultiple * GD.StructuredBufferMinOffsetAlignment; cl.SetComputeResourceSet(1, sets[1], 1, ref offset); } cl.Dispatch(512, 1, 1); cl.End(); GD.SubmitCommands(cl); GD.WaitForIdle(); DeviceBuffer readback = GetReadback(copyDst); MappedResourceView <uint> readView = GD.Map <uint>(readback, MapMode.Read); for (uint i = 0; i < valueCount; i++) { uint srcIndex = totalSrcAlignment / sizeof(uint) + i; uint expected = srcData[(int)srcIndex]; uint dstIndex = totalDstAlignment / sizeof(uint) + i; uint actual = readView[dstIndex]; Assert.Equal(expected, actual); } GD.Unmap(readback); }
/// <summary> /// 重新设置整个表的所有 TreeIndex。 /// 注意,此方法只保证生成的 TreeIndex 有正确的父子关系,同时顺序有可能被打乱。 /// /// 此方法用于 TreeIndex 出错时的整表修复。 /// TreeIndex 在以下已知情况时会出现错误: /// * 刚从一个非树型实体变更为树型实体时,历史数据中的所有 TreeIndex 会没有值。 /// * 开发者未按规定方法使用树型实体。 /// * 开发者直接修改了数据库,导致 TreeIndex 出错。 /// </summary> /// <param name="repository"></param> public static void ResetTreeIndex(EntityRepository repository) { using (var tran = RF.TransactionScope(repository)) { //先清空所有的 TreeIndex ClearAllTreeIndex(repository); var all = repository.GetTreeRoots(); if (all.Count > 0) { (all as ITreeComponent).LoadAllNodes(LoadAllNodesMethod.ByTreePId); //如果加载的过程中,第一个节点刚好是根节点, //则加载完成后是一棵完整的树,Index 也生成完毕,不需要再次处理。 if (all.IsTreeRootList) { all.ResetTreeIndex(); repository.Save(all); } else { var cloneOptions = CloneOptions.ReadSingleEntity(); var oldList = new List <Entity>(); all.EachNode(e => { var cloned = repository.New(); cloned.Clone(e, cloneOptions); cloned.PersistenceStatus = PersistenceStatus.Unchanged; oldList.Add(cloned); return(false); }); var newList = repository.NewList(); while (oldList.Count > 0) { foreach (var item in oldList) { var treePId = item.TreePId; if (treePId == null) { newList.Add(item); oldList.Remove(item); break; } else { var parent = newList.EachNode(e => e.Id.Equals(treePId)); if (parent != null) { parent.TreeChildren.LoadAdd(item); oldList.Remove(item); break; } } } } TreeHelper.MarkTreeFullLoaded(newList); newList.ResetTreeIndex(); repository.Save(newList); } } tran.Complete(); } }
public static IRepository <TAggregateRoot> Repository <TAggregateRoot>() where TAggregateRoot : class, IAggregateRoot { var repo = RF.Service <IRepository <TAggregateRoot> >(); return(repo); }
public unsafe void Copy_Compressed_Array(bool separateLayerCopies) { PixelFormat format = PixelFormat.BC3_UNorm; if (!GD.GetPixelFormatSupport(format, TextureType.Texture2D, TextureUsage.Sampled)) { return; } TextureDescription texDesc = TextureDescription.Texture2D( 16, 16, 1, 4, format, TextureUsage.Sampled); Texture copySrc = RF.CreateTexture(texDesc); texDesc.Usage = TextureUsage.Staging; Texture copyDst = RF.CreateTexture(texDesc); for (uint layer = 0; layer < copySrc.ArrayLayers; layer++) { int byteCount = 16 * 16; byte[] data = Enumerable.Range(0, byteCount).Select(i => (byte)(i + layer)).ToArray(); GD.UpdateTexture( copySrc, data, 0, 0, 0, 16, 16, 1, 0, layer); } CommandList copyCL = RF.CreateCommandList(); copyCL.Begin(); if (separateLayerCopies) { for (uint layer = 0; layer < copySrc.ArrayLayers; layer++) { copyCL.CopyTexture(copySrc, 0, 0, 0, 0, layer, copyDst, 0, 0, 0, 0, layer, 16, 16, 1, 1); } } else { copyCL.CopyTexture(copySrc, 0, 0, 0, 0, 0, copyDst, 0, 0, 0, 0, 0, 16, 16, 1, copySrc.ArrayLayers); } copyCL.End(); Fence fence = RF.CreateFence(false); GD.SubmitCommands(copyCL, fence); GD.WaitForFence(fence); for (uint layer = 0; layer < copyDst.ArrayLayers; layer++) { MappedResource map = GD.Map(copyDst, MapMode.Read, layer); byte * basePtr = (byte *)map.Data; int index = 0; uint rowSize = 64; uint numRows = 4; for (uint row = 0; row < numRows; row++) { byte *rowBase = basePtr + (row * map.RowPitch); for (uint x = 0; x < rowSize; x++) { Assert.Equal((byte)(index + layer), rowBase[x]); index += 1; } } GD.Unmap(copyDst, layer); } }
public override void Execute(LogicalView view) { CommonModel.Entities.EnsureAllLoaded(); view.DataLoader.LoadDataAsync(() => RF.ResolveInstance <FrameworkInfoItemRepository>().GetAllOnClient()); }
private ClientInfoList GetSupplierDataSource() { return(RF.Concrete <ClientInfoRepository>().GetSuppliers()); }
private void CountDevLanguages() { this.AddItem("语言项", RF.Concrete <DevLanguageItemRepository>().CountAll()); }
/// <summary> /// 初始化 /// </summary> /// <param name="rf"></param> public UCSetting(RF rf) : base(rf) { InitializeComponent(); }