Beispiel #1
0
 private static ResourceDescription ConvertToNativeDescription(TextureDescription description)
 {
     return(description.Dimension switch
     {
         TextureDimension.Texture2D => ResourceDescription.Texture2D((Format)description.Format, description.Width, description.Height, description.DepthOrArraySize, description.MipLevels, description.SampleCount, 0, GetBindFlagsFromTextureFlags(description.Flags)),
         _ => throw new NotSupportedException()
     });
Beispiel #2
0
 public static Texture Create2D(GraphicsDevice device, int width, int height, PixelFormat format, ResourceFlags textureFlags = ResourceFlags.None, short mipLevels = 1, short arraySize = 1, int sampleCount = 1, int sampleQuality = 0, HeapType heapType = HeapType.Default)
 {
     return(new Texture(device, ResourceDescription.Texture2D(width, height, format, textureFlags, mipLevels, arraySize, sampleCount, sampleQuality), heapType));
 }