我打开dxdiag应用程序,选择显示标签以检查支持的功能级别,这里是结果
今天我的内存不足,因为我的芯片烧断了,现在可以在2GB的内存上运行
所以看来我的设备支持DirectX功能级别11
跳转到Visual Studio 2019我尝试创建D3D11设备
D3D_FEATURE_LEVEL levels[] = { //Supported Levels We Want 11 or above
D3D_FEATURE_LEVEL_9_1,
D3D_FEATURE_LEVEL_9_2,
D3D_FEATURE_LEVEL_9_3,
D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_11_1
};
D3D_FEATURE_LEVEL supported = {};
HRESULT deviceCreate = D3D11CreateDevice(
nullptr //Use Default Adapter
,D3D_DRIVER_TYPE_HARDWARE,0 //Use Hardware ,no software module provided
,D3D11_CREATE_DEVICE_BGRA_SUPPORT | D3D11_CREATE_DEVICE_DEBUG //Flags for device creation
,levels,ARRAYSIZE(levels),D3D11_SDK_VERSION //Feature array,size of array,sdk to use
,&device,&supported,&context //Created Device,supported level,context
);
if (FAILED(deviceCreate))
{
MessageBox(NULL, L"Failed To Create D3D11 Device", L"Failed DirectX", MB_OK);
error = 1;
return;
}
switch (supported)
{
case D3D_FEATURE_LEVEL_9_1:MessageBox(NULL, L"9_1", L"9_1", MB_OK);
break;
case D3D_FEATURE_LEVEL_9_2:MessageBox(NULL, L"9_2", L"9_2", MB_OK);
break;
case D3D_FEATURE_LEVEL_9_3:MessageBox(NULL, L"9_3", L"9_3", MB_OK);
break;
case D3D_FEATURE_LEVEL_10_0:MessageBox(NULL, L"10_0", L"10_0", MB_OK);
break;
case D3D_FEATURE_LEVEL_10_1:MessageBox(NULL, L"10_1", L"10_1", MB_OK);
break;
case D3D_FEATURE_LEVEL_11_0:MessageBox(NULL, L"11_0", L"11_0", MB_OK);
break;
case D3D_FEATURE_LEVEL_11_1:MessageBox(NULL, L"11_1", L"11_1", MB_OK);
}
输出:
我在自己的制造商网站和Windows Update上进行了查找,但都说您已经安装了最新的驱动程序。任何帮助将不胜感激
如评论中所建议,删除最低支持的功能级别即9_1是答案。
从文档中,如果要素级别数组为null,则默认数组
D3D_FEATURE_LEVEL levels[] = {
D3D_FEATURE_LEVEL_9_1,
D3D_FEATURE_LEVEL_9_2,
D3D_FEATURE_LEVEL_9_3,
D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_11_1
};
使用了与我通过的数组相同的格式,并且设备检查支持哪些功能级别,但是返回了数组中的IN ORDER和FIRST支持的功能级别[不是最适合您的设备]
因此,只需反转阵列并将功能级别11放入阵列中就可以解决问题
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句