1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-11 04:29:15 +01:00

[d3d11] Use user config to determine the maximum feature level

This commit is contained in:
Philip Rebohle 2018-08-09 21:08:03 +02:00
parent 73c91138db
commit 1a4b17d607
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 6 additions and 4 deletions

View File

@ -1288,7 +1288,7 @@ namespace dxvk {
const Rc<DxvkAdapter>& adapter, const Rc<DxvkAdapter>& adapter,
D3D_FEATURE_LEVEL featureLevel) { D3D_FEATURE_LEVEL featureLevel) {
// We currently only support 11_0 interfaces // We currently only support 11_0 interfaces
if (featureLevel > GetMaxFeatureLevel()) if (featureLevel > GetMaxFeatureLevel(adapter))
return false; return false;
// Check whether all features are supported // Check whether all features are supported
@ -1535,7 +1535,7 @@ namespace dxvk {
} }
D3D_FEATURE_LEVEL D3D11Device::GetMaxFeatureLevel() { D3D_FEATURE_LEVEL D3D11Device::GetMaxFeatureLevel(const Rc<DxvkAdapter>& Adapter) {
static const std::array<std::pair<std::string, D3D_FEATURE_LEVEL>, 7> s_featureLevels = {{ static const std::array<std::pair<std::string, D3D_FEATURE_LEVEL>, 7> s_featureLevels = {{
{ "11_1", D3D_FEATURE_LEVEL_11_1 }, { "11_1", D3D_FEATURE_LEVEL_11_1 },
{ "11_0", D3D_FEATURE_LEVEL_11_0 }, { "11_0", D3D_FEATURE_LEVEL_11_0 },
@ -1546,7 +1546,8 @@ namespace dxvk {
{ "9_1", D3D_FEATURE_LEVEL_9_1 }, { "9_1", D3D_FEATURE_LEVEL_9_1 },
}}; }};
const std::string maxLevel = env::getEnvVar(L"DXVK_FEATURE_LEVEL"); const std::string maxLevel = Adapter->instance()->config()
.getOption<std::string>("d3d11.maxFeatureLevel");
auto entry = std::find_if(s_featureLevels.begin(), s_featureLevels.end(), auto entry = std::find_if(s_featureLevels.begin(), s_featureLevels.end(),
[&] (const std::pair<std::string, D3D_FEATURE_LEVEL>& pair) { [&] (const std::pair<std::string, D3D_FEATURE_LEVEL>& pair) {

View File

@ -390,7 +390,8 @@ namespace dxvk {
VkFormat Format, VkFormat Format,
VkImageType Type) const; VkImageType Type) const;
static D3D_FEATURE_LEVEL GetMaxFeatureLevel(); static D3D_FEATURE_LEVEL GetMaxFeatureLevel(
const Rc<DxvkAdapter>& Adapter);
}; };