public TextureAtlas( D3D10.Device device, VirtualTextureInfo info, int count, int uploadsperframe ) { this.device = device; this.info = info; int pagesize = info.PageSize; resource = new Direct3D.Texture( device, count * pagesize, count * pagesize, DXGI.Format.R8G8B8A8_UNorm, D3D10.ResourceUsage.Default, 1 ); staging = new Direct3D.StagingTexturePool( device, pagesize, pagesize, DXGI.Format.R8G8B8A8_UNorm, uploadsperframe, D3D10.CpuAccessFlags.Write ); }
public PageTable( D3D10.Device device, PageCache cache, VirtualTextureInfo info, PageIndexer indexer ) { this.info = info; this.device = device; this.indexer = indexer; quadtree = new Quadtree(new Rectangle(0, 0, info.PageTableSize, info.PageTableSize), MathExtensions.Log2(info.PageTableSize)); int size = info.PageTableSize; texture = new Direct3D.Texture( device, size, size, DXGI.Format.R8G8B8A8_UNorm, D3D10.ResourceUsage.Default, 0 ); staging = new Direct3D.WriteTexture( device, size, size, DXGI.Format.R8G8B8A8_UNorm ); cache.Added += ( Page page, Point pt ) => quadtree.Add( page, pt ); cache.Removed += ( Page page, Point pt ) => quadtree.Remove( page ); SetupDataAndInfo(); }