vkd3d: Negate upload_hvv config.

Enable resizable BAR style allocations by default, and add option to
disable it.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
Hans-Kristian Arntzen 2021-08-23 14:35:10 +02:00
parent 12066a2b67
commit a8f623e60d
5 changed files with 9 additions and 6 deletions

View File

@ -154,7 +154,10 @@ commas or semicolons.
- `dxr` - Enables DXR support if supported by device.
- `force_static_cbv` - Unsafe speed hack on NVIDIA. May or may not give a significant performance uplift.
- `single_queue` - Do not use asynchronous compute or transfer queues.
- `upload_hvv` - Attempt to use host-visible VRAM (large/resizable BAR) for the UPLOAD heap. May improve performance at the cost of using additional video memory over system memory.
- `no_upload_hvv` - Blocks any attempt to use host-visible VRAM (large/resizable BAR) for the UPLOAD heap.
May free up vital VRAM in certain critical situations, at cost of lower GPU performance.
A fraction of VRAM is reserved for resizable BAR allocations either way,
so it should not be a real issue even on lower VRAM cards.
- `VKD3D_DEBUG` - controls the debug level for log messages produced by
vkd3d-proton. Accepts the following values: none, err, info, fixme, warn, trace.
- `VKD3D_SHADER_DEBUG` - controls the debug level for log messages produced by

View File

@ -70,7 +70,7 @@ enum vkd3d_config_flags
VKD3D_CONFIG_FLAG_FORCE_RTV_EXCLUSIVE_QUEUE = 0x00000080,
VKD3D_CONFIG_FLAG_FORCE_DSV_EXCLUSIVE_QUEUE = 0x00000100,
VKD3D_CONFIG_FLAG_FORCE_MINIMUM_SUBGROUP_SIZE = 0x00000200,
VKD3D_CONFIG_FLAG_UPLOAD_HVV = 0x00000400,
VKD3D_CONFIG_FLAG_NO_UPLOAD_HVV = 0x00000400,
VKD3D_CONFIG_FLAG_LOG_MEMORY_BUDGET = 0x00000800,
};

View File

@ -500,7 +500,7 @@ static const struct vkd3d_debug_option vkd3d_config_options[] =
{"force_rtv_exclusive_queue", VKD3D_CONFIG_FLAG_FORCE_RTV_EXCLUSIVE_QUEUE},
{"force_dsv_exclusive_queue", VKD3D_CONFIG_FLAG_FORCE_DSV_EXCLUSIVE_QUEUE},
{"force_exclusive_queue", VKD3D_CONFIG_FLAG_FORCE_RTV_EXCLUSIVE_QUEUE | VKD3D_CONFIG_FLAG_FORCE_DSV_EXCLUSIVE_QUEUE},
{"upload_hvv", VKD3D_CONFIG_FLAG_UPLOAD_HVV},
{"no_upload_hvv", VKD3D_CONFIG_FLAG_NO_UPLOAD_HVV},
{"log_memory_budget", VKD3D_CONFIG_FLAG_LOG_MEMORY_BUDGET},
};

View File

@ -74,7 +74,7 @@ static HRESULT vkd3d_select_memory_flags(struct d3d12_device *device, const D3D1
case D3D12_HEAP_TYPE_UPLOAD:
*type_flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
if (vkd3d_config_flags & VKD3D_CONFIG_FLAG_UPLOAD_HVV)
if (!(vkd3d_config_flags & VKD3D_CONFIG_FLAG_NO_UPLOAD_HVV))
*type_flags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
break;

View File

@ -5295,7 +5295,7 @@ static HRESULT d3d12_descriptor_heap_init_data_buffer(struct d3d12_descriptor_he
return hr;
property_flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
if (vkd3d_config_flags & VKD3D_CONFIG_FLAG_UPLOAD_HVV)
if (!(vkd3d_config_flags & VKD3D_CONFIG_FLAG_NO_UPLOAD_HVV))
property_flags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
if (FAILED(hr = vkd3d_allocate_buffer_memory(device, descriptor_heap->vk_buffer,
@ -5949,7 +5949,7 @@ static uint32_t vkd3d_memory_info_find_global_mask(const struct vkd3d_memory_top
uint32_t heap_index;
uint32_t i, mask;
if (vkd3d_config_flags & VKD3D_CONFIG_FLAG_UPLOAD_HVV)
if (!(vkd3d_config_flags & VKD3D_CONFIG_FLAG_NO_UPLOAD_HVV))
return UINT32_MAX;
/* If we only have one device local heap, or no host-only heaps, there is nothing to do. */