다음을 통해 공유


DirectX 앱을 원격으로 디버깅

Visual Studio 및 Windows 8 SDK를 사용하여 DirectX 앱을 원격으로 디버그할 수 있습니다. Windows 8 SDK는 Visual Studio에서 제공하는 디버깅 외에도 DirectX 개발을 지원하고 오류 검사 및 매개 변수 유효성 검사를 제공하는 구성 요소 집합을 제공합니다. 이러한 구성 요소는 D3D11_1SDKLayers.dll, D2D1Debug1.dll 및 Dxgidebug.dll.

Windows 8 SDK를 설치하지 않고 컴퓨터에서 원격으로 디버그하려는 경우 이 추가 디버깅 기능을 사용하려면 디버그하려는 아키텍처에 적합한 원격 디버깅 패키지를 설치해야 합니다. 의 Windows Installer 패키지는 C:\Program Files (x86)\Windows Kits\8.0\Remote\<arch> 적절한 지원을 설치합니다.

Direct2D 앱에 대한 추가 디버깅 기능을 사용하도록 설정하려면 다음 코드를 사용합니다.

    D2D1_FACTORY_OPTIONS options;
    ZeroMemory(&options, sizeof(D2D1_FACTORY_OPTIONS));

#if defined(_DEBUG)
     // If the project is in a debug build, enable Direct2D debugging via SDK Layers.
    options.debugLevel = D2D1_DEBUG_LEVEL_INFORMATION;
#endif

    DX::ThrowIfFailed(
        D2D1CreateFactory(
            D2D1_FACTORY_TYPE_SINGLE_THREADED,
            __uuidof(ID2D1Factory1),
            &options,
            &m_d2dFactory
            )
        );         

Direct3D 앱에 대한 추가 디버깅 기능을 사용하도록 설정하려면 다음 코드를 사용합니다.

    // This flag supports surfaces with a different color channel ordering than the API default.
    // It is recommended usage, and is required for compatibility with Direct2D.
    UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
    ComPtr<IDXGIDevice> dxgiDevice;

#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
    DX::ThrowIfFailed(
        D3D11CreateDevice(
            nullptr,                    // specify null to use the default adapter
            D3D_DRIVER_TYPE_HARDWARE,
            0,                          // leave as 0 unless software device
            creationFlags,              // optionally set debug and Direct2D compatibility flags
            featureLevels,              // list of feature levels this app can support
            ARRAYSIZE(featureLevels),   // number of entries in above list
            D3D11_SDK_VERSION,          // always set this to D3D11_SDK_VERSION for modern
            &device,                    // returns the Direct3D device created
            &m_featureLevel,            // returns feature level of device created
            &context                    // returns the device immediate context
            )
        );

Direct2D 앱 디버깅에 대한 자세한 내용은 Direct2D 디버그 계층을 참조하세요.

Direct3D 앱 디버깅에 대한 자세한 내용은 Direct3D 디버그 계층을 참조하세요.