Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GorgonTexture1D"/> class.
 /// </summary>
 /// <param name="graphics">The graphics interface that owns this texture.</param>
 /// <param name="name">The name of the texture.</param>
 /// <param name="settings">Settings to pass to the texture.</param>
 /// <exception cref="System.ArgumentNullException">Thrown when the <paramref name="name"/> parameter is NULL (Nothing in VB.Net).</exception>
 ///
 /// <exception cref="System.ArgumentException">Thrown when the <paramref name="name"/> parameter is an empty string.</exception>
 internal GorgonTexture1D(GorgonGraphics graphics, string name, ITextureSettings settings)
     : base(graphics, name, settings)
 {
     Settings = new GorgonTexture1DSettings
     {
         Width = settings.Width,
         AllowUnorderedAccessViews = settings.AllowUnorderedAccessViews,
         ArrayCount       = settings.ArrayCount,
         Format           = settings.Format,
         MipCount         = settings.MipCount,
         ShaderViewFormat = settings.ShaderViewFormat,
         Usage            = settings.Usage
     };
 }
Пример #2
0
        /// <summary>
        /// Function to copy this texture into a new staging texture.
        /// </summary>
        /// <returns>
        /// The new staging texture.
        /// </returns>
        protected override GorgonTexture OnGetStagingTexture()
        {
            var settings1D = new GorgonTexture1DSettings
            {
                ArrayCount = Settings.ArrayCount,
                Format     = Settings.Format,
                Width      = Settings.Width,
                MipCount   = Settings.MipCount,
                Usage      = BufferUsage.Staging
            };

            GorgonTexture staging = Graphics.Textures.CreateTexture(Name + ".Staging", settings1D);

            staging.Copy(this);

            return(staging);
        }