Example #1
0
        public ITexture CreateView(TextureCreateInfo info, int firstLayer, int firstLevel)
        {
            ThreadedTexture newTex = new ThreadedTexture(_renderer, info, ScaleFactor);

            _renderer.New <TextureCreateViewCommand>().Set(Ref(this), Ref(newTex), info, firstLayer, firstLevel);
            _renderer.QueueCommand();

            return(newTex);
        }
Example #2
0
        public void CopyTo(ITexture destination, Extents2D srcRegion, Extents2D dstRegion, bool linearFilter)
        {
            ThreadedTexture dest = (ThreadedTexture)destination;

            if (_renderer.IsGpuThread())
            {
                _renderer.New <TextureCopyToScaledCommand>().Set(Ref(this), Ref(dest), srcRegion, dstRegion, linearFilter);
                _renderer.QueueCommand();
            }
            else
            {
                // Scaled copy can happen on another thread for a res scale flush.
                ThreadedHelpers.SpinUntilNonNull(ref Base);
                ThreadedHelpers.SpinUntilNonNull(ref dest.Base);

                Base.CopyTo(dest.Base, srcRegion, dstRegion, linearFilter);
            }
        }