Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
DDS.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 //
4 // Copyright (c) 2010-2012 SharpDX - Alexandre Mutel
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in
14 // all copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 // THE SOFTWARE.
23 // -----------------------------------------------------------------------------
24 // The following code is a port of DirectXTex http://directxtex.codeplex.com
25 // -----------------------------------------------------------------------------
26 // Microsoft Public License (Ms-PL)
27 //
28 // This license governs use of the accompanying software. If you use the
29 // software, you accept this license. If you do not accept the license, do not
30 // use the software.
31 //
32 // 1. Definitions
33 // The terms "reproduce," "reproduction," "derivative works," and
34 // "distribution" have the same meaning here as under U.S. copyright law.
35 // A "contribution" is the original software, or any additions or changes to
36 // the software.
37 // A "contributor" is any person that distributes its contribution under this
38 // license.
39 // "Licensed patents" are a contributor's patent claims that read directly on
40 // its contribution.
41 //
42 // 2. Grant of Rights
43 // (A) Copyright Grant- Subject to the terms of this license, including the
44 // license conditions and limitations in section 3, each contributor grants
45 // you a non-exclusive, worldwide, royalty-free copyright license to reproduce
46 // its contribution, prepare derivative works of its contribution, and
47 // distribute its contribution or any derivative works that you create.
48 // (B) Patent Grant- Subject to the terms of this license, including the license
49 // conditions and limitations in section 3, each contributor grants you a
50 // non-exclusive, worldwide, royalty-free license under its licensed patents to
51 // make, have made, use, sell, offer for sale, import, and/or otherwise dispose
52 // of its contribution in the software or derivative works of the contribution
53 // in the software.
54 //
55 // 3. Conditions and Limitations
56 // (A) No Trademark License- This license does not grant you rights to use any
57 // contributors' name, logo, or trademarks.
58 // (B) If you bring a patent claim against any contributor over patents that
59 // you claim are infringed by the software, your patent license from such
60 // contributor to the software ends automatically.
61 // (C) If you distribute any portion of the software, you must retain all
62 // copyright, patent, trademark, and attribution notices that are present in the
63 // software.
64 // (D) If you distribute any portion of the software in source code form, you
65 // may do so only under this license by including a complete copy of this
66 // license with your distribution. If you distribute any portion of the software
67 // in compiled or object code form, you may only do so under a license that
68 // complies with this license.
69 // (E) The software is licensed "as-is." You bear the risk of using it. The
70 // contributors give no express warranties, guarantees or conditions. You may
71 // have additional consumer rights under your local laws which this license
72 // cannot change. To the extent permitted under your local laws, the
73 // contributors exclude the implied warranties of merchantability, fitness for a
74 // particular purpose and non-infringement.
75 
76 using System;
77 using System.Runtime.InteropServices;
78 using SiliconStudio.Core;
79 
80 namespace SiliconStudio.Paradox.Graphics
81 {
82  internal class DDS
83  {
84  /// <summary>
85  /// Magic code to identify DDS header
86  /// </summary>
87  public const uint MagicHeader = 0x20534444; // "DDS "
88 
89  /// <summary>
90  /// Internal structure used to describe a DDS pixel format.
91  /// </summary>
92  [StructLayout(LayoutKind.Sequential, Pack = 1)]
93  public struct DDSPixelFormat
94  {
95  /// <summary>
96  /// Initializes a new instance of the <see cref="DDSPixelFormat" /> struct.
97  /// </summary>
98  /// <param name="flags">The flags.</param>
99  /// <param name="fourCC">The four CC.</param>
100  /// <param name="rgbBitCount">The RGB bit count.</param>
101  /// <param name="rBitMask">The r bit mask.</param>
102  /// <param name="gBitMask">The g bit mask.</param>
103  /// <param name="bBitMask">The b bit mask.</param>
104  /// <param name="aBitMask">A bit mask.</param>
105  public DDSPixelFormat(PixelFormatFlags flags, int fourCC, int rgbBitCount, uint rBitMask, uint gBitMask, uint bBitMask, uint aBitMask)
106  {
107  Size = Utilities.SizeOf<DDSPixelFormat>();
108  Flags = flags;
109  FourCC = fourCC;
110  RGBBitCount = rgbBitCount;
111  RBitMask = rBitMask;
112  GBitMask = gBitMask;
113  BBitMask = bBitMask;
114  ABitMask = aBitMask;
115  }
116 
117  public int Size;
118  public PixelFormatFlags Flags;
119  public int FourCC;
120  public int RGBBitCount;
121  public uint RBitMask;
122  public uint GBitMask;
123  public uint BBitMask;
124  public uint ABitMask;
125 
126  public static readonly DDSPixelFormat DXT1 = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('D', 'X', 'T', '1'), 0, 0, 0, 0, 0);
127 
128  public static readonly DDSPixelFormat DXT2 = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('D', 'X', 'T', '2'), 0, 0, 0, 0, 0);
129 
130  public static readonly DDSPixelFormat DXT3 = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('D', 'X', 'T', '3'), 0, 0, 0, 0, 0);
131 
132  public static readonly DDSPixelFormat DXT4 = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('D', 'X', 'T', '4'), 0, 0, 0, 0, 0);
133 
134  public static readonly DDSPixelFormat DXT5 = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('D', 'X', 'T', '5'), 0, 0, 0, 0, 0);
135 
136  public static readonly DDSPixelFormat BC4_UNorm = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('B', 'C', '4', 'U'), 0, 0, 0, 0, 0);
137 
138  public static readonly DDSPixelFormat BC4_SNorm = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('B', 'C', '4', 'S'), 0, 0, 0, 0, 0);
139 
140  public static readonly DDSPixelFormat BC5_UNorm = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('B', 'C', '5', 'U'), 0, 0, 0, 0, 0);
141 
142  public static readonly DDSPixelFormat BC5_SNorm = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('B', 'C', '5', 'S'), 0, 0, 0, 0, 0);
143 
144  public static readonly DDSPixelFormat R8G8_B8G8 = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('R', 'G', 'B', 'G'), 0, 0, 0, 0, 0);
145 
146  public static readonly DDSPixelFormat G8R8_G8B8 = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('G', 'R', 'G', 'B'), 0, 0, 0, 0, 0);
147 
148  public static readonly DDSPixelFormat A8R8G8B8 = new DDSPixelFormat(PixelFormatFlags.Rgba, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
149 
150  public static readonly DDSPixelFormat X8R8G8B8 = new DDSPixelFormat(PixelFormatFlags.Rgb, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000);
151 
152  public static readonly DDSPixelFormat A8B8G8R8 = new DDSPixelFormat(PixelFormatFlags.Rgba, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000);
153 
154  public static readonly DDSPixelFormat X8B8G8R8 = new DDSPixelFormat(PixelFormatFlags.Rgb, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000);
155 
156  public static readonly DDSPixelFormat G16R16 = new DDSPixelFormat(PixelFormatFlags.Rgb, 0, 32, 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000);
157 
158  public static readonly DDSPixelFormat R5G6B5 = new DDSPixelFormat(PixelFormatFlags.Rgb, 0, 16, 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000);
159 
160  public static readonly DDSPixelFormat A1R5G5B5 = new DDSPixelFormat(PixelFormatFlags.Rgba, 0, 16, 0x00007c00, 0x000003e0, 0x0000001f, 0x00008000);
161 
162  public static readonly DDSPixelFormat A4R4G4B4 = new DDSPixelFormat(PixelFormatFlags.Rgba, 0, 16, 0x00000f00, 0x000000f0, 0x0000000f, 0x0000f000);
163 
164  public static readonly DDSPixelFormat R8G8B8 = new DDSPixelFormat(PixelFormatFlags.Rgb, 0, 24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000);
165 
166  public static readonly DDSPixelFormat L8 = new DDSPixelFormat(PixelFormatFlags.Luminance, 0, 8, 0xff, 0x00, 0x00, 0x00);
167 
168  public static readonly DDSPixelFormat L16 = new DDSPixelFormat(PixelFormatFlags.Luminance, 0, 16, 0xffff, 0x0000, 0x0000, 0x0000);
169 
170  public static readonly DDSPixelFormat A8L8 = new DDSPixelFormat(PixelFormatFlags.LuminanceAlpha, 0, 16, 0x00ff, 0x0000, 0x0000, 0xff00);
171 
172  public static readonly DDSPixelFormat A8 = new DDSPixelFormat(PixelFormatFlags.Alpha, 0, 8, 0x00, 0x00, 0x00, 0xff);
173 
174  public static readonly DDSPixelFormat DX10 = new DDSPixelFormat(PixelFormatFlags.FourCC, new FourCC('D', 'X', '1', '0'), 0, 0, 0, 0, 0);
175  }
176 
177  /// <summary>
178  /// PixelFormat flags.
179  /// </summary>
180  [Flags]
181  public enum PixelFormatFlags
182  {
183  FourCC = 0x00000004, // DDPF_FOURCC
184  Rgb = 0x00000040, // DDPF_RGB
185  Rgba = 0x00000041, // DDPF_RGB | DDPF_ALPHAPIXELS
186  Luminance = 0x00020000, // DDPF_LUMINANCE
187  LuminanceAlpha = 0x00020001, // DDPF_LUMINANCE | DDPF_ALPHAPIXELS
188  Alpha = 0x00000002, // DDPF_ALPHA
189  Pal8 = 0x00000020, // DDPF_PALETTEINDEXED8
190  }
191 
192  /// <summary>
193  /// DDS Header flags.
194  /// </summary>
195  [Flags]
196  public enum HeaderFlags
197  {
198  Texture = 0x00001007, // DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT
199  Mipmap = 0x00020000, // DDSD_MIPMAPCOUNT
200  Volume = 0x00800000, // DDSD_DEPTH
201  Pitch = 0x00000008, // DDSD_PITCH
202  LinearSize = 0x00080000, // DDSD_LINEARSIZE
203  Height = 0x00000002, // DDSD_HEIGHT
204  Width = 0x00000004, // DDSD_WIDTH
205  };
206 
207  /// <summary>
208  /// DDS Surface flags.
209  /// </summary>
210  [Flags]
211  public enum SurfaceFlags
212  {
213  Texture = 0x00001000, // DDSCAPS_TEXTURE
214  Mipmap = 0x00400008, // DDSCAPS_COMPLEX | DDSCAPS_MIPMAP
215  Cubemap = 0x00000008, // DDSCAPS_COMPLEX
216  }
217 
218  /// <summary>
219  /// DDS Cubemap flags.
220  /// </summary>
221  [Flags]
222  public enum CubemapFlags
223  {
224  CubeMap = 0x00000200, // DDSCAPS2_CUBEMAP
225  Volume = 0x00200000, // DDSCAPS2_VOLUME
226  PositiveX = 0x00000600, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEX
227  NegativeX = 0x00000a00, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEX
228  PositiveY = 0x00001200, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEY
229  NegativeY = 0x00002200, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEY
230  PositiveZ = 0x00004200, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEZ
231  NegativeZ = 0x00008200, // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ
232 
233  AllFaces = PositiveX | NegativeX | PositiveY | NegativeY | PositiveZ | NegativeZ,
234  }
235 
236  [StructLayout(LayoutKind.Sequential, Pack = 1)]
237  public struct Header
238  {
239  public int Size;
240  public HeaderFlags Flags;
241  public int Height;
242  public int Width;
243  public int PitchOrLinearSize;
244  public int Depth; // only if DDS_HEADER_FLAGS_VOLUME is set in dwFlags
245  public int MipMapCount;
246 
247  private readonly uint unused1;
248  private readonly uint unused2;
249  private readonly uint unused3;
250  private readonly uint unused4;
251  private readonly uint unused5;
252  private readonly uint unused6;
253  private readonly uint unused7;
254  private readonly uint unused8;
255  private readonly uint unused9;
256  private readonly uint unused10;
257  private readonly uint unused11;
258 
260  public SurfaceFlags SurfaceFlags;
261  public CubemapFlags CubemapFlags;
262 
263  private readonly uint Unused12;
264  private readonly uint Unused13;
265 
266  private readonly uint Unused14;
267  }
268 
269  [StructLayout(LayoutKind.Sequential, Pack = 1)]
270  public struct HeaderDXT10
271  {
273  public ResourceDimension ResourceDimension;
274  public ResourceOptionFlags MiscFlags; // see DDS_RESOURCE_MISC_FLAG
275  public int ArraySize;
276 
277  private readonly uint Unused;
278  }
279 
280  /// <summary>
281  /// <p>Identifies the type of resource being used.</p>
282  /// </summary>
283  /// <remarks>
284  /// <p>This enumeration is used in <strong><see cref="SharpDX.Direct3D11.Resource.GetDimension"/></strong>. </p>
285  /// </remarks>
286  /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3D11_RESOURCE_DIMENSION']/*"/>
287  public enum ResourceDimension : int
288  {
289 
290  /// <summary>
291  /// <dd> <p>Resource is of unknown type.</p> </dd>
292  /// </summary>
293  /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3D11_RESOURCE_DIMENSION_UNKNOWN']/*"/>
294  Unknown = unchecked((int)0),
295 
296  /// <summary>
297  /// <dd> <p>Resource is a buffer.</p> </dd>
298  /// </summary>
299  Buffer = unchecked((int)1),
300 
301  /// <summary>
302  /// <dd> <p>Resource is a 1D texture.</p> </dd>
303  /// </summary>
304  Texture1D = unchecked((int)2),
305 
306  /// <summary>
307  /// <dd> <p>Resource is a 2D texture.</p> </dd>
308  /// </summary>
309  Texture2D = unchecked((int)3),
310 
311  /// <summary>
312  /// <dd> <p>Resource is a 3D texture.</p> </dd>
313  /// </summary>
314  Texture3D = unchecked((int)4),
315  }
316 
317  /// <summary>
318  /// <p>Identifies options for resources.</p>
319  /// </summary>
320  /// <remarks>
321  /// <p>This enumeration is used in <strong><see cref="SharpDX.Direct3D11.BufferDescription"/></strong>, <strong><see cref="SharpDX.Direct3D11.Texture1DDescription"/></strong>, <strong><see cref="SharpDX.Direct3D11.Texture2DDescription"/></strong>, <strong><see cref="SharpDX.Direct3D11.Texture3DDescription"/></strong>. </p><p>These flags can be combined by bitwise OR.</p>
322  /// </remarks>
323  [Flags]
324  public enum ResourceOptionFlags : int
325  {
326 
327  /// <summary>
328  /// <dd> <p>Enables MIP map generation by using <strong><see cref="SharpDX.Direct3D11.DeviceContext.GenerateMips"/></strong> on a texture resource. The resource must be created with the <strong>bind flags</strong> that specify that the resource is a render target and a shader resource.</p> </dd>
329  /// </summary>
330  GenerateMipMaps = unchecked((int)1),
331 
332  /// <summary>
333  /// <dd> <p>Enables resource data sharing between two or more Direct3D devices. The only resources that can be shared are 2D non-mipmapped textures.</p> <p><strong><see cref="SharpDX.Direct3D11.ResourceOptionFlags.Shared"/></strong> and <strong><see cref="SharpDX.Direct3D11.ResourceOptionFlags.SharedKeyedmutex"/></strong> are mutually exclusive.</p> <p><strong>WARP</strong> and <strong>REF</strong> devices do not support shared resources. If you try to create a resource with this flag on either a <strong>WARP</strong> or <strong>REF</strong> device, the create method will return an <strong>E_OUTOFMEMORY</strong> error code.</p> </dd>
334  /// </summary>
335  Shared = unchecked((int)2),
336 
337  /// <summary>
338  /// <dd> <p>Sets a resource to be a cube texture created from a Texture2DArray that contains 6 textures.</p> </dd>
339  /// </summary>
340  TextureCube = unchecked((int)4),
341 
342  /// <summary>
343  /// <dd> <p>Enables instancing of GPU-generated content.</p> </dd>
344  /// </summary>
345  DrawindirectArgs = unchecked((int)16),
346 
347  /// <summary>
348  /// <dd> <p>Enables a resource as a byte address buffer.</p> </dd>
349  /// </summary>
350  BufferAllowRawViews = unchecked((int)32),
351 
352  /// <summary>
353  /// <dd> <p>Enables a resource as a structured buffer.</p> </dd>
354  /// </summary>
355  BufferStructured = unchecked((int)64),
356 
357  /// <summary>
358  /// <dd> <p>Enables a resource with MIP map clamping for use with <strong><see cref="SharpDX.Direct3D11.DeviceContext.SetMinimumLod"/></strong>.</p> </dd>
359  /// </summary>
360  ResourceClamp = unchecked((int)128),
361 
362  /// <summary>
363  /// <dd> <p>Enables the resource to be synchronized by using the <strong><see cref="SharpDX.DXGI.KeyedMutex.Acquire"/></strong> and <strong><see cref="SharpDX.DXGI.KeyedMutex.Release"/></strong> APIs. The following Direct3D?11 resource creation APIs, that take <strong><see cref="SharpDX.Direct3D11.ResourceOptionFlags"/></strong> parameters, have been extended to support the new flag.</p> <ul> <li> <strong><see cref="SharpDX.Direct3D11.Device.CreateTexture1D"/></strong> </li> <li> <strong><see cref="SharpDX.Direct3D11.Device.CreateTexture2D"/></strong> </li> <li> <strong><see cref="SharpDX.Direct3D11.Device.CreateTexture3D"/></strong> </li> <li> <strong><see cref="SharpDX.Direct3D11.Device.CreateBuffer"/></strong> </li> </ul> <p>If you call any of these methods with the <strong><see cref="SharpDX.Direct3D11.ResourceOptionFlags.SharedKeyedmutex"/></strong> flag set, the interface returned will support the <strong><see cref="SharpDX.DXGI.KeyedMutex"/></strong> interface. You can retrieve a reference to the <strong><see cref="SharpDX.DXGI.KeyedMutex"/></strong> interface from the resource by using <strong>IUnknown::QueryInterface</strong>. The <strong><see cref="SharpDX.DXGI.KeyedMutex"/></strong> interface implements the <strong><see cref="SharpDX.DXGI.KeyedMutex.Acquire"/></strong> and <strong><see cref="SharpDX.DXGI.KeyedMutex.Release"/></strong> APIs to synchronize access to the surface. The device that creates the surface, and any other device that opens the surface by using <strong>OpenSharedResource</strong>, must call <strong><see cref="SharpDX.DXGI.KeyedMutex.Acquire"/></strong> before they issue any rendering commands to the surface. When those devices finish rendering, they must call <strong><see cref="SharpDX.DXGI.KeyedMutex.Release"/></strong>.</p> <p><strong> <see cref="SharpDX.Direct3D11.ResourceOptionFlags.Shared"/></strong> and <strong><see cref="SharpDX.Direct3D11.ResourceOptionFlags.SharedKeyedmutex"/></strong> are mutually exclusive.</p> <p><strong>WARP</strong> and <strong>REF</strong> devices do not support shared resources. If you try to create a resource with this flag on either a <strong>WARP</strong> or <strong>REF</strong> device, the create method will return an <strong>E_OUTOFMEMORY</strong> error code.</p> </dd>
364  /// </summary>
365  SharedKeyedmutex = unchecked((int)256),
366 
367  /// <summary>
368  /// <dd> <p>Enables a resource compatible with GDI. You must set the <strong><see cref="SharpDX.Direct3D11.ResourceOptionFlags.GdiCompatible"/></strong> flag on surfaces that you use with GDI. Setting the <strong><see cref="SharpDX.Direct3D11.ResourceOptionFlags.GdiCompatible"/></strong> flag allows GDI rendering on the surface via <strong><see cref="SharpDX.DXGI.Surface1.GetDC"/></strong>.
369  /// </p> <p>Consider the following programming tips for using <see cref="SharpDX.Direct3D11.ResourceOptionFlags.GdiCompatible"/> when you create a texture or use that texture in a swap chain:</p> <ul> <li><see cref="SharpDX.Direct3D11.ResourceOptionFlags.SharedKeyedmutex"/> and <see cref="SharpDX.Direct3D11.ResourceOptionFlags.GdiCompatible"/> are mutually exclusive. Therefore, do not use them together.</li> <li><see cref="SharpDX.Direct3D11.ResourceOptionFlags.ResourceClamp"/> and <see cref="SharpDX.Direct3D11.ResourceOptionFlags.GdiCompatible"/> are mutually exclusive. Therefore, do not use them together.</li> <li>You must bind the texture as a render target for the output-merger stage. For example, set the <see cref="SharpDX.Direct3D11.BindFlags.RenderTarget"/> flag in the <strong>BindFlags</strong> member of the <strong><see cref="SharpDX.Direct3D11.Texture2DDescription"/></strong> structure.</li> <li>You must set the maximum number of MIP map levels to 1. For example, set the <strong>MipLevels</strong> member of the <strong><see cref="SharpDX.Direct3D11.Texture2DDescription"/></strong> structure to 1.</li> <li>You must specify that the texture requires read and write access by the GPU. For example, set the <strong>Usage</strong> member of the <strong><see cref="SharpDX.Direct3D11.Texture2DDescription"/></strong> structure to <see cref="SharpDX.Direct3D11.ResourceUsage.Default"/>.</li> <li> <p>You must set the texture format to one of the following types. </p> <ul> <li><see cref="SharpDX.DXGI.Format.B8G8R8A8_UNorm"/>
370  /// </li> <li><see cref="SharpDX.DXGI.Format.B8G8R8A8_Typeless"/></li> <li><see cref="SharpDX.DXGI.Format.B8G8R8A8_UNorm_SRgb"/>
371  /// </li> </ul>For example, set the <strong>Format</strong> member of the <strong><see cref="SharpDX.Direct3D11.Texture2DDescription"/></strong> structure to one of these types.</li> <li>You cannot use <see cref="SharpDX.Direct3D11.ResourceOptionFlags.GdiCompatible"/> with multisampling. Therefore, set the <strong>Count</strong> member of the <strong><see cref="SharpDX.DXGI.SampleDescription"/></strong> structure to 1. Then, set the <strong>SampleDesc</strong> member of the <strong><see cref="SharpDX.Direct3D11.Texture2DDescription"/></strong> structure to this <strong><see cref="SharpDX.DXGI.SampleDescription"/></strong> structure.</li> </ul> </dd>
372  /// </summary>
373  GdiCompatible = unchecked((int)512),
374 
375  /// <summary>
376  /// None.
377  /// </summary>
378  None = unchecked((int)0),
379  }
380  }
381 }
_In_ size_t _In_ DXGI_FORMAT _In_ size_t _In_ DXGI_FORMAT _In_ DWORD flags
Definition: DirectXTexP.h:170
A TextureCube frontend to SharpDX.Direct3D11.Texture2D.
Definition: TextureCube.cs:37
All-in-One Buffer class linked SharpDX.Direct3D11.Buffer.
HRESULT GenerateMipMaps(_In_ const Image &baseImage, _In_ DWORD filter, _In_ size_t levels, _Inout_ ScratchImage &mipChain, _In_ bool allow1D=false)
Flags
Enumeration of the new Assimp's flags.
This is shared across platforms
Allow data to be stored in the alpha component.
A Texture 3D frontend to SharpDX.Direct3D11.Texture3D.
Definition: Texture3D.cs:37
A Texture 2D frontend to SharpDX.Direct3D11.Texture2D.
Definition: Texture2D.cs:37
A Texture 1D frontend to SharpDX.Direct3D11.Texture1D.
Definition: Texture1D.cs:37
Internal structure used to describe a DDS pixel format.
Definition: DDS.cs:93
DDSPixelFormat(PixelFormatFlags flags, int fourCC, int rgbBitCount, uint rBitMask, uint gBitMask, uint bBitMask, uint aBitMask)
Initializes a new instance of the DDSPixelFormat struct.
Definition: DDS.cs:105
PixelFormat
Defines various types of pixel formats.
Definition: PixelFormat.cs:32
Base class for texture resources.
Definition: Texture.cs:38