mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-07 16:54:14 +01:00
[d3d11] Report unified memory if all heaps are device-local
Together with mapping default resources, this may or may not help performance in some applications on integrated graphics.
This commit is contained in:
parent
518d06b9c2
commit
abf89356cd
@ -1649,7 +1649,7 @@ namespace dxvk {
|
|||||||
info->MapOnDefaultTextures = TRUE;
|
info->MapOnDefaultTextures = TRUE;
|
||||||
info->TiledResourcesTier = D3D11_TILED_RESOURCES_NOT_SUPPORTED;
|
info->TiledResourcesTier = D3D11_TILED_RESOURCES_NOT_SUPPORTED;
|
||||||
info->StandardSwizzle = FALSE;
|
info->StandardSwizzle = FALSE;
|
||||||
info->UnifiedMemoryArchitecture = FALSE; // Maybe on some APUs?
|
info->UnifiedMemoryArchitecture = IsUnifiedMemoryArch();
|
||||||
} return S_OK;
|
} return S_OK;
|
||||||
|
|
||||||
case D3D11_FEATURE_D3D11_OPTIONS3: {
|
case D3D11_FEATURE_D3D11_OPTIONS3: {
|
||||||
@ -2307,6 +2307,18 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOL D3D11Device::IsUnifiedMemoryArch() {
|
||||||
|
auto memory = m_dxvkAdapter->memoryProperties();
|
||||||
|
bool result = true;
|
||||||
|
|
||||||
|
// Report unified memory if all heaps are device-local
|
||||||
|
for (uint32_t i = 0; i < memory.memoryHeapCount && result; i++)
|
||||||
|
result &= memory.memoryHeaps[i].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
D3D_FEATURE_LEVEL D3D11Device::GetMaxFeatureLevel(const Rc<DxvkAdapter>& Adapter) {
|
D3D_FEATURE_LEVEL D3D11Device::GetMaxFeatureLevel(const Rc<DxvkAdapter>& Adapter) {
|
||||||
static const std::array<std::pair<std::string, D3D_FEATURE_LEVEL>, 9> s_featureLevels = {{
|
static const std::array<std::pair<std::string, D3D_FEATURE_LEVEL>, 9> s_featureLevels = {{
|
||||||
{ "12_1", D3D_FEATURE_LEVEL_12_1 },
|
{ "12_1", D3D_FEATURE_LEVEL_12_1 },
|
||||||
|
@ -496,6 +496,8 @@ namespace dxvk {
|
|||||||
UINT Subresource,
|
UINT Subresource,
|
||||||
const D3D11_BOX* pBox);
|
const D3D11_BOX* pBox);
|
||||||
|
|
||||||
|
BOOL IsUnifiedMemoryArch();
|
||||||
|
|
||||||
static D3D_FEATURE_LEVEL GetMaxFeatureLevel(
|
static D3D_FEATURE_LEVEL GetMaxFeatureLevel(
|
||||||
const Rc<DxvkAdapter>& Adapter);
|
const Rc<DxvkAdapter>& Adapter);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user