示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GorgonTexture3D"/> 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>
 internal GorgonTexture3D(GorgonGraphics graphics, string name, ITextureSettings settings)
     : base(graphics, name, settings)
 {
     Settings = new GorgonTexture3DSettings
     {
         Width  = settings.Width,
         Height = settings.Height,
         Depth  = settings.Depth,
         AllowUnorderedAccessViews = settings.AllowUnorderedAccessViews,
         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 settings3D = new GorgonTexture3DSettings
            {
                Format   = Settings.Format,
                Width    = Settings.Width,
                Height   = Settings.Height,
                Depth    = Settings.Depth,
                MipCount = Settings.MipCount,
                Usage    = BufferUsage.Staging
            };

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

            staging.Copy(this);

            return(staging);
        }