diff --git a/src/d3d9/d3d9_common_buffer.cpp b/src/d3d9/d3d9_common_buffer.cpp index 26b5cdd43..84f976a07 100644 --- a/src/d3d9/d3d9_common_buffer.cpp +++ b/src/d3d9/d3d9_common_buffer.cpp @@ -105,6 +105,11 @@ namespace dxvk { memoryFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; } + if (memoryFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT && m_parent->GetOptions()->apitraceMode) { + memoryFlags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT + | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; + } + return m_parent->GetDXVKDevice()->createBuffer(info, memoryFlags); } diff --git a/src/d3d9/d3d9_options.cpp b/src/d3d9/d3d9_options.cpp index 78b22e687..f49259dc5 100644 --- a/src/d3d9/d3d9_options.cpp +++ b/src/d3d9/d3d9_options.cpp @@ -73,6 +73,8 @@ namespace dxvk { this->tearFree = config.getOption ("d3d9.tearFree", Tristate::Auto); this->alphaTestWiggleRoom = config.getOption ("d3d9.alphaTestWiggleRoom", false); + this->apitraceMode = config.getOption("d3d9.apitraceMode", false); + // If we are not Nvidia, enable general hazards. this->generalHazards = adapter == nullptr || !adapter->matchesDriver(DxvkGpuVendor::Nvidia, VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, 0); applyTristate(this->generalHazards, config.getOption("d3d9.generalHazards", Tristate::Auto)); diff --git a/src/d3d9/d3d9_options.h b/src/d3d9/d3d9_options.h index abf559ea2..d27fddddc 100644 --- a/src/d3d9/d3d9_options.h +++ b/src/d3d9/d3d9_options.h @@ -151,6 +151,9 @@ namespace dxvk { /// Workaround for games using alpha test == 1.0, etc due to wonky interpolation or /// misc. imprecision on some vendors bool alphaTestWiggleRoom; + + /// Apitrace mode: Maps all buffers in cached memory. + bool apitraceMode; }; } \ No newline at end of file