为什么我的第二个适配器没有出现?

时间:2018-01-02 00:34:37

标签: winapi graphics directx gpu amd-processor

由于很少有游戏和图形应用程序在我的GPU(AMD Radeon 6600M)中运行而选择了英特尔HD3000,我编写了这个小代码来开始调查。

#include <stdio.h>
#include <stdlib.h>
#include <DXGI.h>

int enumGraphicsAdapters( void* pFactory )
{
    int rc = ERROR_SUCCESS;

    HRESULT rcDx;
    UINT i = 0;

    IDXGIAdapter* pAdapter;
    IDXGIFactory* localFactory = (IDXGIFactory*)pFactory;
    DXGI_ADAPTER_DESC desc;

    rcDx = localFactory->EnumAdapters(i, &pAdapter);
    while( rcDx != DXGI_ERROR_NOT_FOUND )
    {
        if( S_OK == rcDx )
        {
            HRESULT rcGetDesc = pAdapter->GetDesc( &desc );
            if( SUCCEEDED( rcGetDesc ) )
            {
                wprintf(TEXT("Adapter %d: [%s]\n"), i, desc.Description);
            }
        }
        else
        {
            wprintf(TEXT("No more adapters\n"));
        }

        i++;
        rcDx = localFactory->EnumAdapters(i, &pAdapter);
    }

    return rc;
}

int initDx( void )
{
    int rc = (-1);
    IDXGIFactory* pFactory;
    HRESULT rcDx = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&pFactory);

    if( SUCCEEDED( rcDx ) )
    {
        printf("Succedded creating DXGIFactory!\n");
        rc = enumGraphicsAdapters( pFactory );
        getchar();
        rc = ERROR_SUCCESS;
    }

    if( pFactory )
    {
        pFactory->Release();
    }

    return rc;
}



int main( int argc, char* argv[] )
{
    (void)initDx();

    return EXIT_SUCCESS;
}

现在,设备管理器正确显示。见图。 Device Manager Graphics Adapters

但是我自己的代码没有检测到AMD Radeon Graphic适配器。见图。

enter image description here

有些人可以解释一下为什么会这样吗?

谢谢!

0 个答案:

没有答案