locked
D3D11CreateDevice fails in debug mode after upgrading to win8.1

    Question

  • The D3D11CreateDevice function call fails in debug mode after I upgrade my system from windows 8 pro to 8.1. This issue does not exist in release mode. I am sure I did not change a single line of code in my app. What happened?

        // This flag adds support for surfaces with a different color channel ordering
        // than the API default.
        UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT; 
    
    #if defined(_DEBUG)
       // If the project is in a debug build, enable debugging via SDK Layers with this flag.
       creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
    #endif
    
        const D3D_FEATURE_LEVEL featureLevels[] =
        {
            D3D_FEATURE_LEVEL_11_1,
            D3D_FEATURE_LEVEL_11_0,
            D3D_FEATURE_LEVEL_10_1,
            D3D_FEATURE_LEVEL_10_0,
            D3D_FEATURE_LEVEL_9_3,
            D3D_FEATURE_LEVEL_9_2,
            D3D_FEATURE_LEVEL_9_1,
        };
    
        // Create the DX11 API device object, and get a corresponding context.
        metouch::DX::ThrowIfFailed(
            D3D11CreateDevice(
                nullptr,                        // Specify nullptr to use the default adapter.
                D3D_DRIVER_TYPE_HARDWARE,
                nullptr,
                creationFlags,                  // Set debug and Direct2D compatibility flags.
                featureLevels,                  // List of feature levels this app can support.
                ARRAYSIZE(featureLevels),
                D3D11_SDK_VERSION,              // Always set this to D3D11_SDK_VERSION for Metro style apps.
                &m_d3dDevice,                   // Returns the Direct3D device created.
                &m_featureLevel,
                &m_d3dContext                   // Returns the device immediate context.
                )
            );
    

    Tuesday, October 29, 2013 4:45 PM

Answers

All replies