<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>directxtex Wiki Rss Feed</title><link>https://directxtex.codeplex.com/</link><description>directxtex Wiki Rss Description</description><item><title>Updated Wiki: Version History</title><link>https://directxtex.codeplex.com/wikipage?title=Version History&amp;version=12</link><description>&lt;div class="wikidoc"&gt;&lt;b&gt;April 16, 2013&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Updated alpha-mode metadata details in .DDS files&lt;/li&gt;
&lt;li&gt;Added new control flags for Convert&lt;/li&gt;
&lt;li&gt;Added new optional flags for ComputeMSE&lt;/li&gt;
&lt;li&gt;Fixed conversion handling for sRGB formats&lt;/li&gt;
&lt;li&gt;Fixed internal routines for handling R10G10B10_XR_BIAS_A2_UNORM, R9G9B9E5_SHAREDEXP, and FORMAT_R1_UNORM&lt;/li&gt;
&lt;li&gt;Fixed WIC I/O for GUID_WICPixelFormat32bppRGBE pixel format files (HD Photo)&lt;/li&gt;
&lt;li&gt;Fixed non-square image handling in GenerateMipMaps3D&lt;/li&gt;
&lt;li&gt;Fixed some error handling in the DDS load code&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;March 22, 2013&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Supports reading and writing alpha-mode (straight, premultiplied, etc.) metadata in .DDS files&lt;/li&gt;
&lt;li&gt;Added build option to use WICCreateImagingFactory_Proxy instead of CoCreateInstance to obtain WIC factory&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;January 29, 2013&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Added PremultiplyAlpha to DirectXTex; -pmalpha switch for texconv command-line tool&lt;/li&gt;
&lt;li&gt;Fixed problem with forceSRGB implementation for Ex versions of CreateTexture, CreateShaderResourceView, DDSTextureLoader and WICTextureLoader&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;December 11, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Ex versions of CreateTexture, CreateShaderResourceView, DDSTextureLoader and WICTextureLoader&lt;/li&gt;
&lt;li&gt;Fixed BC2 and BC3 decompression issue for unusual color encoding case&lt;/li&gt;
&lt;li&gt;Converted annotation to SAL2 for improved VS 2012 /analyze experience&lt;/li&gt;
&lt;li&gt;Updated DirectXTex, DDSView, and Texconv with VS 2010 + Windows 8.0 SDK project using official &amp;#39;property sheets&amp;#39;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;November 15, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Added support for WIC2 when available on Windows 8 and Windows 7 with KB 2670838&lt;/li&gt;
&lt;li&gt;Added optional targetGUID parameter to SaveWIC* APIs to influence final container pixel format choice&lt;/li&gt;
&lt;li&gt;Fixed bug in SaveDDS* which was generating invalid DDS files for 1D dimension textures&lt;/li&gt;
&lt;li&gt;Improved robustness of CaptureTexture when resolving MSAA source textures&lt;/li&gt;
&lt;li&gt;Sync&amp;#39;d DDSTextureLoader, ScreenGrab, and WICTextureLoader standalone versions with latest DirectXTK release&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;September 28, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Added ScreenGrab module for creating runtime screenshots&lt;/li&gt;
&lt;li&gt;Renamed project files for better naming consistency&lt;/li&gt;
&lt;li&gt;New Typeless utilities for DirectXTex&lt;/li&gt;
&lt;li&gt;Some minor code cleanup for DirectXTex&amp;#39;s WIC writer function&lt;/li&gt;
&lt;li&gt;Bug fixes and new -tu/-tf options for texconv&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;June 22, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Moved to using XNA Math 2.05 instead of XNA Math 2.04 for USE_XNAMATH builds&lt;/li&gt;
&lt;li&gt;Fixed BGR vs. RGB color channel swizzle problem with 24bpp legacy .DDS files in DirectXTex&lt;/li&gt;
&lt;li&gt;Update to DirectXTex WIC and WICTextureLoader for additional 96bpp float format handling on Windows 8&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;May 31, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Minor fix for DDSTextureLoader&amp;#39;s retry fallback that can happen with 10level9 feature levels&lt;/li&gt;
&lt;li&gt;Switched to use &amp;quot;_DEBUG&amp;quot; instead of &amp;quot;DEBUG&amp;quot; and cleaned up debug warnings&lt;/li&gt;
&lt;li&gt;added Metro style application project files for DirectXTex&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;April 20, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;DirectTex&amp;#39;s WIC-based writer opts-in for the Windows 8 BMP encoder option for writing 32 bpp RGBA files with the BITMAPV5HEADER&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;March 30, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;WICTextureLoader updated with Windows 8 WIC pixel formats                DirectXTex updated with limited non-power-of-2 texture support and TEX&lt;i&gt;FILTER&lt;/i&gt;SEPARATE_ALPHA option&lt;/li&gt;
&lt;li&gt;Texconv updated with &amp;#39;-sepalpha&amp;#39; command-line option&lt;/li&gt;
&lt;li&gt;Added USE_XNAMATH control define to build DirectXTex using either XNAMath or DirectXMath&lt;/li&gt;
&lt;li&gt;Added VS 2012 project files (which use DirectXMath instead of XNAMath and define DXGI&lt;i&gt;1&lt;/i&gt;2_FORMATS)&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;March 15, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Fix for resource leak in CreateShaderResourceView() Direct3D 11 helper function in DirectXTex&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;March 5, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Fix for too much temp memory allocated by WICTextureLoader; cleaned up legacy &amp;#39;min/max&amp;#39; macro usage in DirectXTex&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;February 21, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;WICTextureLoader updated to handle systems and device drivers without BGRA or 16bpp format support&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;February 20, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Some code cleanup for DirectXTex and DDSTextureLoader&lt;/li&gt;
&lt;li&gt;Fixed bug in 10:10:10:2 format fixup in the LoadDDSFromMemory function&lt;/li&gt;
&lt;li&gt;Fixed bugs in &amp;quot;non-zero alpha&amp;quot; special-case handling in LoadTGAFromFile&lt;/li&gt;
&lt;li&gt;Fixed bug in _SwizzleScanline when copying alpha channel for BGRA&amp;lt;-&amp;gt;RGBA swizzling&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;February 11, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Update of DDSTextureLoader to also build in Metro style apps; added WICTextureLoader&lt;/li&gt;
&lt;li&gt;Added CMYK WIC pixel formats to the DirectXTex conversion table&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;January 30, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Minor code-cleanup for DirectXTex to enable use of PCH through &amp;#39;directxtexp.h&amp;#39; header&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;January 24, 2011&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Some code-cleanup for DirectXTex&lt;/li&gt;
&lt;li&gt;Added DXGI 1.2 implementation for DDSTextureLoader and DirectXTex guarded with DXGI&lt;i&gt;1&lt;/i&gt;2_FORMATS compiliation define &lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;December 16, 2011&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Fixed x64 compilation warnings in DDSTextureLoader&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;November 30, 2011&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Fixed some of the constants used in IsSupportedTexture(),&lt;/li&gt;
&lt;li&gt;added ability to strip off top levels of mips in DDSTextureLoader,&lt;/li&gt;
&lt;li&gt;changed DirectXTex to use CoCreateInstance rather than LoadLibrary to obtain the WIC factory,&lt;/li&gt;
&lt;li&gt;a few minor /analyze related annotations for DirectXTex&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;October 27, 2011&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Original release&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Wed, 17 Apr 2013 00:55:23 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Version History 20130417125523A</guid></item><item><title>Updated Wiki: ComputeMSE</title><link>https://directxtex.codeplex.com/wikipage?title=ComputeMSE&amp;version=2</link><description>&lt;div class="wikidoc"&gt;Computes the mean-squared error for each component based on two input images.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
HRESULT ComputeMSE( _In_ &lt;span style="color:Blue;"&gt;const&lt;/span&gt; Image&amp;amp; image1, _In_ &lt;span style="color:Blue;"&gt;const&lt;/span&gt; Image&amp;amp; image2,
    _Out_ &lt;span style="color:Blue;"&gt;float&lt;/span&gt;&amp;amp; mse, _Out_writes_opt_(4) &lt;span style="color:Blue;"&gt;float&lt;/span&gt;* mseV,
    _In_ DWORD flags = 0 );
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Parameters&lt;/h1&gt;
&lt;i&gt;flags&lt;/i&gt;: a combination of the following flags
&lt;ul&gt;&lt;li&gt;CMSE_DEFAULT Default flags&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;CMSE_IMAGE1_SRGB Indicates image1 should have sRGB -&amp;gt; scRGB conversion applied before comparison.&lt;/li&gt;
&lt;li&gt;CMSE_IMAGE2_SRGB Indicates image2 should have sRGB -&amp;gt; scRGB conversion applied before comparison.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;CMSE_IGNORE_RED Indicates comparison should ignore differences in the RED (X) channel.&lt;/li&gt;
&lt;li&gt;CMSE_IGNORE_GREEN Indicates comparison should ignore differences in the GREEN (Y) channel.&lt;/li&gt;
&lt;li&gt;CMSE_IGNORE_BLUE Indicates comparison should ignore differences in the BLUE (Z) channel.&lt;/li&gt;
&lt;li&gt;CMSE_IGNORE_ALPHA Indicates comparison should ignore differences in the ALPHA (W) channel.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Remarks&lt;/h1&gt;
Image data is converted to DXGI_FORMAT_R32G32B32A32_FLOAT for this operation. BC data is automatically decompressed.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Tue, 16 Apr 2013 23:27:06 GMT</pubDate><guid isPermaLink="false">Updated Wiki: ComputeMSE 20130416112706P</guid></item><item><title>Updated Wiki: ComputeMSE</title><link>https://directxtex.codeplex.com/wikipage?title=ComputeMSE&amp;version=1</link><description>&lt;div class="wikidoc"&gt;Computes the mean-squared error for each component based on two input images.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
HRESULT ComputeMSE( _In_ &lt;span style="color:Blue;"&gt;const&lt;/span&gt; Image&amp;amp; image1, _In_ &lt;span style="color:Blue;"&gt;const&lt;/span&gt; Image&amp;amp; image2,
    _Out_ &lt;span style="color:Blue;"&gt;float&lt;/span&gt;&amp;amp; mse, _Out_writes_opt_(4) &lt;span style="color:Blue;"&gt;float&lt;/span&gt;* mseV,
    _In_ DWORD flags = 0 );
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Parameters&lt;/h1&gt;
&lt;i&gt;flags&lt;/i&gt;: a combination of the following flags
&lt;ul&gt;&lt;li&gt;CMSE_DEFAULT Default flags&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;CMSE_IMAGE1_SRGB Indicates image1 should have SRGB -&amp;gt; scRGB conversion applied before comparison.&lt;/li&gt;
&lt;li&gt;CMSE_IMAGE2_SRGB Indicates image2 should have SRGB -&amp;gt; scRGB conversion applied before comparison.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;CMSE_IGNORE_RED Indicates comparison should ignore differences in the RED (X) channel.&lt;/li&gt;
&lt;li&gt;CMSE_IGNORE_GREEN Indicates comparison should ignore differences in the GREEN (Y) channel.&lt;/li&gt;
&lt;li&gt;CMSE_IGNORE_BLUE Indicates comparison should ignore differences in the BLUE (Z) channel.&lt;/li&gt;
&lt;li&gt;CMSE_IGNORE_ALPHA Indicates comparison should ignore differences in the ALPHA (W) channel.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Remarks&lt;/h1&gt;
Image data is converted to DXGI_FORMAT_R32G32B32A32_FLOAT for this operation. BC data is automatically decompressed.&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Tue, 16 Apr 2013 23:26:31 GMT</pubDate><guid isPermaLink="false">Updated Wiki: ComputeMSE 20130416112631P</guid></item><item><title>Updated Wiki: Texture Functions</title><link>https://directxtex.codeplex.com/wikipage?title=Texture Functions&amp;version=19</link><description>&lt;div class="wikidoc"&gt;Functions for doing texture processing based on DirectXTex data typically loaded from a WIC or TGA image file and then written to a .DDS file.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=FlipRotate&amp;referringTitle=Texture%20Functions"&gt;FlipRotate&lt;/a&gt;&lt;br /&gt;Flip and/or rotate image or set of images.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=Resize&amp;referringTitle=Texture%20Functions"&gt;Resize&lt;/a&gt;&lt;br /&gt;Resize an image or set of images.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=Convert&amp;referringTitle=Texture%20Functions"&gt;Convert&lt;/a&gt;&lt;br /&gt;Convert an image or set of images from one pixel format to another.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=GenerateMipMaps&amp;referringTitle=Texture%20Functions"&gt;GenerateMipMaps&lt;/a&gt;&lt;br /&gt;Generates mipmaps for an image or a set of images.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=GenerateMipMaps3D&amp;referringTitle=Texture%20Functions"&gt;GenerateMipMaps3D&lt;/a&gt;&lt;br /&gt;Generates mipmaps for a 3D volume texture from a set of images representing the slices.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=PremultiplyAlpha&amp;referringTitle=Texture%20Functions"&gt;PremultiplyAlpha&lt;/a&gt;&lt;br /&gt;This converts an image assuming the original is not using premultiplied alpha into a premultiplied alpha version of the same image.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=Compress&amp;referringTitle=Texture%20Functions"&gt;Compress&lt;/a&gt;&lt;br /&gt;Compresses an image or set of images to a BC format. &lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=Decompress&amp;referringTitle=Texture%20Functions"&gt;Decompress&lt;/a&gt;&lt;br /&gt;Decompresses a BC format to a non-BC format image.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=ComputeNormalMap&amp;referringTitle=Texture%20Functions"&gt;ComputeNormalMap&lt;/a&gt;&lt;br /&gt;Converts a height-map to a normal-map.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CopyRectangle&lt;/b&gt;&lt;br /&gt;Copies a rectangle from a soure image to a destination image. Does not support block compressed formats.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=ComputeMSE&amp;referringTitle=Texture%20Functions"&gt;ComputeMSE&lt;/a&gt;&lt;br /&gt;Computes the mean-squared error for each component based on two input images.&lt;br /&gt;
&lt;h1&gt;Examples&lt;/h1&gt;
These are flexible functions for doing texture processing that can be used in many different ways. See the &lt;b&gt;Texconv&lt;/b&gt; command-line utility for some extensive examples of using them.&lt;br /&gt;
&lt;h1&gt;Related Flags&lt;/h1&gt;
See &lt;a href="https://directxtex.codeplex.com/wikipage?title=Filter%20Flags&amp;referringTitle=Texture%20Functions"&gt;Filter Flags&lt;/a&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Tue, 16 Apr 2013 23:21:03 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Texture Functions 20130416112103P</guid></item><item><title>Updated Wiki: Filter Flags</title><link>https://directxtex.codeplex.com/wikipage?title=Filter Flags&amp;version=6</link><description>&lt;div class="wikidoc"&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;enum&lt;/span&gt; TEX_FILTER_FLAGS
&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_DEFAULT&lt;/b&gt; Default flags&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_SEPARATE_ALPHA&lt;/b&gt; WIC makes use of pre-multiplied alpha when resizing images, which works fine for standard transparency data. If the alpha channel, however, contains some other kind of value then the resulting image can have &amp;#39;holes&amp;#39; in it. Use of this flag uses an alternative algorithm which resizes the RGB and alpha channels independantly and then recombines the result.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;This selects the use of dithering for resizing and format conversions. By default it uses no dithering.
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_DITHER&lt;/b&gt; 4x4 dithering&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_DITHER_DIFFUSION&lt;/b&gt; Error-diffusion dithering&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;This selects the filtering mode used for resizing. By default it uses &amp;quot;Fant&amp;quot;.
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_POINT&lt;/b&gt; Nearest neighbhor&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_LINEAR&lt;/b&gt; Linear&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_CUBIC&lt;/b&gt; Cubic&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_FANT&lt;/b&gt; Fant which is euivalent to a box filter for down-scaling.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;This controls color space transformation for conversions.
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_SRGB_IN&lt;/b&gt; Indicates the input format is the sRGB (gamma 2.2) format. This is implied if using a DXGI_FORMAT_*_SRGB format&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_SRGB_OUT&lt;/b&gt; Indicates the output format is the sRGB (gamma 2.2) format. This is implied if using a DXGI_FORMAT_*_SRGB format&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_SRGB&lt;/b&gt; This is the same as setting both TEX_FILTER_SRGB_IN  and TEX_FILTER_SRGB_OUT &lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;When both WIC-based and non-WIC based codepaths are in place, these flags can influence the standard logic choice:
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_FORCE_NON_WIC&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_FORCE_WIC&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;For Convert operations, these flags control special-case logic in the non-WIC paths. Without these flags, RGB to R conversions default to converting to a luminance value and RGB to RG conversion defaults to coping the RED and GREEN channels.
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_RGB_COPY_RED&lt;/b&gt; When converting from RGB to R formats, this indicates that the RED channel could be copied. For RGB to RG conversions, it can be combined with GREEN or BLUE to control which channels end up in the output.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_RGB_COPY_GREEN&lt;/b&gt; When converting from RGB to R formats, this indicates that the GREEN channel could be copied. For RGB to RG conversions, it can be combined with RED or BLUE to control which channels end up in the output.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_RGB_COPY_BLUE&lt;/b&gt; When converting from RGB to R formats, this indicates that the BLUE channel could be copied. For RGB to RG conversions, it can be combined with RED or GREEN to control which channels end up in the output.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Tue, 16 Apr 2013 23:19:45 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Filter Flags 20130416111945P</guid></item><item><title>Updated Wiki: Filter Flags</title><link>https://directxtex.codeplex.com/wikipage?title=Filter Flags&amp;version=5</link><description>&lt;div class="wikidoc"&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;enum&lt;/span&gt; TEX_FILTER_FLAGS
&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_DEFAULT&lt;/b&gt; Default flags&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_SEPARATE_ALPHA&lt;/b&gt; WIC makes use of pre-multiplied alpha when resizing images, which works fine for standard transparency data. If the alpha channel, however, contains some other kind of value then the resulting image can have &amp;#39;holes&amp;#39; in it. Use of this flag uses an alternative algorithm which resizes the RGB and alpha channels independantly and then recombines the result.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;This selects the use of dithering for resizing and format conversions. By default it uses no dithering.
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_DITHER&lt;/b&gt; 4x4 dithering&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_DITHER_DIFFUSION&lt;/b&gt; Error-diffusion dithering&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;This selects the filtering mode used for resizing. By default it uses &amp;quot;Fant&amp;quot;.
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_POINT&lt;/b&gt; Nearest neighbhor&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_LINEAR&lt;/b&gt; Linear&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_CUBIC&lt;/b&gt; Cubic&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_FANT&lt;/b&gt; Fant which is euivalent to a box filter for down-scaling.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;This controls color space transformation for conversions.
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_SRGB_IN&lt;/b&gt; Indicates the input format is the sRGB (gamma 2.2) format. This is implied if using a DXGI_FORMAT_*_SRGB format&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_SRGB_OUT&lt;/b&gt; Indicates the output format is the sRGB (gamma 2.2) format. This is implied if using a DXGI_FORMAT_*_SRGB format&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_SRGB&lt;/b&gt; This is the same as setting both TEX_FILTER_SRGB_IN  and TEX_FILTER_SRGB_OUT &lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;When both WIC-based and non-WIC based codepaths are in place, these flags can influence the standard logic choice:
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_FORCE_NON_WIC&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_FORCE_WIC&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;For Convert operations, these flags control special-case logic in the non-WIC paths:
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_RGB_COPY_RED&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_RGB_COPY_GREEN&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_RGB_COPY_BLUE&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Tue, 16 Apr 2013 23:17:06 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Filter Flags 20130416111706P</guid></item><item><title>Updated Wiki: Filter Flags</title><link>https://directxtex.codeplex.com/wikipage?title=Filter Flags&amp;version=4</link><description>&lt;div class="wikidoc"&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;enum&lt;/span&gt; TEX_FILTER_FLAGS
&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_DEFAULT&lt;/b&gt; Default flags&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_SEPARATE_ALPHA&lt;/b&gt; WIC makes use of pre-multiplied alpha when resizing images, which works fine for standard transparency data. If the alpha channel, however, contains some other kind of value then the resulting image can have &amp;#39;holes&amp;#39; in it. Use of this flag uses an alternative algorithm which resizes the RGB and alpha channels independantly and then recombines the result.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;This selects the use of dithering for resizing and format conversions. By default it uses no dithering.
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_DITHER&lt;/b&gt; 4x4 dithering&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_DITHER_DIFFUSION&lt;/b&gt; Error-diffusion dithering&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;This selects the filtering mode used for resizing. By default it uses &amp;quot;Fant&amp;quot;.
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_POINT&lt;/b&gt; Nearest neighbhor&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_LINEAR&lt;/b&gt; Linear&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_CUBIC&lt;/b&gt; Cubic&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_FANT&lt;/b&gt; Fant which is euivalent to a box filter for down-scaling.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;This controls color space transformation for conversions.
&lt;ul&gt;&lt;li&gt;&lt;b&gt;TEX_FILTER_SRGB_IN&lt;/b&gt; Indicates the input format is the sRGB (gamma 2.2) format. This is implied if using a DXGI_FORMAT_*_SRGB format&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_SRGB_OUT&lt;/b&gt; Indicates the output format is the sRGB (gamma 2.2) format. This is implied if using a DXGI_FORMAT_*_SRGB format&lt;/li&gt;
&lt;li&gt;&lt;b&gt;TEX_FILTER_SRGB&lt;/b&gt; This is the same as setting both TEX_FILTER_SRGB_IN  and TEX_FILTER_SRGB_OUT &lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;When both WIC-based and non-WIC based codepaths are in place, these flags can influence the standard logic choice:
&lt;ul&gt;&lt;li&gt;TEX_FILTER_FORCE_NON_WIC&lt;/li&gt;
&lt;li&gt;TEX_FILTER_FORCE_WIC&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;For Convert operations, these flags control special-case logic in the non-WIC paths:
&lt;ul&gt;&lt;li&gt;TEX_FILTER_RGB_COPY_RED&lt;/li&gt;
&lt;li&gt;TEX_FILTER_RGB_COPY_GREEN&lt;/li&gt;
&lt;li&gt;TEX_FILTER_RGB_COPY_BLUE&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Tue, 16 Apr 2013 23:16:46 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Filter Flags 20130416111646P</guid></item><item><title>Updated Wiki: DirectXTex</title><link>https://directxtex.codeplex.com/wikipage?title=DirectXTex&amp;version=23</link><description>&lt;div class="wikidoc"&gt;The DirectXTex library includes a full-featured DDS reader and writer including legacy format conversions, a TGA reader and writer, a WIC-based bitmap reader and writer (BMP, JPEG, PNG, TIFF, and HD Photo), and various texture processing functions. This is intended primarily for tool usage.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;The library assumes that the client code will have already called CoInitialize or CoInitializeEx as needed by the application before calling any DirectXTex routines&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;NOTE: DirectXTex is not supported on Windows Phone 8, because WIC is not available on that platform. The .DDS files it generates are suitable for use on Windows Phone 8 assuming the pixel format is supported by the device (currently Feature Level 9.3).&lt;br /&gt;
&lt;h1&gt;Headers&lt;/h1&gt;The majority of the header files here are intended for internal implementation of the library only (BC.h, DDS.h, DirectXTexP.h, and scoped.h). Only DirectXTex.h is meant as a &amp;#39;public&amp;#39; header for the library.&lt;br /&gt;
&lt;h1&gt;Namespace&lt;/h1&gt;All the functions in the library are in the &amp;quot;DirectX&amp;quot; C++ namespace.&lt;br /&gt;
&lt;h1&gt;Functions&lt;/h1&gt;
&lt;a href="https://directxtex.codeplex.com/wikipage?title=DDS%20I%2fO%20Functions&amp;referringTitle=DirectXTex"&gt;DDS I&amp;#47;O Functions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=TGA%20I%2fO%20Functions&amp;referringTitle=DirectXTex"&gt;TGA I&amp;#47;O Functions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=WIC%20I%2fO%20Functions&amp;referringTitle=DirectXTex"&gt;WIC I&amp;#47;O Functions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=Texture%20Functions&amp;referringTitle=DirectXTex"&gt;Texture Functions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=Direct3D%2011%20Helper%20Functions&amp;referringTitle=DirectXTex"&gt;Direct3D 11 Helper Functions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=Utility%20Functions&amp;referringTitle=DirectXTex"&gt;Utility Functions&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;Structures&lt;/h2&gt;&lt;b&gt;TexMetadata&lt;/b&gt; contains metadata information about the texture resource and organization such as width, height, depth, format, dimension, etc.
&lt;ul&gt;&lt;li&gt;TEX_DIMENSION_TEXTURE1D, TEX_DIMENSION_TEXTURE2D, and TEX_DIMENSION_TEXTURE3D are alises for D3D10_RESOURCE_DIMEMSION and D3D11_RESOURCE_DIMENSION. &lt;/li&gt;
&lt;li&gt;TEX_MISC_TEXTURECUBE is an alias for the same D3D10_RESOURCE_MISC_FLAG and D3D11_RESOURCE_MISC_FLAG.&lt;/li&gt;
&lt;li&gt;TEX_MISC2_ALPHA_MODE_MASK is a mask for miscFlags2 to obtain the TEX_ALPHA_MODE.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;Image&lt;/b&gt; contains information about the surface including width, height, format, pitch, and a pointer to pixel data.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ScratchImage&lt;/b&gt; is a helper class that manages memory for functions that return a Image or set of Images.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Blob&lt;/b&gt; is a helper class that manages for functions that return a binary blob of data.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Rect&lt;/b&gt; contains a simple pixel-based rectangle used by the &lt;b&gt;CopyRectangle&lt;/b&gt; function.&lt;br /&gt;
&lt;h1&gt;Adding to a VS Project&lt;/h1&gt;In your application&amp;#39;s solution, right-click on the Solution and use &amp;quot;Add \ Existing Project...&amp;quot; to add the appropriate .vcxproj file to your solution.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;i&gt;DirectXTex_Desktop_2012&lt;/i&gt; is for Win32 desktop applications building with VS 2012 Express for Desktop, VS 2012 Professional or higher&lt;/li&gt;
&lt;li&gt;&lt;i&gt;DirectXTex_Desktop_2010_SDK80&lt;/i&gt; is for Win32 desktop applications building with VS 2010 using the Windows 8.0 SDK&lt;/li&gt;
&lt;li&gt;&lt;i&gt;DirectXTex_Desktop_2010&lt;/i&gt; is for Win32 desktop applications building with VS 2010 using an older Windows SDK using XNAMath 2.05 rather than DirectXMath &lt;a href="http://blogs.msdn.com/b/chuckw/archive/2012/06/22/xna-math-version-2-05-smoothing-the-transition-to-directxmath.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2012/06/22/xna-math-version-2-05-smoothing-the-transition-to-directxmath.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;DirectXTex_Windows8&lt;/i&gt; is for Windows Store apps building with VS 2012&lt;/li&gt;&lt;/ul&gt;
In your application&amp;#39;s project, right-click on the Project and use &amp;quot;References...&amp;quot;, then &amp;quot;Add New Reference...&amp;quot;, and then check the DirectXTex project name and click OK. For a &lt;b&gt;Windows Store app&lt;/b&gt;, you need to set &lt;i&gt;Reference Assembly Output&lt;/i&gt; to &lt;i&gt;false&lt;/i&gt; since DirectXTex is a static C++ library and not a WinRT component.&lt;br /&gt;&lt;br /&gt;In your application&amp;#39;s project settings, on the &amp;quot;C++ / General&amp;quot; page set Configuration to &amp;quot;All Configurations&amp;quot;, set Platform to &amp;quot;All Platforms&amp;quot;, and then add the relative path to &lt;b&gt;DirectXTex;&lt;/b&gt; to the &lt;i&gt;Additional Include Directories&lt;/i&gt; properties. Click Apply.&lt;br /&gt;
&lt;h1&gt;Release Notes&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;The alpha mode specification for DDS files was updated between the March 2013 and April 2013 releases. Any DDS files created using the DDS_FLAGS_FORCE_DX10_EXT_MISC2 flag or the texconv -dx10 switch using the March 2013 release should be refreshed.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;The DirectXTex library does not support block compression or decompression of mipmapped non-power-of-2 textures, although &lt;a href="https://directxtex.codeplex.com/wikipage?title=DDSTextureLoader&amp;referringTitle=DirectXTex"&gt;DDSTextureLoader&lt;/a&gt; will load these files correctly if the underlying device supports it. &lt;i&gt;CodePlex issue 640&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;The DirectXTex library only supports CLAMP filtering, and does not yet support MIRROR or WRAP filtering  (WIC operations only support CLAMP filtering). &lt;i&gt;CodePlex issue 641&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;The DirectXTex library only supports box and POINT filtering, and does not support LINEAR or CUBIC filtering, for 3D volume mipmap-generation. &lt;i&gt;CodePlex issue 642&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;The WIC conversion cases currently ignore TEX_FILTER_SRGB_IN and TEX_FILTER_SRGB_OUT out, which results in incorrect sRGB handling in a number of cases. &lt;i&gt;CodePlex issue 643&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Due to the underlying Windows BMP WIC codec, alpha channels are not supported for 16bpp or 32bpp BMP pixel format files. The Windows 8 version of the Windows BMP WIC codec does support 32bpp pixel formats with alpha when using the BITMAPV5HEADER file header.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;For the DXGI 1.1 version of DirectXTex, 4:4:4:4 pixel format DDS files are always expanded to 8:8:8:8 upon load since DXGI 1.0 and DXGI 1.1 versions of Direct3D do not support these resource formats. The DXGI 1.2 version (indicated by #define DXGI_1_2_FORMATS) of DirectXTex  make use of the DXGI_FORMAT_B4G4R4A4_UNORM format instead.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;While DXGI 1.0 and DXGI 1.1 include 5:6:5 (DXGI_FORMAT_B5G6R5_UNORM) and 5:5:5:1 (DXGI_FORMAT_B5G5R5A1_UNORM) pixel format enumerations, the DirectX 10.x and 11.0 Runtimes do not support these formats for use with Direct3D. The DirectX 11.1 runtime, DXGI 1.2, and the WDDM 1.2 driver model fully support 16bpp formats (5:6:5, 5:5:5:1, and 4:4:4:4).&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Loading of 96bpp floating-point TIFF files results in a corrupted image prior to Windows 8. This fix is available on Windows 7 SP1 with KB 2670838 installed.&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Tue, 16 Apr 2013 18:47:44 GMT</pubDate><guid isPermaLink="false">Updated Wiki: DirectXTex 20130416064744P</guid></item><item><title>Updated Wiki: DDSTextureLoader</title><link>https://directxtex.codeplex.com/wikipage?title=DDSTextureLoader&amp;version=24</link><description>&lt;div class="wikidoc"&gt;A streamlined version of the DirectX SDK sample DDSWithoutD3DX11 texture loading code for a simple light-weight runtime .DDS file loader. This version only supports Direct3D 11 and performs no runtime pixel data conversions (see &lt;i&gt;Release Notes&lt;/i&gt; for more details). This is ideal for runtime usage, and supports the full complement of Direct3D 11 texture resources (1D, 2D, volume maps, cubemaps, mipmap levels, texture arrays, BC formats, etc.). It supports both legacy and &amp;#39;DX10&amp;#39; extension header format .dds files.&lt;br /&gt;&lt;br /&gt;Also part of DirectXTK &lt;a href="http://go.microsoft.com/fwlink/?LinkId=248929"&gt;http://go.microsoft.com/fwlink/?LinkId=248929&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;Functions&lt;/h1&gt;
&lt;b&gt;CreateDDSTextureFromMemory&lt;/b&gt;&lt;br /&gt;Loads a .DDS file assuming the image of the file is located in a memory buffer. Creates a Direct3D 11 resource and optionally a Direct3D 11 shader resource view.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromFile&lt;/b&gt;&lt;br /&gt;Loads a .DDS file from disk and creates a Direct3D 11 resource and optionally a Direct3D 11 shader resource view.&lt;br /&gt;&lt;br /&gt;For both these functions if &amp;#39;maxsize&amp;#39; parameter non-zero, then all mipmap levels larger than the maxsize are ignored before creating the Direct3D 11 resource. This allows for load-time scaling. If &amp;#39;0&amp;#39;, then if the attempt to create the Direct3D 11 resource fails and there are mipmaps present, it will retry assuming a maxsize based on the device&amp;#39;s current feature level.&lt;br /&gt;&lt;br /&gt;For both these functions if &amp;#39;maxsize&amp;#39; parameter non-zero, then all mipmap levels larger than the maxsize are ignored before creating the Direct3D 11 resource. This allows for load-time scaling. If &amp;#39;0&amp;#39;, then if the attempt to create the Direct3D 11 resource fails and there are mipmaps present, it will retry assuming a maxsize based on the device&amp;#39;s current feature level.&lt;br /&gt;&lt;br /&gt;The last optional parameter for both functions is a pointer to return the &lt;i&gt;alpha mode&lt;/i&gt; of the DDS file. This can be one of the following values to return information about the alpha channel if present in the file:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DDS_ALPHA_MODE_UNKNOWN (0) - This is the default for most .DDS files if the specific metadata isn&amp;#39;t present, and it&amp;#39;s up to the application to know if it&amp;#39;s really something else. Viewers should assume the alpha channel is intended for &amp;#39;normal&amp;#39; alpha blending.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_STRAIGHT (1) - This indicates that the alpha channel if present is assumed to be using &amp;#39;straight&amp;#39; alpha. Viewers should use the alpha channel with &amp;#39;normal&amp;#39; alpha blending.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_PREMULTIPLIED (2) - This indicates the alpha channel if present is premultiplied alpha. This information is only present if the file is written using the latest version of the &amp;quot;DX10&amp;quot; extended header, or if the file is BC2/BC3 with the &amp;quot;DXT2&amp;quot;/&amp;quot;DXT4&amp;quot; FourCC which are explicitly stored as premultiplied alpha. Viewers should use the alpha channel with premultiplied alpha blending.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_OPAQUE (3) - This indicates that the alpha channel if present is fully opaque for all pixels. Viewers can assume there is no alpha blending.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_CUSTOM (4) - This indicates the alpha channel if present does not contain transparency (neither straight or premultiplied alpha) and instead is encoding some other channel of information. Viewers should not use the alpha channel for blending, and should instead view it as a distinct image channel.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromMemoryEx&lt;/b&gt;&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromFileEx&lt;/b&gt;&lt;br /&gt;These versions provide explicit control over the created resource&amp;#39;s usage, binding flags, CPU access flags, and miscellaneous flags for advanced / expert scenarios. The standard routines default to D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, and 0 respectively. For cubemaps, the miscellaneous flags default to D3D11_RESOURCE_MISC_TEXTURECUBE. There is also a &amp;#39;forceSRGB&amp;#39; option for working around gamma issues with content that is in the sRGB or similar color space but is not encoded explicitly as an SRGB format. Note that the &amp;#39;maxsize&amp;#39; parameter is not at the end of the parameter list like it is in the non-Ex version.&lt;br /&gt;
&lt;h1&gt;Example&lt;/h1&gt;
This example creates a shader resource view on the ID3D11Device d3dDevice which can be used for rendering.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
ID3D11ShaderResourceView* pSRV = &lt;span style="color:Blue;"&gt;nullptr&lt;/span&gt;;
HRESULT hr = CreateDDSTextureFromFile( d3dDevice, L&lt;span style="color:#A31515;"&gt;&amp;quot;SEAFLOOR.DDS&amp;quot;&lt;/span&gt;, &lt;span style="color:Blue;"&gt;nullptr&lt;/span&gt;, &amp;amp;pSRV );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; (FAILED(hr))
   &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Feature Level Notes&lt;/h1&gt;In order to support all feature levels, you should make sure your DDS textures are mip-mapped so that they contain a suitably sized image. Non-mipmapped textures will either need explicit feature level association, or be sized less than or equal to 2048 for 1D, 2048 x 2048 for 2D, 512 x 512 for cubemaps, and 256 x 256 x 256 for volume maps.&lt;br /&gt;&lt;br /&gt;Texture arrays require Feature Level  10.0 or later. Cubemap arrays requires Feature Level 10.1 or later.&lt;br /&gt;&lt;br /&gt;Be sure to review the various format limitations for the different feature levels. To support all feature levels, stick with textures in the following formats:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8G8B8A8_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_B8G8R8A8_UNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R16G16_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8G8_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8_UNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM_SRGB&lt;/li&gt;&lt;/ul&gt;
On Windows 8 with WDDM 1.2 drivers, all feature levels support 16bpp formats as well DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, and DXGI_FORMAT_B4G4R4A4_UNORM.&lt;br /&gt;
&lt;h1&gt;Release Notes&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;DDSTextureLoader performs no run-time conversions. If there is not a direct mapping to a DXGI supported format, the function fails. You can make use of the DirectXTex library or texconv tool to convert legacy Direct3D9 DDS files to a supported format. Legacy formats which require conversion include:
&lt;ul&gt;&lt;li&gt;D3DFMT_R8G8B8 (24bpp RGB) - Use a 32bpp format &lt;/li&gt;
&lt;li&gt;D3DFMT_X8B8G8R8 (32bpp RGBX) - Use BGRX, BGRA, or RGBA&lt;/li&gt;
&lt;li&gt;D3DFMT_A2R10G10B10 (BGRA 10:10:10:2) - Use RGBA 10:10:10:2&lt;/li&gt;
&lt;li&gt;D3DFMT_X1R5G5B5 (BGR 5:5:5) - Use BGRA 5:5:5:1 or BGR 5:6:5&lt;/li&gt;
&lt;li&gt;D3DFMT_A8R3G3B2, D3DFMT_R3G3B2 (BGR 3:3:2) - Expand to a supported format&lt;/li&gt;
&lt;li&gt;D3DFMT_P8, D3DFMT_A8P8 (8-bit palette) - Expand to a supported format&lt;/li&gt;
&lt;li&gt;D3DFMT_A4L4 (Luminance 4:4) - Expand to a supported format&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;a href="http://go.microsoft.com/fwlink/?LinkId=248926"&gt;http://go.microsoft.com/fwlink/?LinkId=248926&lt;/a&gt;. &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If built with #define DXGI_1_2_FORMATS the code supports loading BGRA 4:4:4:4 files. Otherwise, it fails.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;On a system with the DirectX 11.0 Runtime or lacking WDDM 1.2 drivers, attempts to load 16bpp format files (BGR 5:6:5, BGRA 5:5:5:1, and BGRA 4:4:4:4) will fail.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Partial cubemaps (i.e. DDS files without all six faces defined) are not supported by Direct3D 11.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Further Reading&lt;/h1&gt;&lt;a href="http://blogs.msdn.com/b/chuckw/archive/2010/02/05/the-dds-file-format-lives.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2010/02/05/the-dds-file-format-lives.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb219822.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/bb219822.aspx&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Thu, 11 Apr 2013 22:43:50 GMT</pubDate><guid isPermaLink="false">Updated Wiki: DDSTextureLoader 20130411104350P</guid></item><item><title>Updated Wiki: DirectXTex</title><link>https://directxtex.codeplex.com/wikipage?title=DirectXTex&amp;version=22</link><description>&lt;div class="wikidoc"&gt;The DirectXTex library includes a full-featured DDS reader and writer including legacy format conversions, a TGA reader and writer, a WIC-based bitmap reader and writer (BMP, JPEG, PNG, TIFF, and HD Photo), and various texture processing functions. This is intended primarily for tool usage.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;The library assumes that the client code will have already called CoInitialize or CoInitializeEx as needed by the application before calling any DirectXTex routines&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;NOTE: DirectXTex is not supported on Windows Phone 8, because WIC is not available on that platform. The .DDS files it generates are suitable for use on Windows Phone 8 assuming the pixel format is supported by the device (currently Feature Level 9.3).&lt;br /&gt;
&lt;h1&gt;Headers&lt;/h1&gt;The majority of the header files here are intended for internal implementation of the library only (BC.h, DDS.h, DirectXTexP.h, and scoped.h). Only DirectXTex.h is meant as a &amp;#39;public&amp;#39; header for the library.&lt;br /&gt;
&lt;h1&gt;Namespace&lt;/h1&gt;All the functions in the library are in the &amp;quot;DirectX&amp;quot; C++ namespace.&lt;br /&gt;
&lt;h1&gt;Functions&lt;/h1&gt;
&lt;a href="https://directxtex.codeplex.com/wikipage?title=DDS%20I%2fO%20Functions&amp;referringTitle=DirectXTex"&gt;DDS I&amp;#47;O Functions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=TGA%20I%2fO%20Functions&amp;referringTitle=DirectXTex"&gt;TGA I&amp;#47;O Functions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=WIC%20I%2fO%20Functions&amp;referringTitle=DirectXTex"&gt;WIC I&amp;#47;O Functions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=Texture%20Functions&amp;referringTitle=DirectXTex"&gt;Texture Functions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=Direct3D%2011%20Helper%20Functions&amp;referringTitle=DirectXTex"&gt;Direct3D 11 Helper Functions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://directxtex.codeplex.com/wikipage?title=Utility%20Functions&amp;referringTitle=DirectXTex"&gt;Utility Functions&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;Structures&lt;/h2&gt;&lt;b&gt;TexMetadata&lt;/b&gt; contains metadata information about the texture resource and organization such as width, height, depth, format, dimension, etc.
&lt;ul&gt;&lt;li&gt;TEX_DIMENSION_TEXTURE1D, TEX_DIMENSION_TEXTURE2D, and TEX_DIMENSION_TEXTURE3D are alises for D3D10_RESOURCE_DIMEMSION and D3D11_RESOURCE_DIMENSION. &lt;/li&gt;
&lt;li&gt;TEX_MISC_TEXTURECUBE is an alias for the same D3D10_RESOURCE_MISC_FLAG and D3D11_RESOURCE_MISC_FLAG.&lt;/li&gt;
&lt;li&gt;TEX_MISC2_ALPHA_MODE_MASK is a mask for miscFlags2 to obtain the TEX_ALPHA_MODE.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;Image&lt;/b&gt; contains information about the surface including width, height, format, pitch, and a pointer to pixel data.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ScratchImage&lt;/b&gt; is a helper class that manages memory for functions that return a Image or set of Images.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Blob&lt;/b&gt; is a helper class that manages for functions that return a binary blob of data.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Rect&lt;/b&gt; contains a simple pixel-based rectangle used by the &lt;b&gt;CopyRectangle&lt;/b&gt; function.&lt;br /&gt;
&lt;h1&gt;Adding to a VS Project&lt;/h1&gt;In your application&amp;#39;s solution, right-click on the Solution and use &amp;quot;Add \ Existing Project...&amp;quot; to add the appropriate .vcxproj file to your solution.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;i&gt;DirectXTex_Desktop_2012&lt;/i&gt; is for Win32 desktop applications building with VS 2012 Express for Desktop, VS 2012 Professional or higher&lt;/li&gt;
&lt;li&gt;&lt;i&gt;DirectXTex_Desktop_2010_SDK80&lt;/i&gt; is for Win32 desktop applications building with VS 2010 using the Windows 8.0 SDK&lt;/li&gt;
&lt;li&gt;&lt;i&gt;DirectXTex_Desktop_2010&lt;/i&gt; is for Win32 desktop applications building with VS 2010 using an older Windows SDK using XNAMath 2.05 rather than DirectXMath &lt;a href="http://blogs.msdn.com/b/chuckw/archive/2012/06/22/xna-math-version-2-05-smoothing-the-transition-to-directxmath.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2012/06/22/xna-math-version-2-05-smoothing-the-transition-to-directxmath.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;DirectXTex_Windows8&lt;/i&gt; is for Windows Store apps building with VS 2012&lt;/li&gt;&lt;/ul&gt;
In your application&amp;#39;s project, right-click on the Project and use &amp;quot;References...&amp;quot;, then &amp;quot;Add New Reference...&amp;quot;, and then check the DirectXTex project name and click OK. For a &lt;b&gt;Windows Store app&lt;/b&gt;, you need to set &lt;i&gt;Reference Assembly Output&lt;/i&gt; to &lt;i&gt;false&lt;/i&gt; since DirectXTex is a static C++ library and not a WinRT component.&lt;br /&gt;&lt;br /&gt;In your application&amp;#39;s project settings, on the &amp;quot;C++ / General&amp;quot; page set Configuration to &amp;quot;All Configurations&amp;quot;, set Platform to &amp;quot;All Platforms&amp;quot;, and then add the relative path to &lt;b&gt;DirectXTex;&lt;/b&gt; to the &lt;i&gt;Additional Include Directories&lt;/i&gt; properties. Click Apply.&lt;br /&gt;
&lt;h1&gt;Release Notes&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;The DirectXTex library does not support block compression or decompression of mipmapped non-power-of-2 textures, although &lt;a href="https://directxtex.codeplex.com/wikipage?title=DDSTextureLoader&amp;referringTitle=DirectXTex"&gt;DDSTextureLoader&lt;/a&gt; will load these files correctly if the underlying device supports it. &lt;i&gt;CodePlex issue 640&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;The DirectXTex library only supports CLAMP filtering, and does not yet support MIRROR or WRAP filtering  (WIC operations only support CLAMP filtering). &lt;i&gt;CodePlex issue 641&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;The DirectXTex library only supports box and POINT filtering, and does not support LINEAR or CUBIC filtering, for 3D volume mipmap-generation. &lt;i&gt;CodePlex issue 642&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;The WIC conversion cases currently ignore TEX_FILTER_SRGB_IN and TEX_FILTER_SRGB_OUT out, which results in incorrect sRGB handling in a number of cases. &lt;i&gt;CodePlex issue 643&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Due to the underlying Windows BMP WIC codec, alpha channels are not supported for 16bpp or 32bpp BMP pixel format files. The Windows 8 version of the Windows BMP WIC codec does support 32bpp pixel formats with alpha when using the BITMAPV5HEADER file header.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;For the DXGI 1.1 version of DirectXTex, 4:4:4:4 pixel format DDS files are always expanded to 8:8:8:8 upon load since DXGI 1.0 and DXGI 1.1 versions of Direct3D do not support these resource formats. The DXGI 1.2 version (indicated by #define DXGI_1_2_FORMATS) of DirectXTex  make use of the DXGI_FORMAT_B4G4R4A4_UNORM format instead.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;While DXGI 1.0 and DXGI 1.1 include 5:6:5 (DXGI_FORMAT_B5G6R5_UNORM) and 5:5:5:1 (DXGI_FORMAT_B5G5R5A1_UNORM) pixel format enumerations, the DirectX 10.x and 11.0 Runtimes do not support these formats for use with Direct3D. The DirectX 11.1 runtime, DXGI 1.2, and the WDDM 1.2 driver model fully support 16bpp formats (5:6:5, 5:5:5:1, and 4:4:4:4).&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Loading of 96bpp floating-point TIFF files results in a corrupted image prior to Windows 8. This fix is available on Windows 7 SP1 with KB 2670838 installed.&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Thu, 11 Apr 2013 22:40:55 GMT</pubDate><guid isPermaLink="false">Updated Wiki: DirectXTex 20130411104055P</guid></item><item><title>Updated Wiki: DDSTextureLoader</title><link>http://directxtex.codeplex.com/wikipage?title=DDSTextureLoader&amp;version=23</link><description>&lt;div class="wikidoc"&gt;A streamlined version of the DirectX SDK sample DDSWithoutD3DX11 texture loading code for a simple light-weight runtime .DDS file loader. This version only supports Direct3D 11 and performs no runtime pixel data conversions (see &lt;i&gt;Release Notes&lt;/i&gt; for more details). This is ideal for runtime usage, and supports the full complement of Direct3D 11 texture resources (1D, 2D, volume maps, cubemaps, mipmap levels, texture arrays, BC formats, etc.). It supports both legacy and &amp;#39;DX10&amp;#39; extension header format .dds files.&lt;br /&gt;&lt;br /&gt;Also part of DirectXTK &lt;a href="http://go.microsoft.com/fwlink/?LinkId=248929"&gt;http://go.microsoft.com/fwlink/?LinkId=248929&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;Functions&lt;/h1&gt;
&lt;b&gt;CreateDDSTextureFromMemory&lt;/b&gt;&lt;br /&gt;Loads a .DDS file assuming the image of the file is located in a memory buffer. Creates a Direct3D 11 resource and optionally a Direct3D 11 shader resource view.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromFile&lt;/b&gt;&lt;br /&gt;Loads a .DDS file from disk and creates a Direct3D 11 resource and optionally a Direct3D 11 shader resource view.&lt;br /&gt;&lt;br /&gt;For both these functions if &amp;#39;maxsize&amp;#39; parameter non-zero, then all mipmap levels larger than the maxsize are ignored before creating the Direct3D 11 resource. This allows for load-time scaling. If &amp;#39;0&amp;#39;, then if the attempt to create the Direct3D 11 resource fails and there are mipmaps present, it will retry assuming a maxsize based on the device&amp;#39;s current feature level.&lt;br /&gt;&lt;br /&gt;For both these functions if &amp;#39;maxsize&amp;#39; parameter non-zero, then all mipmap levels larger than the maxsize are ignored before creating the Direct3D 11 resource. This allows for load-time scaling. If &amp;#39;0&amp;#39;, then if the attempt to create the Direct3D 11 resource fails and there are mipmaps present, it will retry assuming a maxsize based on the device&amp;#39;s current feature level.&lt;br /&gt;&lt;br /&gt;The last optional parameter for both functions is a pointer to return the &lt;i&gt;alpha mode&lt;/i&gt; of the DDS file. This can be one of the following values to return information about the alpha channel if present in the file:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DDS_ALPHA_MODE_STRAIGHT (0) - This indicates that the alpha channel if present is assumed to be using &amp;#39;straight&amp;#39; alpha. This is the default for most .DDS files if the specific metadata isn&amp;#39;t present, and it&amp;#39;s up to the application to know if it&amp;#39;s really something else. Viewers should assume the alpha channel is intended for &amp;#39;normal&amp;#39; alpha blending.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_PREMULTIPLIED (1) - This indicates the alpha channel if present is premultiplied alpha. This information is only present if the file is written using the latest version of the &amp;quot;DX10&amp;quot; extended header, or if the file is BC2/BC3 with the &amp;quot;DXT2&amp;quot;/&amp;quot;DXT4&amp;quot; FourCC which are explicitly stored as premultiplied alpha. Viewers should use the alpha channel with premultiplied alpha blending.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_4TH_CHANNEL (2) - This indicates the alpha channel if present does not contain transparency (neither straight or premultiplied alpha) and instead is encoding some other channel of information. Viewers should not use the alpha channel for blending, and should instead view it as a distinct image channel.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_OPAQUE (3) - This indicates that the alpha channel if present is fully opaque for all pixels. Viewers can assume there is no alpha blending.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromMemoryEx&lt;/b&gt;&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromFileEx&lt;/b&gt;&lt;br /&gt;These versions provide explicit control over the created resource&amp;#39;s usage, binding flags, CPU access flags, and miscellaneous flags for advanced / expert scenarios. The standard routines default to D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, and 0 respectively. For cubemaps, the miscellaneous flags default to D3D11_RESOURCE_MISC_TEXTURECUBE. There is also a &amp;#39;forceSRGB&amp;#39; option for working around gamma issues with content that is in the sRGB or similar color space but is not encoded explicitly as an SRGB format. Note that the &amp;#39;maxsize&amp;#39; parameter is not at the end of the parameter list like it is in the non-Ex version.&lt;br /&gt;
&lt;h1&gt;Example&lt;/h1&gt;
This example creates a shader resource view on the ID3D11Device d3dDevice which can be used for rendering.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
ID3D11ShaderResourceView* pSRV = &lt;span style="color:Blue;"&gt;nullptr&lt;/span&gt;;
HRESULT hr = CreateDDSTextureFromFile( d3dDevice, L&lt;span style="color:#A31515;"&gt;&amp;quot;SEAFLOOR.DDS&amp;quot;&lt;/span&gt;, &lt;span style="color:Blue;"&gt;nullptr&lt;/span&gt;, &amp;amp;pSRV );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; (FAILED(hr))
   &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Feature Level Notes&lt;/h1&gt;In order to support all feature levels, you should make sure your DDS textures are mip-mapped so that they contain a suitably sized image. Non-mipmapped textures will either need explicit feature level association, or be sized less than or equal to 2048 for 1D, 2048 x 2048 for 2D, 512 x 512 for cubemaps, and 256 x 256 x 256 for volume maps.&lt;br /&gt;&lt;br /&gt;Texture arrays require Feature Level  10.0 or later. Cubemap arrays requires Feature Level 10.1 or later.&lt;br /&gt;&lt;br /&gt;Be sure to review the various format limitations for the different feature levels. To support all feature levels, stick with textures in the following formats:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8G8B8A8_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_B8G8R8A8_UNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R16G16_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8G8_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8_UNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM_SRGB&lt;/li&gt;&lt;/ul&gt;
On Windows 8 with WDDM 1.2 drivers, all feature levels support 16bpp formats as well DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, and DXGI_FORMAT_B4G4R4A4_UNORM.&lt;br /&gt;
&lt;h1&gt;Release Notes&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;DDSTextureLoader performs no run-time conversions. If there is not a direct mapping to a DXGI supported format, the function fails. You can make use of the DirectXTex library or texconv tool to convert legacy Direct3D9 DDS files to a supported format. Legacy formats which require conversion include:
&lt;ul&gt;&lt;li&gt;D3DFMT_R8G8B8 (24bpp RGB) - Use a 32bpp format &lt;/li&gt;
&lt;li&gt;D3DFMT_X8B8G8R8 (32bpp RGBX) - Use BGRX, BGRA, or RGBA&lt;/li&gt;
&lt;li&gt;D3DFMT_A2R10G10B10 (BGRA 10:10:10:2) - Use RGBA 10:10:10:2&lt;/li&gt;
&lt;li&gt;D3DFMT_X1R5G5B5 (BGR 5:5:5) - Use BGRA 5:5:5:1 or BGR 5:6:5&lt;/li&gt;
&lt;li&gt;D3DFMT_A8R3G3B2, D3DFMT_R3G3B2 (BGR 3:3:2) - Expand to a supported format&lt;/li&gt;
&lt;li&gt;D3DFMT_P8, D3DFMT_A8P8 (8-bit palette) - Expand to a supported format&lt;/li&gt;
&lt;li&gt;D3DFMT_A4L4 (Luminance 4:4) - Expand to a supported format&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;a href="http://go.microsoft.com/fwlink/?LinkId=248926"&gt;http://go.microsoft.com/fwlink/?LinkId=248926&lt;/a&gt;. &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If built with #define DXGI_1_2_FORMATS the code supports loading BGRA 4:4:4:4 files. Otherwise, it fails.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;On a system with the DirectX 11.0 Runtime or lacking WDDM 1.2 drivers, attempts to load 16bpp format files (BGR 5:6:5, BGRA 5:5:5:1, and BGRA 4:4:4:4) will fail.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Partial cubemaps (i.e. DDS files without all six faces defined) are not supported by Direct3D 11.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Further Reading&lt;/h1&gt;&lt;a href="http://blogs.msdn.com/b/chuckw/archive/2010/02/05/the-dds-file-format-lives.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2010/02/05/the-dds-file-format-lives.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb219822.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/bb219822.aspx&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Sat, 23 Mar 2013 06:31:32 GMT</pubDate><guid isPermaLink="false">Updated Wiki: DDSTextureLoader 20130323063132A</guid></item><item><title>Updated Wiki: Texconv</title><link>http://directxtex.codeplex.com/wikipage?title=Texconv&amp;version=6</link><description>&lt;div class="wikidoc"&gt;This DirectXTex sample is an implementation of the &amp;quot;texconv&amp;quot; command-line texture utility from the DirectX SDK utilizing DirectXTex rather than D3DX.&lt;br /&gt;
&lt;h1&gt;Syntax&lt;/h1&gt;Texconv.exe uses the following command syntax:&lt;br /&gt;&lt;br /&gt;texconv [-w  number] [-h  number] [-d  number] [-m  number] [-f  format] [-if  filter] [-mf  filter] [-c  color] [-hflip] [-vflip] [-sepalpha] [-pmalpha] [-tu | -tf] [-dword] [-dx10] [-srgbi] [-srgbo] [-px  string] [-sx  string] [-o  directory] [-ft  file-type] [-nologo] file-name&lt;br /&gt;&lt;br /&gt;The file-name parameter indicates the file to convert.&lt;br /&gt;&lt;br /&gt;The optional command-line switches are described in the following table.&lt;br /&gt;
&lt;h1&gt;Optional Switches Description &lt;/h1&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;-d&lt;/b&gt;  number Depth of the output texture. This setting applies only to volume textures. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-f&lt;/b&gt;  format Output format. Can use most of the formats in D3DFORMAT without the DXGI&lt;i&gt;FORMAT&lt;/i&gt; prefix (except: D3DFMT&lt;i&gt;MULTI2&lt;/i&gt;ARGB8).&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-ft&lt;/b&gt;  file-type A file type for the output texture. Use one of the following: bmp, dds, jpg, png, or tiff. The default value is dds. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-h&lt;/b&gt;  number Height of the output texture in pixels. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-w&lt;/b&gt;  number Width of the output texture in pixels. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-if&lt;/b&gt;  filter Image filter. Use one of the following: NONE, POINT, LINEAR, CUBIC, FANT, POINT_DITHER, LINEAR_DITHER, CUBIC_DITHER, or FANT_DITHER. Filters with DITHER in their name indicate that a 4x4 ordered dither algorithm is also applied. See D3DX_FILTER for descriptions of the filters. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-m&lt;/b&gt;  number Number of mipmap levels to generate in the output texture. This setting only applies to DDS output. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-mf&lt;/b&gt;  filter Mipmap filter (see -if for filter options). &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-nologo&lt;/b&gt; Suppress copyright message. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-o&lt;/b&gt;  directory Output directory. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-px&lt;/b&gt;  string Text string to attach to the front of the resulting texture&amp;#39;s name. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-srgb&lt;/b&gt;, &lt;b&gt;-srgbi&lt;/b&gt;, or &lt;b&gt;-srgbo&lt;/b&gt; Use sRGB if both the input and output data are in the sRGB color format (ie. gamma = 2.2). Use sRGBi if only the input is in sRGB; use sRGBo if only the output is in sRGB. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-sx&lt;/b&gt;  string Text string to attach to the end of the resulting texture&amp;#39;s name. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;-hflip&lt;/b&gt; Perform horizonal flip of image&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-vflip&lt;/b&gt; Perform horizonal flip of image&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-sepalpha&lt;/b&gt; Separates alpha channel for resize/mipmap generation. This implies an alpha mode setting of DDS_ALPHA_MODE_4TH_CHANNEL as this is typically only used if the alpha channel doesn&amp;#39;t contain transparency information.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-pmalpha&lt;/b&gt; Converts the final texture data to use premultiplied alpha. This sets an alpha mode of DDS_ALPHA_MODE_PREMULTIPLIED unless the entire alpha channel is fully opaque.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-tu&lt;/b&gt; DDS files with TYPELESS formats are treated as UNORM&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-tf&lt;/b&gt; DDS files with TYPELESS formats are treated as FLOAT&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-dword&lt;/b&gt; For DDS files use a DWORD alignment instead of BYTE alignment (used for some legacy files)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-dx10&lt;/b&gt; Forces DDS file output to always use the &amp;quot;DX10&amp;quot; header extension, and allows the writing of alpha mode metadata information. The resulting file may not be compatible with the legacy D3DX10 or D3DX11 libraries.&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Sat, 23 Mar 2013 06:31:18 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Texconv 20130323063118A</guid></item><item><title>Updated Wiki: DDS I/O Functions</title><link>http://directxtex.codeplex.com/wikipage?title=DDS I/O Functions&amp;version=16</link><description>&lt;div class="wikidoc"&gt;These functions perform file I/O for .DDS files. These functions support many legacy Direct3D 9 .DDS files and all Direct3D 10.x/11.x era &amp;quot;DX10&amp;quot; extension .DDS files&lt;br /&gt;&lt;br /&gt;&lt;b&gt;GetMetadataFromDDSMemory&lt;/b&gt;&lt;br /&gt;&lt;b&gt;GetMetadataFromDDSFile&lt;/b&gt;&lt;br /&gt;Returns the &lt;i&gt;TexMetadata&lt;/i&gt; from a .DDS file.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;LoadFromDDSMemory&lt;/b&gt; &lt;br /&gt;&lt;b&gt;LoadFromDDSFile&lt;/b&gt;&lt;br /&gt;Loads a .DDS file.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SaveToDDSMemory&lt;/b&gt;&lt;br /&gt;&lt;b&gt;SaveToDDSFile&lt;/b&gt;&lt;br /&gt;Saves a single image or a set of images to a .DDS file.&lt;br /&gt;
&lt;h1&gt;Examples&lt;/h1&gt;This is a simple loading example. A DDS file can potentially include any kind of Direct3D resource in any DXGI format, so the TexMetadata info is needed to understand the full content of the file.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
TexMetadata info;
unique_ptr&amp;lt;ScratchImage&amp;gt; image ( &lt;span style="color:Blue;"&gt;new&lt;/span&gt; ScratchImage );
HRESULT hr = LoadFromDDSFile( L&lt;span style="color:#A31515;"&gt;&amp;quot;TEXTURE.DDS&amp;quot;&lt;/span&gt;, DDS_FLAGS_NONE, &amp;amp;info, *image );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; ( FAILED(hr) )
    &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;When saving a DDS file, it can contain one or more images (mipmaps, arrays, volumes, cubemaps, etc.). Therefore, the writer needs the TexMetadata info to know how to interpret the image set.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;const&lt;/span&gt; Image* img = image-&amp;gt;GetImages();
assert( img );
size_t nimg = image-&amp;gt;GetImageCount();
assert( nimg &amp;gt; 0 );
HRESULT hr = SaveToDDSFile( img, nimg, image-&amp;gt;GetMetadata(),
     DDS_FLAGS_NONE, L&lt;span style="color:#A31515;"&gt;&amp;quot;NEW_TEXTURE.DDS&amp;quot;&lt;/span&gt; );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; ( FAILED(hr) )
    &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can also save data directly from memory without using the intermediate ScratchImage at all. This example assumes a single 2D image is being written out.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
Image img;
img.width = &lt;span style="color:Green;"&gt;/*&amp;lt;width of pixel data&amp;gt;*/&lt;/span&gt;;
img.height = &lt;span style="color:Green;"&gt;/*&amp;lt;height of pixel data&amp;gt;*/&lt;/span&gt;;
img.format = &lt;span style="color:Green;"&gt;/*&amp;lt;any DXGI format&amp;gt;*/&lt;/span&gt;;
img.rowPitch = &lt;span style="color:Green;"&gt;/*&amp;lt;number of bytes in a scanline of the source data&amp;gt;*/&lt;/span&gt;;
img.slicePitch = &lt;span style="color:Green;"&gt;/*&amp;lt;number of bytes in the entire 2D image&amp;gt;*/&lt;/span&gt;;
img.pixels = &lt;span style="color:Green;"&gt;/*&amp;lt;pointer to pixel data&amp;gt;*/&lt;/span&gt;;
HRESULT hr = SaveToDDSFile( img, DDS_FLAGS_NONE, L&lt;span style="color:#A31515;"&gt;&amp;quot;NEW_TEXTURE.DDS&amp;quot;&lt;/span&gt; );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; ( FAILED(hr) )
    &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Related Flags&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;DDS_FLAGS_NONE is the default&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_LEGACY_DWORD is used for loading some legacy Direct3D 8 era 24bpp .DDS files that use the non-standard DWORD alignment instead of BYTE. There&amp;#39;s no realiable way to determine this from the file, so this requires trial-and-error.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_NO_LEGACY_EXPANSION - By default the loader will expand many legacy Direct3D 9 .DDS files to supported formats. The use of this flag prevents expansions that increase the size of the pixels, and will return a failure instead.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_NO_R10B10G10A2_FIXUP - By default, the loader uses a work-around for a long-standing issue with the D3DX DDS file format which reverses the RGB bit-masks for 10:10:10:2 formats. If this flag is used, then the loader instead assumes such data was written &amp;#39;correctly&amp;#39;.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_FORCE_RGB - By default we map many BGR formats directly to DXGI 1.1 formats. Use of this flag forces the use of DXGI 1.0 RGB formats instead for improved Direct3D 10.0/Windows Vista RTM/WDDM 1.0 driver support.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_NO_16BPP - By default, 5:6:5, 5:5:5:1, and 4:4:4:4 formats are returned as DXGI 1.2 formats. If this flag is used, the loader will expand these to R8G8B8A8 instead.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_FORCE_DX10_EXT - When saving DDS files, the writer tries to use legacy Direct3D 9 .DDS file formats if possible rather than the &amp;#39;DX10&amp;#39; header extension for better compatiblity with older tools. Using this flag, the writer will always generate &amp;#39;DX10&amp;#39; extension header files which are much faster to parse at load-time. These files are compatible with the legacy D3DX10 or D3DX11 library.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_FORCE_DX10_EXT_MISC2 - When saving DDS files, always use the &amp;#39;DX10&amp;#39; header extension and write &lt;i&gt;miscFlags2&lt;/i&gt; data as needed, if even if the resulting file is not compatible with the legacy D3DX10 or D3DX11 libraries.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Sat, 23 Mar 2013 06:27:22 GMT</pubDate><guid isPermaLink="false">Updated Wiki: DDS I/O Functions 20130323062722A</guid></item><item><title>Updated Wiki: DDS I/O Functions</title><link>http://directxtex.codeplex.com/wikipage?title=DDS I/O Functions&amp;version=15</link><description>&lt;div class="wikidoc"&gt;These functions perform file I/O for .DDS files. These functions support many legacy Direct3D 9 .DDS files and all Direct3D 10.x/11.x era &amp;quot;DX10&amp;quot; extension .DDS files&lt;br /&gt;&lt;br /&gt;&lt;b&gt;GetMetadataFromDDSMemory&lt;/b&gt;&lt;br /&gt;&lt;b&gt;GetMetadataFromDDSFile&lt;/b&gt;&lt;br /&gt;Returns the &lt;i&gt;TexMetadata&lt;/i&gt; from a .DDS file.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;LoadFromDDSMemory&lt;/b&gt; &lt;br /&gt;&lt;b&gt;LoadFromDDSFile&lt;/b&gt;&lt;br /&gt;Loads a .DDS file.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SaveToDDSMemory&lt;/b&gt;&lt;br /&gt;&lt;b&gt;SaveToDDSFile&lt;/b&gt;&lt;br /&gt;Saves a single image or a set of images to a .DDS file.&lt;br /&gt;
&lt;h1&gt;Examples&lt;/h1&gt;This is a simple loading example. A DDS file can potentially include any kind of Direct3D resource in any DXGI format, so the TexMetadata info is needed to understand the full content of the file.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
TexMetadata info;
unique_ptr&amp;lt;ScratchImage&amp;gt; image ( &lt;span style="color:Blue;"&gt;new&lt;/span&gt; ScratchImage );
HRESULT hr = LoadFromDDSFile( L&lt;span style="color:#A31515;"&gt;&amp;quot;TEXTURE.DDS&amp;quot;&lt;/span&gt;, DDS_FLAGS_NONE, &amp;amp;info, *image );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; ( FAILED(hr) )
    &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;When saving a DDS file, it can contain one or more images (mipmaps, arrays, volumes, cubemaps, etc.). Therefore, the writer needs the TexMetadata info to know how to interpret the image set.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;const&lt;/span&gt; Image* img = image-&amp;gt;GetImages();
assert( img );
size_t nimg = image-&amp;gt;GetImageCount();
assert( nimg &amp;gt; 0 );
HRESULT hr = SaveToDDSFile( img, nimg, image-&amp;gt;GetMetadata(),
     DDS_FLAGS_NONE, L&lt;span style="color:#A31515;"&gt;&amp;quot;NEW_TEXTURE.DDS&amp;quot;&lt;/span&gt; );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; ( FAILED(hr) )
    &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can also save data directly from memory without using the intermediate ScratchImage at all. This example assumes a single 2D image is being written out.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
Image img;
img.width = &lt;span style="color:Green;"&gt;/*&amp;lt;width of pixel data&amp;gt;*/&lt;/span&gt;;
img.height = &lt;span style="color:Green;"&gt;/*&amp;lt;height of pixel data&amp;gt;*/&lt;/span&gt;;
img.format = &lt;span style="color:Green;"&gt;/*&amp;lt;any DXGI format&amp;gt;*/&lt;/span&gt;;
img.rowPitch = &lt;span style="color:Green;"&gt;/*&amp;lt;number of bytes in a scanline of the source data&amp;gt;*/&lt;/span&gt;;
img.slicePitch = &lt;span style="color:Green;"&gt;/*&amp;lt;number of bytes in the entire 2D image&amp;gt;*/&lt;/span&gt;;
img.pixels = &lt;span style="color:Green;"&gt;/*&amp;lt;pointer to pixel data&amp;gt;*/&lt;/span&gt;;
HRESULT hr = SaveToDDSFile( img, DDS_FLAGS_NONE, L&lt;span style="color:#A31515;"&gt;&amp;quot;NEW_TEXTURE.DDS&amp;quot;&lt;/span&gt; );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; ( FAILED(hr) )
    &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Related Flags&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;DDS_FLAGS_NONE is the default&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_LEGACY_DWORD is used for loading some legacy Direct3D 8 era 24bpp .DDS files that use the non-standard DWORD alignment instead of BYTE. There&amp;#39;s no realiable way to determine this from the file, so this requires trial-and-error.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_NO_LEGACY_EXPANSION By default the loader will expand many legacy Direct3D 9 .DDS files to supported formats. The use of this flag prevents expansions that increase the size of the pixels, and will return a failure instead.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_NO_R10B10G10A2_FIXUP By default, the loader uses a work-around for a long-standing issue with the D3DX DDS file format which reverses the RGB bit-masks for 10:10:10:2 formats. If this flag is used, then the loader instead assumes such data was written &amp;#39;correctly&amp;#39;.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_FORCE_RGB By default we map many BGR formats directly to DXGI 1.1 formats. Use of this flag forces the use of DXGI 1.0 RGB formats instead for improved Direct3D 10.0/Windows Vista RTM/WDDM 1.0 driver support.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_NO_16BPP By default, 5:6:5, 5:5:5:1, and 4:4:4:4 formats are returned as DXGI 1.2 formats. If this flag is used, the loader will expand these to R8G8B8A8 instead.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_FORCE_DX10_EXT When saving DDS files, the writer tries to use legacy Direct3D 9 .DDS file formats if possible rather than the &amp;#39;DX10&amp;#39; header extension for better compatiblity with older tools. Using this flag, the writer will always generate &amp;#39;DX10&amp;#39; extension header files which are much faster to parse at load-time. These files are compatible with the legacy D3DX10 or D3DX11 library.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_FORCE_DX10_EXT_MISC2 When saving DDS files, always use the &amp;#39;DX10&amp;#39; header extension and write &lt;i&gt;miscFlags2&lt;/i&gt; data as needed, if even if the resulting file is not compatible with the legacy D3DX10 or D3DX11 libraries.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Sat, 23 Mar 2013 06:26:53 GMT</pubDate><guid isPermaLink="false">Updated Wiki: DDS I/O Functions 20130323062653A</guid></item><item><title>Updated Wiki: DDSTextureLoader</title><link>http://directxtex.codeplex.com/wikipage?title=DDSTextureLoader&amp;version=22</link><description>&lt;div class="wikidoc"&gt;A streamlined version of the DirectX SDK sample DDSWithoutD3DX11 texture loading code for a simple light-weight runtime .DDS file loader. This version only supports Direct3D 11 and performs no runtime pixel data conversions (see &lt;i&gt;Release Notes&lt;/i&gt; for more details). This is ideal for runtime usage, and supports the full complement of Direct3D 11 texture resources (1D, 2D, volume maps, cubemaps, mipmap levels, texture arrays, BC formats, etc.). It supports both legacy and &amp;#39;DX10&amp;#39; extension header format .dds files.&lt;br /&gt;&lt;br /&gt;Also part of DirectXTK &lt;a href="http://go.microsoft.com/fwlink/?LinkId=248929"&gt;http://go.microsoft.com/fwlink/?LinkId=248929&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;Functions&lt;/h1&gt;
&lt;b&gt;CreateDDSTextureFromMemory&lt;/b&gt;&lt;br /&gt;Loads a .DDS file assuming the image of the file is located in a memory buffer. Creates a Direct3D 11 resource and optionally a Direct3D 11 shader resource view.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromFile&lt;/b&gt;&lt;br /&gt;Loads a .DDS file from disk and creates a Direct3D 11 resource and optionally a Direct3D 11 shader resource view.&lt;br /&gt;&lt;br /&gt;For both these functions if &amp;#39;maxsize&amp;#39; parameter non-zero, then all mipmap levels larger than the maxsize are ignored before creating the Direct3D 11 resource. This allows for load-time scaling. If &amp;#39;0&amp;#39;, then if the attempt to create the Direct3D 11 resource fails and there are mipmaps present, it will retry assuming a maxsize based on the device&amp;#39;s current feature level.&lt;br /&gt;&lt;br /&gt;For both these functions if &amp;#39;maxsize&amp;#39; parameter non-zero, then all mipmap levels larger than the maxsize are ignored before creating the Direct3D 11 resource. This allows for load-time scaling. If &amp;#39;0&amp;#39;, then if the attempt to create the Direct3D 11 resource fails and there are mipmaps present, it will retry assuming a maxsize based on the device&amp;#39;s current feature level.&lt;br /&gt;&lt;br /&gt;The last optional parameter for both functions is a pointer to return the &lt;i&gt;alpha mode&lt;/i&gt; of the DDS file. This can be one of the following values to return information about the alpha channel if present in the file:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DDS_ALPHA_MODE_STRAIGHT (0) - This indicates that the alpha channel if present is assumed to be using &amp;#39;straight&amp;#39; alpha. This is the default for most .DDS files if the specific metadata isn&amp;#39;t present, and it&amp;#39;s up to the application to know if it&amp;#39;s really something else. Viewers should assume the alpha channel is intended for &amp;#39;normal&amp;#39; alpha blending.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_PREMULTIPLIED (1) - This indicates the alpha channel if present is premultiplied alpha. This information is only present if the file is written using the latest version of the &amp;quot;DX10&amp;quot; extended header, or if the file is BC2/BC3 with the &amp;quot;DXT2&amp;quot;/&amp;quot;DXT4&amp;quot; FourCC which are explicitly stored as premultiplied alpha. Viewers should use the alpha channel with premultiplied alpha blending.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_TH_CHANNEL (2) - This indicates the alpha channel if present does not contain transparency (neither straight or premultiplied alpha) and instead is encoding some other channel of information. Viewers should not use the alpha channel for blending, and should instead view it as a distinct image channel.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_OPAQUE (3) - This indicates that the alpha channel if present is fully opaque for all pixels. Viewers can assume there is no alpha blending.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromMemoryEx&lt;/b&gt;&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromFileEx&lt;/b&gt;&lt;br /&gt;These versions provide explicit control over the created resource&amp;#39;s usage, binding flags, CPU access flags, and miscellaneous flags for advanced / expert scenarios. The standard routines default to D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, and 0 respectively. For cubemaps, the miscellaneous flags default to D3D11_RESOURCE_MISC_TEXTURECUBE. There is also a &amp;#39;forceSRGB&amp;#39; option for working around gamma issues with content that is in the sRGB or similar color space but is not encoded explicitly as an SRGB format. Note that the &amp;#39;maxsize&amp;#39; parameter is not at the end of the parameter list like it is in the non-Ex version.&lt;br /&gt;
&lt;h1&gt;Example&lt;/h1&gt;
This example creates a shader resource view on the ID3D11Device d3dDevice which can be used for rendering.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
ID3D11ShaderResourceView* pSRV = &lt;span style="color:Blue;"&gt;nullptr&lt;/span&gt;;
HRESULT hr = CreateDDSTextureFromFile( d3dDevice, L&lt;span style="color:#A31515;"&gt;&amp;quot;SEAFLOOR.DDS&amp;quot;&lt;/span&gt;, &lt;span style="color:Blue;"&gt;nullptr&lt;/span&gt;, &amp;amp;pSRV );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; (FAILED(hr))
   &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Feature Level Notes&lt;/h1&gt;In order to support all feature levels, you should make sure your DDS textures are mip-mapped so that they contain a suitably sized image. Non-mipmapped textures will either need explicit feature level association, or be sized less than or equal to 2048 for 1D, 2048 x 2048 for 2D, 512 x 512 for cubemaps, and 256 x 256 x 256 for volume maps.&lt;br /&gt;&lt;br /&gt;Texture arrays require Feature Level  10.0 or later. Cubemap arrays requires Feature Level 10.1 or later.&lt;br /&gt;&lt;br /&gt;Be sure to review the various format limitations for the different feature levels. To support all feature levels, stick with textures in the following formats:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8G8B8A8_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_B8G8R8A8_UNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R16G16_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8G8_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8_UNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM_SRGB&lt;/li&gt;&lt;/ul&gt;
On Windows 8 with WDDM 1.2 drivers, all feature levels support 16bpp formats as well DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, and DXGI_FORMAT_B4G4R4A4_UNORM.&lt;br /&gt;
&lt;h1&gt;Release Notes&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;DDSTextureLoader performs no run-time conversions. If there is not a direct mapping to a DXGI supported format, the function fails. You can make use of the DirectXTex library or texconv tool to convert legacy Direct3D9 DDS files to a supported format. Legacy formats which require conversion include:
&lt;ul&gt;&lt;li&gt;D3DFMT_R8G8B8 (24bpp RGB) - Use a 32bpp format &lt;/li&gt;
&lt;li&gt;D3DFMT_X8B8G8R8 (32bpp RGBX) - Use BGRX, BGRA, or RGBA&lt;/li&gt;
&lt;li&gt;D3DFMT_A2R10G10B10 (BGRA 10:10:10:2) - Use RGBA 10:10:10:2&lt;/li&gt;
&lt;li&gt;D3DFMT_X1R5G5B5 (BGR 5:5:5) - Use BGRA 5:5:5:1 or BGR 5:6:5&lt;/li&gt;
&lt;li&gt;D3DFMT_A8R3G3B2, D3DFMT_R3G3B2 (BGR 3:3:2) - Expand to a supported format&lt;/li&gt;
&lt;li&gt;D3DFMT_P8, D3DFMT_A8P8 (8-bit palette) - Expand to a supported format&lt;/li&gt;
&lt;li&gt;D3DFMT_A4L4 (Luminance 4:4) - Expand to a supported format&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;a href="http://go.microsoft.com/fwlink/?LinkId=248926"&gt;http://go.microsoft.com/fwlink/?LinkId=248926&lt;/a&gt;. &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If built with #define DXGI_1_2_FORMATS the code supports loading BGRA 4:4:4:4 files. Otherwise, it fails.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;On a system with the DirectX 11.0 Runtime or lacking WDDM 1.2 drivers, attempts to load 16bpp format files (BGR 5:6:5, BGRA 5:5:5:1, and BGRA 4:4:4:4) will fail.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Partial cubemaps (i.e. DDS files without all six faces defined) are not supported by Direct3D 11.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Further Reading&lt;/h1&gt;&lt;a href="http://blogs.msdn.com/b/chuckw/archive/2010/02/05/the-dds-file-format-lives.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2010/02/05/the-dds-file-format-lives.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb219822.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/bb219822.aspx&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Sat, 23 Mar 2013 06:26:10 GMT</pubDate><guid isPermaLink="false">Updated Wiki: DDSTextureLoader 20130323062610A</guid></item><item><title>Updated Wiki: DDSTextureLoader</title><link>http://directxtex.codeplex.com/wikipage?title=DDSTextureLoader&amp;version=21</link><description>&lt;div class="wikidoc"&gt;A streamlined version of the DirectX SDK sample DDSWithoutD3DX11 texture loading code for a simple light-weight runtime .DDS file loader. This version only supports Direct3D 11 and performs no runtime pixel data conversions (see &lt;i&gt;Release Notes&lt;/i&gt; for more details). This is ideal for runtime usage, and supports the full complement of Direct3D 11 texture resources (1D, 2D, volume maps, cubemaps, mipmap levels, texture arrays, BC formats, etc.). It supports both legacy and &amp;#39;DX10&amp;#39; extension header format .dds files.&lt;br /&gt;&lt;br /&gt;Also part of DirectXTK &lt;a href="http://go.microsoft.com/fwlink/?LinkId=248929"&gt;http://go.microsoft.com/fwlink/?LinkId=248929&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;Functions&lt;/h1&gt;
&lt;b&gt;CreateDDSTextureFromMemory&lt;/b&gt;&lt;br /&gt;Loads a .DDS file assuming the image of the file is located in a memory buffer. Creates a Direct3D 11 resource and optionally a Direct3D 11 shader resource view.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromFile&lt;/b&gt;&lt;br /&gt;Loads a .DDS file from disk and creates a Direct3D 11 resource and optionally a Direct3D 11 shader resource view.&lt;br /&gt;&lt;br /&gt;For both these functions if &amp;#39;maxsize&amp;#39; parameter non-zero, then all mipmap levels larger than the maxsize are ignored before creating the Direct3D 11 resource. This allows for load-time scaling. If &amp;#39;0&amp;#39;, then if the attempt to create the Direct3D 11 resource fails and there are mipmaps present, it will retry assuming a maxsize based on the device&amp;#39;s current feature level.&lt;br /&gt;&lt;br /&gt;For both these functions if &amp;#39;maxsize&amp;#39; parameter non-zero, then all mipmap levels larger than the maxsize are ignored before creating the Direct3D 11 resource. This allows for load-time scaling. If &amp;#39;0&amp;#39;, then if the attempt to create the Direct3D 11 resource fails and there are mipmaps present, it will retry assuming a maxsize based on the device&amp;#39;s current feature level.&lt;br /&gt;&lt;br /&gt;The last optional parameter for both functions is a pointer to return the &lt;i&gt;alpha mode&lt;/i&gt; of the DDS file. This can be one of the following values to return information about the alpha channel if present in the file:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DDS_ALPHA_MODE_STRAIGHT (0) - This indicates that the alpha channel if present is assumed to be using &amp;#39;straight&amp;#39; alpha. This is the default for most .DDS files if the specific metadata isn&amp;#39;t present, and it&amp;#39;s up to the application to know if it&amp;#39;s really something else. Viewers should assume the alpha channel is intended for &amp;#39;normal&amp;#39; alpha blending.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_PREMULTIPLIED (1) - This indicates the alpha channel if present is premultiplied alpha. This information is only present if the file is written using the latest version of the &amp;quot;DX10&amp;quot; extended header, or if the file is BC2/BC3 with the &amp;quot;DXT2&amp;quot;/&amp;quot;DXT4&amp;quot; FourCC which are explicitly stored as premultiplied alpha. Viewers should use the alpha channel with premultiplied alpha blending.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_TH_CHANNEL (2) - This indicates the alpha channel if present does not contain transparency (neither straight or premultiplied alpha) and instead is encoding some other channel of information. Viewer should not use the alpha channel for blending, and should instead view it as a distinct image channel.&lt;/li&gt;
&lt;li&gt;DDS_ALPHA_MODE_OPAQUE (3) - This indicates that the alpha channel if present is fully opaque for all pixels. Viewers can assume there is no alpha blending.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromMemoryEx&lt;/b&gt;&lt;br /&gt;&lt;b&gt;CreateDDSTextureFromFileEx&lt;/b&gt;&lt;br /&gt;These versions provide explicit control over the created resource&amp;#39;s usage, binding flags, CPU access flags, and miscellaneous flags for advanced / expert scenarios. The standard routines default to D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, and 0 respectively. For cubemaps, the miscellaneous flags default to D3D11_RESOURCE_MISC_TEXTURECUBE. There is also a &amp;#39;forceSRGB&amp;#39; option for working around gamma issues with content that is in the sRGB or similar color space but is not encoded explicitly as an SRGB format. Note that the &amp;#39;maxsize&amp;#39; parameter is not at the end of the parameter list like it is in the non-Ex version.&lt;br /&gt;
&lt;h1&gt;Example&lt;/h1&gt;
This example creates a shader resource view on the ID3D11Device d3dDevice which can be used for rendering.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
ID3D11ShaderResourceView* pSRV = &lt;span style="color:Blue;"&gt;nullptr&lt;/span&gt;;
HRESULT hr = CreateDDSTextureFromFile( d3dDevice, L&lt;span style="color:#A31515;"&gt;&amp;quot;SEAFLOOR.DDS&amp;quot;&lt;/span&gt;, &lt;span style="color:Blue;"&gt;nullptr&lt;/span&gt;, &amp;amp;pSRV );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; (FAILED(hr))
   &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Feature Level Notes&lt;/h1&gt;In order to support all feature levels, you should make sure your DDS textures are mip-mapped so that they contain a suitably sized image. Non-mipmapped textures will either need explicit feature level association, or be sized less than or equal to 2048 for 1D, 2048 x 2048 for 2D, 512 x 512 for cubemaps, and 256 x 256 x 256 for volume maps.&lt;br /&gt;&lt;br /&gt;Texture arrays require Feature Level  10.0 or later. Cubemap arrays requires Feature Level 10.1 or later.&lt;br /&gt;&lt;br /&gt;Be sure to review the various format limitations for the different feature levels. To support all feature levels, stick with textures in the following formats:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8G8B8A8_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_B8G8R8A8_UNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R16G16_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8G8_SNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_R8_UNORM&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM_SRGB&lt;/li&gt;
&lt;li&gt;DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM_SRGB&lt;/li&gt;&lt;/ul&gt;
On Windows 8 with WDDM 1.2 drivers, all feature levels support 16bpp formats as well DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, and DXGI_FORMAT_B4G4R4A4_UNORM.&lt;br /&gt;
&lt;h1&gt;Release Notes&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;DDSTextureLoader performs no run-time conversions. If there is not a direct mapping to a DXGI supported format, the function fails. You can make use of the DirectXTex library or texconv tool to convert legacy Direct3D9 DDS files to a supported format. Legacy formats which require conversion include:
&lt;ul&gt;&lt;li&gt;D3DFMT_R8G8B8 (24bpp RGB) - Use a 32bpp format &lt;/li&gt;
&lt;li&gt;D3DFMT_X8B8G8R8 (32bpp RGBX) - Use BGRX, BGRA, or RGBA&lt;/li&gt;
&lt;li&gt;D3DFMT_A2R10G10B10 (BGRA 10:10:10:2) - Use RGBA 10:10:10:2&lt;/li&gt;
&lt;li&gt;D3DFMT_X1R5G5B5 (BGR 5:5:5) - Use BGRA 5:5:5:1 or BGR 5:6:5&lt;/li&gt;
&lt;li&gt;D3DFMT_A8R3G3B2, D3DFMT_R3G3B2 (BGR 3:3:2) - Expand to a supported format&lt;/li&gt;
&lt;li&gt;D3DFMT_P8, D3DFMT_A8P8 (8-bit palette) - Expand to a supported format&lt;/li&gt;
&lt;li&gt;D3DFMT_A4L4 (Luminance 4:4) - Expand to a supported format&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;a href="http://go.microsoft.com/fwlink/?LinkId=248926"&gt;http://go.microsoft.com/fwlink/?LinkId=248926&lt;/a&gt;. &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If built with #define DXGI_1_2_FORMATS the code supports loading BGRA 4:4:4:4 files. Otherwise, it fails.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;On a system with the DirectX 11.0 Runtime or lacking WDDM 1.2 drivers, attempts to load 16bpp format files (BGR 5:6:5, BGRA 5:5:5:1, and BGRA 4:4:4:4) will fail.&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Partial cubemaps (i.e. DDS files without all six faces defined) are not supported by Direct3D 11.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Further Reading&lt;/h1&gt;&lt;a href="http://blogs.msdn.com/b/chuckw/archive/2010/02/05/the-dds-file-format-lives.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2010/02/05/the-dds-file-format-lives.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx"&gt;http://blogs.msdn.com/b/chuckw/archive/2012/06/20/direct3d-feature-levels.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb219822.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/bb219822.aspx&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Sat, 23 Mar 2013 06:25:46 GMT</pubDate><guid isPermaLink="false">Updated Wiki: DDSTextureLoader 20130323062546A</guid></item><item><title>Updated Wiki: Utility Functions</title><link>http://directxtex.codeplex.com/wikipage?title=Utility Functions&amp;version=8</link><description>&lt;div class="wikidoc"&gt;These functions provide utility functionality when working with DXGI_FORMATs throughout the library.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;GetWICCodec&lt;/b&gt;&lt;br /&gt;Returns a WIC GUID for a given file container given a simple enumeration value.
&lt;ul&gt;&lt;li&gt;WIC_CODEC_BMP Windows Bitmap (.bmp)&lt;/li&gt;
&lt;li&gt;WIC_CODEC_JPEG Joint Photographic Experts Group (.jpg, .jpeg)&lt;/li&gt;
&lt;li&gt;WIC_CODEC_PNG Portable Network Graphics (.png)&lt;/li&gt;
&lt;li&gt;WIC_CODEC_TIFF Tagged Image File Format  (.tif, .tiff)&lt;/li&gt;
&lt;li&gt;WIC_CODEC_GIF Graphics Interchange Format  (.gif)&lt;/li&gt;
&lt;li&gt;WIC_CODEC_WMP Windows Media Photo / HD Photo / JPEG XR (.hdp, .jxr, .wdp)&lt;/li&gt;
&lt;li&gt;WIC_CODEC_ICO Windows Icon (.ico)&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;IsValid&lt;/b&gt;&lt;br /&gt;Returns false if the DXGI format is unknown.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;IsCompressed&lt;/b&gt;&lt;br /&gt;Returns true if the DXGI format is a block compressed format.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;IsPacked&lt;/b&gt;&lt;br /&gt;Returns true if the DXGI format is a &amp;#39;packed&amp;#39; format.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;IsVideo&lt;/b&gt;&lt;br /&gt;Returns true if the DXGI format is a DXGI 1.2 &amp;#39;video&amp;#39; format that is not supported for general use with Direct3D 11.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;IsSRGB&lt;/b&gt;&lt;br /&gt;Returns true if the DXGI format is an sRGB format.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;IsTypeless&lt;/b&gt;&lt;br /&gt;Returns true if the DXGI format is a &amp;#39;typeless&amp;#39; format&lt;br /&gt;&lt;br /&gt;&lt;b&gt;HasAlpha&lt;/b&gt;&lt;br /&gt;Returns true of the DXGI format includes an alpha channel. Note that BC1 formats return true because they have a &amp;#39;transparency bit&amp;#39; trick in the encoding to handle 1-bit alpha.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;BitsPerPixel&lt;/b&gt;&lt;br /&gt;Returns the bits-per-pixel for a given DXGI format.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ComputePitch&lt;/b&gt;&lt;br /&gt;Returns both the row and slice pitch for a given width, height, and DXGI format. It supports a number of flags for overriding the default byte-alignment usually used by DDS files and Direct3D 11 resources.
&lt;ul&gt;&lt;li&gt;CP_FLAGS_NONE is the default&lt;/li&gt;
&lt;li&gt;CP_FLAGS_LEGACY_DWORD is used for some legacy Direct3D 8 era DDS files, particularly 24bpp files, that used a DWORD alignment instead of BYTE&lt;/li&gt;
&lt;li&gt;CP_FLAGS_24BPP used for computing pitch of Direct3D 9 era 24bpp DDS files (which cannot be indicated by a DXGI_FORMAT)&lt;/li&gt;
&lt;li&gt;CP_FLAGS_16BPP used for computing pitch of 16bpp DDS files (which requires DXGI 1.2 headers to define all possible combinations, so we use the flag here instead)&lt;/li&gt;
&lt;li&gt;CP_FLAGS_8BPP used for computing pitch of 8bpp DDS files&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;ComputeScanlines&lt;/b&gt;&lt;br /&gt;Returns the number of horizontal scanlines in an image given the DXGI format and pixel height.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;MakeSRGB&lt;/b&gt;&lt;br /&gt;Converts a DXGI format to the sRGB equivalent if any.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;MakeTypeless&lt;/b&gt;&lt;br /&gt;Converts a DXGI format to a TYPELESS equiavlent if any. This does not modify depth/stencil formats which have multiple &amp;#39;typeless&amp;#39; mappings.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;MakeTypelessUNORM&lt;/b&gt;&lt;br /&gt;Converts a TYPELESS DXGI format to a UNORM equivalent if any.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;MakeTypelessFLOAT&lt;/b&gt;&lt;br /&gt;Converts a TYPELESS DXGI format to a FLOAT equivalent if any.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Sat, 23 Mar 2013 01:10:44 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Utility Functions 20130323011044A</guid></item><item><title>Updated Wiki: DDS I/O Functions</title><link>http://directxtex.codeplex.com/wikipage?title=DDS I/O Functions&amp;version=14</link><description>&lt;div class="wikidoc"&gt;These functions perform file I/O for .DDS files. These functions support many legacy Direct3D 9 .DDS files and all Direct3D 10.x/11.x era &amp;quot;DX10&amp;quot; extension .DDS files&lt;br /&gt;&lt;br /&gt;&lt;b&gt;GetMetadataFromDDSMemory&lt;/b&gt;&lt;br /&gt;&lt;b&gt;GetMetadataFromDDSFile&lt;/b&gt;&lt;br /&gt;Returns the &lt;i&gt;TexMetadata&lt;/i&gt; from a .DDS file.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;LoadFromDDSMemory&lt;/b&gt; &lt;br /&gt;&lt;b&gt;LoadFromDDSFile&lt;/b&gt;&lt;br /&gt;Loads a .DDS file.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SaveToDDSMemory&lt;/b&gt;&lt;br /&gt;&lt;b&gt;SaveToDDSFile&lt;/b&gt;&lt;br /&gt;Saves a single image or a set of images to a .DDS file.&lt;br /&gt;
&lt;h1&gt;Examples&lt;/h1&gt;This is a simple loading example. A DDS file can potentially include any kind of Direct3D resource in any DXGI format, so the TexMetadata info is needed to understand the full content of the file.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
TexMetadata info;
unique_ptr&amp;lt;ScratchImage&amp;gt; image ( &lt;span style="color:Blue;"&gt;new&lt;/span&gt; ScratchImage );
HRESULT hr = LoadFromDDSFile( L&lt;span style="color:#A31515;"&gt;&amp;quot;TEXTURE.DDS&amp;quot;&lt;/span&gt;, DDS_FLAGS_NONE, &amp;amp;info, *image );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; ( FAILED(hr) )
    &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;When saving a DDS file, it can contain one or more images (mipmaps, arrays, volumes, cubemaps, etc.). Therefore, the writer needs the TexMetadata info to know how to interpret the image set.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;const&lt;/span&gt; Image* img = image-&amp;gt;GetImages();
assert( img );
size_t nimg = image-&amp;gt;GetImageCount();
assert( nimg &amp;gt; 0 );
HRESULT hr = SaveToDDSFile( img, nimg, image-&amp;gt;GetMetadata(),
     DDS_FLAGS_NONE, L&lt;span style="color:#A31515;"&gt;&amp;quot;NEW_TEXTURE.DDS&amp;quot;&lt;/span&gt; );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; ( FAILED(hr) )
    &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can also save data directly from memory without using the intermediate ScratchImage at all. This example assumes a single 2D image is being written out.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
Image img;
img.width = &lt;span style="color:Green;"&gt;/*&amp;lt;width of pixel data&amp;gt;*/&lt;/span&gt;;
img.height = &lt;span style="color:Green;"&gt;/*&amp;lt;height of pixel data&amp;gt;*/&lt;/span&gt;;
img.format = &lt;span style="color:Green;"&gt;/*&amp;lt;any DXGI format&amp;gt;*/&lt;/span&gt;;
img.rowPitch = &lt;span style="color:Green;"&gt;/*&amp;lt;number of bytes in a scanline of the source data&amp;gt;*/&lt;/span&gt;;
img.slicePitch = &lt;span style="color:Green;"&gt;/*&amp;lt;number of bytes in the entire 2D image&amp;gt;*/&lt;/span&gt;;
img.pixels = &lt;span style="color:Green;"&gt;/*&amp;lt;pointer to pixel data&amp;gt;*/&lt;/span&gt;;
HRESULT hr = SaveToDDSFile( img, DDS_FLAGS_NONE, L&lt;span style="color:#A31515;"&gt;&amp;quot;NEW_TEXTURE.DDS&amp;quot;&lt;/span&gt; );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; ( FAILED(hr) )
    &lt;span style="color:Green;"&gt;// error&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Related Flags&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;DDS_FLAGS_NONE is the default&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_LEGACY_DWORD is used for loading some legacy Direct3D 8 era 24bpp .DDS files that use the non-standard DWORD alignment instead of BYTE. There&amp;#39;s no realiable way to determine this from the file, so this requires trial-and-error.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_NO_LEGACY_EXPANSION By default the loader will expand many legacy Direct3D 9 .DDS files to supported formats. The use of this flag prevents expansions that increase the size of the pixels, and will return a failure instead.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_NO_R10B10G10A2_FIXUP By default, the loader uses a work-around for a long-standing issue with the D3DX DDS file format which reverses the RGB bit-masks for 10:10:10:2 formats. If this flag is used, then the loader instead assumes such data was written &amp;#39;correctly&amp;#39;.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_FORCE_RGB By default we map many BGR formats directly to DXGI 1.1 formats. Use of this flag forces the use of DXGI 1.0 RGB formats instead for improved Direct3D 10.0/Windows Vista RTM/WDDM 1.0 driver support.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_NO_16BPP By default, 5:6:5, 5:5:5:1, and 4:4:4:4 formats are returned as DXGI 1.2 formats. If this flag is used, the loader will expand these to R8G8B8A8 instead.&lt;/li&gt;
&lt;li&gt;DDS_FLAGS_FORCE_DX10_EXT When saving DDS files, the writer tries to use legacy Direct3D 9 .DDS file formats if possible rather than the &amp;#39;DX10&amp;#39; header extension for better compatiblity with older tools. Using this flag, the writer will always generate &amp;#39;DX10&amp;#39; extension header files which are much faster to parse at load-time. These files are compatible with the legacy D3DX10 or D3DX11 library.&lt;/li&gt;
&lt;li&gt;{&amp;quot;DDS&lt;i&gt;FLAGS&lt;/i&gt;FORCE&lt;i&gt;DX10&lt;/i&gt;EXT&lt;i&gt;MISC2}&amp;quot; When saving DDS files, always use the &amp;#39;DX10&amp;#39; header extension and write &lt;/i&gt;miscFlags2_ data as needed, if even if the resulting file is not compatible with the legacy D3DX10 or D3DX11 libraries.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Sat, 23 Mar 2013 01:09:43 GMT</pubDate><guid isPermaLink="false">Updated Wiki: DDS I/O Functions 20130323010943A</guid></item><item><title>Updated Wiki: Version History</title><link>http://directxtex.codeplex.com/wikipage?title=Version History&amp;version=11</link><description>&lt;div class="wikidoc"&gt;&lt;b&gt;March 22, 2013&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Supports reading and writing alpha-mode (straight, premultiplied, etc.) metadata in .DDS files&lt;/li&gt;
&lt;li&gt;Added build option to use WICCreateImagingFactory_Proxy instead of CoCreateInstance to obtain WIC factory&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;January 29, 2013&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Added PremultiplyAlpha to DirectXTex; -pmalpha switch for texconv command-line tool&lt;/li&gt;
&lt;li&gt;Fixed problem with forceSRGB implementation for Ex versions of CreateTexture, CreateShaderResourceView, DDSTextureLoader and WICTextureLoader&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;December 11, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Ex versions of CreateTexture, CreateShaderResourceView, DDSTextureLoader and WICTextureLoader&lt;/li&gt;
&lt;li&gt;Fixed BC2 and BC3 decompression issue for unusual color encoding case&lt;/li&gt;
&lt;li&gt;Converted annotation to SAL2 for improved VS 2012 /analyze experience&lt;/li&gt;
&lt;li&gt;Updated DirectXTex, DDSView, and Texconv with VS 2010 + Windows 8.0 SDK project using official &amp;#39;property sheets&amp;#39;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;November 15, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Added support for WIC2 when available on Windows 8 and Windows 7 with KB 2670838&lt;/li&gt;
&lt;li&gt;Added optional targetGUID parameter to SaveWIC* APIs to influence final container pixel format choice&lt;/li&gt;
&lt;li&gt;Fixed bug in SaveDDS* which was generating invalid DDS files for 1D dimension textures&lt;/li&gt;
&lt;li&gt;Improved robustness of CaptureTexture when resolving MSAA source textures&lt;/li&gt;
&lt;li&gt;Sync&amp;#39;d DDSTextureLoader, ScreenGrab, and WICTextureLoader standalone versions with latest DirectXTK release&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;September 28, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Added ScreenGrab module for creating runtime screenshots&lt;/li&gt;
&lt;li&gt;Renamed project files for better naming consistency&lt;/li&gt;
&lt;li&gt;New Typeless utilities for DirectXTex&lt;/li&gt;
&lt;li&gt;Some minor code cleanup for DirectXTex&amp;#39;s WIC writer function&lt;/li&gt;
&lt;li&gt;Bug fixes and new -tu/-tf options for texconv&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;June 22, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Moved to using XNA Math 2.05 instead of XNA Math 2.04 for USE_XNAMATH builds&lt;/li&gt;
&lt;li&gt;Fixed BGR vs. RGB color channel swizzle problem with 24bpp legacy .DDS files in DirectXTex&lt;/li&gt;
&lt;li&gt;Update to DirectXTex WIC and WICTextureLoader for additional 96bpp float format handling on Windows 8&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;May 31, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Minor fix for DDSTextureLoader&amp;#39;s retry fallback that can happen with 10level9 feature levels&lt;/li&gt;
&lt;li&gt;Switched to use &amp;quot;_DEBUG&amp;quot; instead of &amp;quot;DEBUG&amp;quot; and cleaned up debug warnings&lt;/li&gt;
&lt;li&gt;added Metro style application project files for DirectXTex&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;April 20, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;DirectTex&amp;#39;s WIC-based writer opts-in for the Windows 8 BMP encoder option for writing 32 bpp RGBA files with the BITMAPV5HEADER&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;March 30, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;WICTextureLoader updated with Windows 8 WIC pixel formats                DirectXTex updated with limited non-power-of-2 texture support and TEX&lt;i&gt;FILTER&lt;/i&gt;SEPARATE_ALPHA option&lt;/li&gt;
&lt;li&gt;Texconv updated with &amp;#39;-sepalpha&amp;#39; command-line option&lt;/li&gt;
&lt;li&gt;Added USE_XNAMATH control define to build DirectXTex using either XNAMath or DirectXMath&lt;/li&gt;
&lt;li&gt;Added VS 2012 project files (which use DirectXMath instead of XNAMath and define DXGI&lt;i&gt;1&lt;/i&gt;2_FORMATS)&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;March 15, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Fix for resource leak in CreateShaderResourceView() Direct3D 11 helper function in DirectXTex&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;March 5, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Fix for too much temp memory allocated by WICTextureLoader; cleaned up legacy &amp;#39;min/max&amp;#39; macro usage in DirectXTex&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;February 21, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;WICTextureLoader updated to handle systems and device drivers without BGRA or 16bpp format support&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;February 20, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Some code cleanup for DirectXTex and DDSTextureLoader&lt;/li&gt;
&lt;li&gt;Fixed bug in 10:10:10:2 format fixup in the LoadDDSFromMemory function&lt;/li&gt;
&lt;li&gt;Fixed bugs in &amp;quot;non-zero alpha&amp;quot; special-case handling in LoadTGAFromFile&lt;/li&gt;
&lt;li&gt;Fixed bug in _SwizzleScanline when copying alpha channel for BGRA&amp;lt;-&amp;gt;RGBA swizzling&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;February 11, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Update of DDSTextureLoader to also build in Metro style apps; added WICTextureLoader&lt;/li&gt;
&lt;li&gt;Added CMYK WIC pixel formats to the DirectXTex conversion table&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;January 30, 2012&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Minor code-cleanup for DirectXTex to enable use of PCH through &amp;#39;directxtexp.h&amp;#39; header&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;January 24, 2011&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Some code-cleanup for DirectXTex&lt;/li&gt;
&lt;li&gt;Added DXGI 1.2 implementation for DDSTextureLoader and DirectXTex guarded with DXGI&lt;i&gt;1&lt;/i&gt;2_FORMATS compiliation define &lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;December 16, 2011&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Fixed x64 compilation warnings in DDSTextureLoader&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;November 30, 2011&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Fixed some of the constants used in IsSupportedTexture(),&lt;/li&gt;
&lt;li&gt;added ability to strip off top levels of mips in DDSTextureLoader,&lt;/li&gt;
&lt;li&gt;changed DirectXTex to use CoCreateInstance rather than LoadLibrary to obtain the WIC factory,&lt;/li&gt;
&lt;li&gt;a few minor /analyze related annotations for DirectXTex&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;October 27, 2011&lt;/b&gt;
&lt;ul&gt;&lt;li&gt;Original release&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Sat, 23 Mar 2013 00:58:47 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Version History 20130323125847A</guid></item><item><title>Updated Wiki: Compress</title><link>http://directxtex.codeplex.com/wikipage?title=Compress&amp;version=5</link><description>&lt;div class="wikidoc"&gt;Compresses an image or set of images to a block-compressed (BC) format. &lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
HRESULT Compress( _In_ &lt;span style="color:Blue;"&gt;const&lt;/span&gt; Image&amp;amp; srcImage, _In_ DXGI_FORMAT format,
    _In_ DWORD compress, _In_ &lt;span style="color:Blue;"&gt;float&lt;/span&gt; alphaRef,
    _Out_ ScratchImage&amp;amp; cImage );

HRESULT Compress( _In_reads_(nimages) &lt;span style="color:Blue;"&gt;const&lt;/span&gt; Image* srcImages, _In_ size_t nimages,
    _In_ &lt;span style="color:Blue;"&gt;const&lt;/span&gt; TexMetadata&amp;amp; metadata,
    _In_ DXGI_FORMAT format, _In_ DWORD compress, _In_ &lt;span style="color:Blue;"&gt;float&lt;/span&gt; alphaRef,
    _Out_ ScratchImage&amp;amp; cImages );
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Parameters&lt;/h1&gt;
&lt;i&gt;format&lt;/i&gt;: Format to compress to. Must be a BC compressed format (i.e. DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM_SRGB - DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM_SRGB)&lt;br /&gt;&lt;br /&gt;&lt;i&gt;compress&lt;/i&gt;: Compress control flags
&lt;ul&gt;&lt;li&gt;TEX_COMPRESS_DEFAULT Default flags.&lt;/li&gt;
&lt;li&gt;TEX_COMPRESS_RGB_DITHER  Enables dithering RGB colors for BC1-3 compression&lt;/li&gt;
&lt;li&gt;TEX_COMPRESS_A_DITHER Enables dithering alpha channel for BC1-3 compression&lt;/li&gt;
&lt;li&gt;TEX_COMPRESS_DITHER Same as TEX_COMPRESS_RGB_DITHER and TEX_COMPRESS_A_DITHER &lt;/li&gt;
&lt;li&gt;TEX_COMPRESS_UNIFORM By default, BC1-3 uses a perceptual weighting. By using this flag, the perceptual weighting is disabled which can be useful when using the RGB channels for other data.&lt;/li&gt;
&lt;li&gt;TEX_COMPRESS_PARALLEL This opts-in to multi-threaded compression if enabled.&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;i&gt;alphaRef&lt;/i&gt;: Threshold reference value when compressing an alpha channel for BC1 formats which support 1-bit transparency.&lt;br /&gt;
&lt;h1&gt;Example&lt;/h1&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
ScratchImage srcImage;

...

ScratchImage bcImage;
hr = Compress( srcImage.GetImages(), srcImage.GetImageCount(), srcImage.GetMetadata(), DXGI_FORMAT_BC3_UNORM, TEX_COMPRESS_DEFAULT, 0.5f, bcImage );
&lt;span style="color:Blue;"&gt;if&lt;/span&gt; ( FAILED(hr) )
    ...
&lt;/pre&gt;&lt;/div&gt;
&lt;h1&gt;Remarks&lt;/h1&gt;
By default, the BC1 - BC3 color encoding algorithms will use a perceptual weighting of the Red and Blue channels which usually gives better visual results for standard color textures. For textures that do not contain color data, you will likely want to use TEX_COMPRESS_UNIFORM to disable the perceptual weighting.&lt;br /&gt;
&lt;h1&gt;Related Links&lt;/h1&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/bb204843.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb204843.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb694531.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb694531.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/hh308955.aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/hh308955.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/S3_Texture_Compression"&gt;http://en.wikipedia.org/wiki/S3_Texture_Compression&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/3Dc"&gt;http://en.wikipedia.org/wiki/3Dc&lt;/a&gt;&lt;br /&gt;&lt;a href="http://developer.download.nvidia.com/opengl/specs/GL_ARB_texture_compression_bptc.txt"&gt;http://developer.download.nvidia.com/opengl/specs/GL_ARB_texture_compression_bptc.txt&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>walbourn</author><pubDate>Mon, 04 Mar 2013 20:02:45 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Compress 20130304080245P</guid></item></channel></rss>