Identifies options for resources.
typedef enum D3D11_RESOURCE_MISC_FLAG
{
D3D11_RESOURCE_MISC_GENERATE_MIPS = 0x1L,
D3D11_RESOURCE_MISC_SHARED = 0x2L,
D3D11_RESOURCE_MISC_TEXTURECUBE = 0x4L,
D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS = 0x10L,
D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS = 0x20L,
D3D11_RESOURCE_MISC_BUFFER_STRUCTURED = 0x40L,
D3D11_RESOURCE_MISC_RESOURCE_CLAMP = 0x80L,
D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x100L,
D3D11_RESOURCE_MISC_GDI_COMPATIBLE = 0x200L,
D3D11_RESOURCE_MISC_SHARED_NTHANDLE = 0x800L,
D3D11_RESOURCE_MISC_RESTRICTED_CONTENT = 0x1000L,
D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE = 0x2000L,
D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER = 0x4000L,
D3D11_RESOURCE_MISC_GUARDED = 0x8000L,
D3D11_RESOURCE_MISC_TILE_POOL = 0x4000000L,
D3D11_RESOURCE_MISC_TILED = 0x8000000L,
D3D11X_RESOURCE_MISC_ESRAM_RESIDENT = 0x20000L,
D3D11X_RESOURCE_MISC_NO_COLOR_EXPAND = 0x40000L,
D3D11X_RESOURCE_MISC_NO_COLOR_COMPRESSION = 0x80000L,
D3D11X_RESOURCE_MISC_NO_DEPTH_COMPRESSION = 0x100000L,
D3D11X_RESOURCE_MISC_NO_STENCIL_COMPRESSION = 0x200000L,
D3D11X_RESOURCE_MISC_ALLOW_DCC = 0x400000L,
D3D11X_RESOURCE_MISC_FORCE_TEXTURE_COMPATIBILITY = 0x8000L
} D3D11_RESOURCE_MISC_FLAG;
|
Constant |
Description |
| D3D11_RESOURCE_MISC_GENERATE_MIPS | Enables MIP map generation by using ID3D11DeviceContext::GenerateMips on a texture resource. The resource must be created with the bind flags that specify that the resource is a render target and a shader resource. |
| D3D11_RESOURCE_MISC_SHARED | Enables resource data sharing between two or more Microsoft Direct3D devices. The only resources that can be shared are 2D non-mipmapped textures. D3D11_RESOURCE_MISC_SHARED and D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX are mutually exclusive. REF devices do not support shared resources. If you try to create a resource with this flag on a REF device, the create method will return an E_OUTOFMEMORY error code. WARP devices fully support shared resources. You can enable resource data sharing between two or more Microsoft Direct3D devices by using a combination of the D3D11_RESOURCE_MISC_SHARED_NTHANDLE and D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flags. |
| D3D11_RESOURCE_MISC_TEXTURECUBE | Sets a resource to be a cube texture created from a Texture2DArray that contains 6 textures. |
| D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS | Enables instancing of GPU-generated content. |
| D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS | Enables a resource as a byte address buffer. |
| D3D11_RESOURCE_MISC_BUFFER_STRUCTURED | Enables a resource as a structured buffer. |
| D3D11_RESOURCE_MISC_RESOURCE_CLAMP | Enables a resource with MIP map clamping for use with ID3D11DeviceContext::SetResourceMinLOD. |
| D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX | Enables the resource to be synchronized by using IDXGIKeyedMutex::AcquireSync and IDXGIKeyedMutex::ReleaseSync. The following Microsoft Direct3DÂ 11 resource creation APIs, that take D3D11_RESOURCE_MISC_FLAG parameters, have been extended to support the new flag.
If you call any of these methods with the D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flag set, the interface returned will support the IDXGIKeyedMutex interface. You can retrieve a pointer to the IDXGIKeyedMutex interface from the resource by using IUnknown::QueryInterface. The IDXGIKeyedMutex interface implements AcquireSync and ReleaseSync to synchronize access to the surface. The device that creates the surface, and any other device that opens the surface by using OpenSharedResource, must call AcquireSync before they issue any rendering commands to the surface. When those devices finish rendering, they must call ReleaseSync. D3D11_RESOURCE_MISC_SHARED
and D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX are mutually exclusive. REF devices do not support shared resources. If you try to create a resource with this flag on a REF device, the create method will return an E_OUTOFMEMORY error code. WARP devices fully support shared resources. |
| D3D11_RESOURCE_MISC_GDI_COMPATIBLE | Enables a resource compatible with GDI. You must set the D3D11_RESOURCE_MISC_GDI_COMPATIBLE flag on surfaces that you use with GDI. Setting the D3D11_RESOURCE_MISC_GDI_COMPATIBLE flag allows GDI rendering on the surface via IDXGISurface1::GetDC. Consider the following programming tips for using D3D11_RESOURCE_MISC_GDI_COMPATIBLE when you create a texture or use that texture in a swap chain:
- D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX and D3D11_RESOURCE_MISC_GDI_COMPATIBLE are mutually exclusive. Therefore, do not use them together.
- D3D11_RESOURCE_MISC_RESOURCE_CLAMP and D3D11_RESOURCE_MISC_GDI_COMPATIBLE are mutually exclusive. Therefore, do not use them together.
- You must bind the texture as a render target for the output-merger stage. For example, set the D3D11_BIND_RENDER_TARGET flag in the BindFlags member of the D3D11_TEXTURE2D_DESC structure.
- You must set the maximum number of MIP map levels to 1. For example, set the MipLevels member of the D3D11_TEXTURE2D_DESC structure to 1.
- You must specify that the texture requires read and write access by the GPU. For example, set the Usage member of the D3D11_TEXTURE2D_DESC structure to D3D11_USAGE_DEFAULT.
- You must set the texture format to one of the following types.
- DXGI_FORMAT_B8G8R8A8_UNORM
- DXGI_FORMAT_B8G8R8A8_TYPELESS
- DXGI_FORMAT_B8G8R8A8_UNORM_SRGB
For example, set the Format member of the D3D11_TEXTURE2D_DESC structure to one of these types.
- You cannot use D3D11_RESOURCE_MISC_GDI_COMPATIBLE with multisampling. Therefore, set the Count member of the DXGI_SAMPLE_DESC structure to 1. Then, set the SampleDesc member of the D3D11_TEXTURE2D_DESC structure to this DXGI_SAMPLE_DESC structure.
|
| D3D11_RESOURCE_MISC_SHARED_NTHANDLE | Set this flag to enable the use of NT HANDLE values when you create a shared resource. By enabling this flag, you deprecate the use of existing HANDLE values.When you use this flag, you must combine it with the D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flag by using a bitwise OR operation. The resulting value specifies a new shared resource type that directs the runtime to use NT HANDLE values for the shared resource. The runtime then must confirm that the shared resource works on all hardware at the specified feature level. Without this flag set, the runtime does not strictly validate shared resource parameters (that is, formats, flags, usage, and so on). When the runtime does not validate shared resource parameters, behavior of much of the Microsoft Direct3DAPI might be undefined and might vary from driver to driver.
Direct3D 11 and earlier
Note |
| This value is not supported until Direct3D 11.1. |
|
| D3D11_RESOURCE_MISC_RESTRICTED_CONTENT | Set this flag to indicate that the resource might contain protected content; therefore, the operating system should use the resource only when the driver and hardware support content protection. If the driver and hardware do not support content protection and you try to create a resource with this flag, the resource creation fails.
Direct3D 11
Note |
| This value is not supported until Direct3D 11.1. |
|
| D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE | Set this flag to indicate that the operating system restricts access to the shared surface. You can use this flag together with the D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER flag and only when you create a shared surface. The process that creates the shared resource can always open the shared resource.
Direct3D 11
Note |
| This value is not supported until Direct3D 11.1. |
|
| D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER | Set this flag to indicate that the driver restricts access to the shared surface. You can use this flag in conjunction with the D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE flag and only when you create a shared surface. The process that creates the shared resource can always open the shared resource.
Direct3D 11
Note |
| This value is not supported until Direct3D 11.1. |
|
| D3D11_RESOURCE_MISC_GUARDED | Set this flag to indicate that the resource is guarded. Such a resource is returned by the IDCompositionSurface::BeginDraw (Microsoft DirectComposition) and ISurfaceImageSourceNative::BeginDraw (Windows Runtime) APIs. For these APIs, you provide a region of interest (ROI) on a surface to update. This surface isn't compatible with multiple render targets (MRT).A guarded resource automatically restricts all writes to the region that is related to one of the preceding APIs. Additionally, the resource enforces access to the ROI with these restrictions:
Direct3D 11
Note |
| This value is not supported until Direct3D 11.1. |
|
| D3D11_RESOURCE_MISC_TILE_POOL | Set this flag to indicate that the resource is a tile pool.
Direct3D 11
Note |
| This value is not supported until Direct3D 11.2. |
|
| D3D11_RESOURCE_MISC_TILED | Set this flag to indicate that the resource is a tiled resource.
Direct3D 11
Note |
| This value is not supported until Direct3D 11.2. |
|
| D3D11X_RESOURCE_MISC_ESRAM_RESIDENT | Set this flag when you want ESRAM to be used for your resource (buffer or texture). This way, your resource will be used in the fastest possible memory. See the ESRAM section in DirectX.
Important |
| This value is not supported on Xbox One X hardware. |
|
| D3D11X_RESOURCE_MISC_NO_COLOR_EXPAND | Set this flag to disable color expansion. |
| D3D11X_RESOURCE_MISC_NO_COLOR_COMPRESSION | Disables color compression. |
| D3D11X_RESOURCE_MISC_NO_DEPTH_COMPRESSION | Disables depth compression. |
| D3D11X_RESOURCE_MISC_NO_STENCIL_COMPRESSION | Disables stencil compression. |
| D3D11X_RESOURCE_MISC_ALLOW_DCC | Enables Delta Color Compression (DCC), a form of render target compression that reduces bandwidth. |
| D3D11X_RESOURCE_MISC_FORCE_TEXTURE_COMPATIBILITY | Direct3D 11.x supports reads from DCC and compressed depth when the resource is created with the this flag. Reads from non-expanded fmask are not yet supported in D3D11.x. |
These flags can be combined by bitwise OR.