D3D11_RESOURCE_MISC_FLAG Enumeration

Identifies options for resources.

Syntax

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_FLAG;

Konstanten

  • 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 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.

    WARP and REF devices do not support shared resources. If you try to create a resource with this flag on either a WARP or REF device, the create method will return an E_OUTOFMEMORY error code.

  • 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 the IDXGIKeyedMutex::AcquireSync and IDXGIKeyedMutex::ReleaseSync APIs. The following 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 the IDXGIKeyedMutex::AcquireSync and IDXGIKeyedMutex::ReleaseSync APIs 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 IDXGIKeyedMutex::AcquireSync before they issue any rendering commands to the surface. When those devices finish rendering, they must call IDXGIKeyedMutex::ReleaseSync.

    D3D11_RESOURCE_MISC_SHARED and D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX are mutually exclusive.

    WARP and REF devices do not support shared resources. If you try to create a resource with this flag on either a WARP or REF device, the create method will return an E_OUTOFMEMORY error code.

  • 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.

Hinweise

This enumeration is used in D3D11_BUFFER_DESC, D3D11_TEXTURE1D_DESC, D3D11_TEXTURE2D_DESC, D3D11_TEXTURE3D_DESC.

These flags can be combined by bitwise OR.

Anforderungen

Header

D3D11.h

Siehe auch

Resource Enumerations