D3DX11_IMAGE_LOAD_INFO structure
Note
The D3DX (D3DX 9, D3DX 10, and D3DX 11) utility library is deprecated for Windows 8 and is not supported for Windows Store apps.
Optionally provide information to texture loader APIs to control how textures get loaded. A value of D3DX11_DEFAULT for any of these parameters will cause D3DX to automatically use the value from the source file.
Syntax
typedef struct D3DX11_IMAGE_LOAD_INFO {
UINT Width;
UINT Height;
UINT Depth;
UINT FirstMipLevel;
UINT MipLevels;
D3D11_USAGE Usage;
UINT BindFlags;
UINT CpuAccessFlags;
UINT MiscFlags;
DXGI_FORMAT Format;
UINT Filter;
UINT MipFilter;
D3DX11_IMAGE_INFO *pSrcInfo;
} D3DX11_IMAGE_LOAD_INFO, *LPD3DX11_IMAGE_LOAD_INFO;
Members
-
Width
-
Type: UINT
-
The target width of the texture. If the actual width of the texture is larger or smaller than this value then the texture will be scaled up or down to fit this target width.
-
Height
-
Type: UINT
-
The target height of the texture. If the actual height of the texture is larger or smaller than this value then the texture will be scaled up or down to fit this target height.
-
Depth
-
Type: UINT
-
The depth of the texture. This only applies to volume textures.
-
FirstMipLevel
-
Type: UINT
-
The highest resolution mipmap level of the texture. If this is greater than 0, then after the texture is loaded FirstMipLevel will be mapped to mipmap level 0.
-
MipLevels
-
Type: UINT
-
The maximum number of mipmap levels in the texture. See the remarks in D3D11_TEX1D_SRV. Using 0 or D3DX11_DEFAULT will cause a full mipmap chain to be created.
-
Usage
-
Type: D3D11_USAGE
-
The way the texture resource is intended to be used. See D3D11_USAGE.
-
BindFlags
-
Type: UINT
-
The pipeline stages that the texture will be allowed to bind to. See D3D11_BIND_FLAG.
-
CpuAccessFlags
-
Type: UINT
-
The access permissions the cpu will have for the texture resource. See D3D11_CPU_ACCESS_FLAG.
-
MiscFlags
-
Type: UINT
-
Miscellaneous resource properties (see D3D11_RESOURCE_MISC_FLAG).
-
Format
-
Type: DXGI_FORMAT
-
A DXGI_FORMAT enumeration indicating the format the texture will be in after it is loaded.
-
Filter
-
Type: UINT
-
Filter the texture using the specified filter (only when resampling). See D3DX11_FILTER_FLAG.
-
MipFilter
-
Type: UINT
-
Filter the texture mip levels using the specified filter (only if generating mipmaps). Valid values are D3DX11_FILTER_NONE, D3DX11_FILTER_POINT, D3DX11_FILTER_LINEAR, or D3DX11_FILTER_TRIANGLE. See D3DX11_FILTER_FLAG.
-
pSrcInfo
-
Type: D3DX11_IMAGE_INFO*
-
Information about the original image. See D3DX11_IMAGE_INFO. Can be obtained with D3DX11GetImageInfoFromFile, D3DX11GetImageInfoFromMemory, or D3DX11GetImageInfoFromResource.
Remarks
When initializing the structure, you may set any member to D3DX11_DEFAULT and D3DX will initialize it with a default value from the source texture when the texture is loaded.
This structure can be used by APIs that:
- Create resources, such as D3DX11CreateTextureFromFile and D3DX11CreateShaderResourceViewFromFile.
- Create data processors, such as D3DX11CreateAsyncTextureInfoProcessor or D3DX11CreateAsyncShaderResourceViewProcessor.
The default values are:
Width = D3DX11_DEFAULT;
Height = D3DX11_DEFAULT;
Depth = D3DX11_DEFAULT;
FirstMipLevel = D3DX11_DEFAULT;
MipLevels = D3DX11_DEFAULT;
Usage = (D3D11_USAGE) D3DX11_DEFAULT;
BindFlags = D3DX11_DEFAULT;
CpuAccessFlags = D3DX11_DEFAULT;
MiscFlags = D3DX11_DEFAULT;
Format = DXGI_FORMAT_FROM_FILE;
Filter = D3DX11_DEFAULT;
MipFilter = D3DX11_DEFAULT;
pSrcInfo = NULL;
Here is a brief example that uses this structure to supply the pixel format when loading a texture. For the complete code, see HDRFormats10.cpp in HDRToneMappingCS11 Sample.
ID3D11ShaderResourceView* pCubeRV = NULL;
WCHAR strPath[MAX_PATH];
D3DX11_IMAGE_LOAD_INFO LoadInfo;
DXUTFindDXSDKMediaFileCch( strPath, MAX_PATH,
L"Light Probes\\uffizi_cross.dds" );
LoadInfo.Format = DXGI_FORMAT_R16G16B16A16_FLOAT;
hr = D3DX11CreateShaderResourceViewFromFile( pd3dDevice, strPath,
&LoadInfo, NULL, &pCubeRV, NULL );
Requirements
Requirement | Value |
---|---|
Header |
|