Esempio n. 1
0
        internal Texture3D(Device device, Texture3DDescription description)
            : base(device)
        {
            _description = description;

            int mipMapCount = MipMapUtility.CalculateMipMapCount(description.MipLevels,
                                                                 description.Width, description.Height, description.Depth);

            _subresources = MipMapUtility.CreateMipMaps(mipMapCount,
                                                        description.Width, description.Height, description.Depth);
        }
Esempio n. 2
0
        internal Texture1D(Device device, Texture1DDescription description)
            : base(device)
        {
            _description = description;

            _subresources = new Texture1DSubresource[description.ArraySize][];
            int mipMapCount = MipMapUtility.CalculateMipMapCount(description.MipLevels, description.Width);

            for (int i = 0; i < description.ArraySize; i++)
            {
                _subresources[i] = MipMapUtility.CreateMipMaps(mipMapCount,
                                                               description.Width);
            }
        }
Esempio n. 3
0
        internal Texture2D(Device device, Texture2DDescription description)
            : base(device)
        {
            if (description.ArraySize == 0)
            {
                throw new ArgumentException("ArraySize must be at least 1.");
            }

            int mipMapCount = MipMapUtility.CalculateMipMapCount(description.MipLevels,
                                                                 description.Width, description.Height);

            _description           = description;
            _description.MipLevels = mipMapCount;

            _subresources = new Texture2DSubresource[description.ArraySize][];

            for (int i = 0; i < description.ArraySize; i++)
            {
                _subresources[i] = MipMapUtility.CreateMipMaps(mipMapCount,
                                                               description.Width, description.Height);
            }
        }