vk: Add re-bar toggle to GUI

This commit is contained in:
kd-11 2025-08-25 01:52:39 +03:00 committed by kd-11
parent 20a7297ac4
commit c42fe42787
6 changed files with 21 additions and 1 deletions

View file

@ -19,10 +19,16 @@ namespace vk
const auto& memory_map = g_render_device->get_memory_mapping(); const auto& memory_map = g_render_device->get_memory_mapping();
if (flags & heap_pool_low_latency) if ((flags & heap_pool_low_latency) && g_cfg.video.vk.use_rebar_upload_heap)
{ {
// Prefer uploading to BAR if low latency is desired. // Prefer uploading to BAR if low latency is desired.
m_prefer_writethrough = memory_map.device_bar_total_bytes > (2048ull * 0x100000); m_prefer_writethrough = memory_map.device_bar_total_bytes > (2048ull * 0x100000);
// Log it
if (m_prefer_writethrough && name)
{
rsx_log.notice("Data heap %s will attempt to use Re-BAR memory", name);
}
} }
VkFlags memory_flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; VkFlags memory_flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;

View file

@ -195,6 +195,7 @@ struct cfg_root : cfg::node
cfg::uint<0, 100> rcas_sharpening_intensity{ this, "FidelityFX CAS Sharpening Intensity", 50, true }; cfg::uint<0, 100> rcas_sharpening_intensity{ this, "FidelityFX CAS Sharpening Intensity", 50, true };
cfg::_enum<vk_gpu_scheduler_mode> asynchronous_scheduler{ this, "Asynchronous Queue Scheduler", vk_gpu_scheduler_mode::safe }; cfg::_enum<vk_gpu_scheduler_mode> asynchronous_scheduler{ this, "Asynchronous Queue Scheduler", vk_gpu_scheduler_mode::safe };
cfg::uint<256, 65536> vram_allocation_limit{ this, "VRAM allocation limit (MB)", 65536, false }; cfg::uint<256, 65536> vram_allocation_limit{ this, "VRAM allocation limit (MB)", 65536, false };
cfg::_bool use_rebar_upload_heap{ this, "Use Re-BAR for GPU uploads", true, false };
} vk{ this }; } vk{ this };

View file

@ -107,6 +107,7 @@ enum class emu_settings_type
OutputScalingMode, OutputScalingMode,
ForceHwMSAAResolve, ForceHwMSAAResolve,
DisableAsyncHostMM, DisableAsyncHostMM,
UseReBAR,
// Performance Overlay // Performance Overlay
PerfOverlayEnabled, PerfOverlayEnabled,
@ -316,6 +317,7 @@ inline static const std::map<emu_settings_type, cfg_location> settings_location
{ emu_settings_type::VulkanAsyncSchedulerDriver, { "Video", "Vulkan", "Asynchronous Queue Scheduler"}}, { emu_settings_type::VulkanAsyncSchedulerDriver, { "Video", "Vulkan", "Asynchronous Queue Scheduler"}},
{ emu_settings_type::FsrSharpeningStrength, { "Video", "Vulkan", "FidelityFX CAS Sharpening Intensity"}}, { emu_settings_type::FsrSharpeningStrength, { "Video", "Vulkan", "FidelityFX CAS Sharpening Intensity"}},
{ emu_settings_type::ExclusiveFullscreenMode, { "Video", "Vulkan", "Exclusive Fullscreen Mode"}}, { emu_settings_type::ExclusiveFullscreenMode, { "Video", "Vulkan", "Exclusive Fullscreen Mode"}},
{ emu_settings_type::UseReBAR, { "Video", "Vulkan", "Use Re-BAR for GPU uploads"}},
// Performance Overlay // Performance Overlay
{ emu_settings_type::PerfOverlayEnabled, { "Video", "Performance Overlay", "Enabled" } }, { emu_settings_type::PerfOverlayEnabled, { "Video", "Performance Overlay", "Enabled" } },

View file

@ -2484,6 +2484,9 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
m_emu_settings->EnhanceCheckBox(ui->forceHwMSAAResolve, emu_settings_type::ForceHwMSAAResolve); m_emu_settings->EnhanceCheckBox(ui->forceHwMSAAResolve, emu_settings_type::ForceHwMSAAResolve);
SubscribeTooltip(ui->forceHwMSAAResolve, tooltips.settings.force_hw_MSAA); SubscribeTooltip(ui->forceHwMSAAResolve, tooltips.settings.force_hw_MSAA);
m_emu_settings->EnhanceCheckBox(ui->useReBAR, emu_settings_type::UseReBAR);
SubscribeTooltip(ui->useReBAR, tooltips.settings.use_ReBAR);
m_emu_settings->EnhanceCheckBox(ui->disableOnDiskShaderCache, emu_settings_type::DisableOnDiskShaderCache); m_emu_settings->EnhanceCheckBox(ui->disableOnDiskShaderCache, emu_settings_type::DisableOnDiskShaderCache);
SubscribeTooltip(ui->disableOnDiskShaderCache, tooltips.settings.disable_on_disk_shader_cache); SubscribeTooltip(ui->disableOnDiskShaderCache, tooltips.settings.disable_on_disk_shader_cache);

View file

@ -2731,6 +2731,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="useReBAR">
<property name="text">
<string>Use Re-BAR memory for GPU uploads</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="disableMslFastMath"> <widget class="QCheckBox" name="disableMslFastMath">
<property name="text"> <property name="text">

View file

@ -58,6 +58,7 @@ public:
const QString compatible_savestates = tr("When this mode is on, SPU emulation prioritizes savestate compatibility, however, it may reduce performance slightly.\nWhen this mode is off, some games may not allow making a savestate and show an SPU pause error in the log."); const QString compatible_savestates = tr("When this mode is on, SPU emulation prioritizes savestate compatibility, however, it may reduce performance slightly.\nWhen this mode is off, some games may not allow making a savestate and show an SPU pause error in the log.");
const QString paused_savestates = tr("When this mode is on, savestates are loaded and paused on the first frame.\nThis allows players to prepare for gameplay without being thrown into the action immediately."); const QString paused_savestates = tr("When this mode is on, savestates are loaded and paused on the first frame.\nThis allows players to prepare for gameplay without being thrown into the action immediately.");
const QString spu_profiler = tr("When enabled, SPU performance is measured at runtime.\nEnable only at a developer's request because when enabled it reduces performance a bit by itself."); const QString spu_profiler = tr("When enabled, SPU performance is measured at runtime.\nEnable only at a developer's request because when enabled it reduces performance a bit by itself.");
const QString use_ReBAR = tr("When enabled, Vulkan will try to use PCI-e resizable bar address space for GPU uploads of timing-sensitive data.\nThis yields a massive performance win on NVIDIA cards when the base framerate is low.\nFor games with very high framerates, this option can result in worse performance for all GPU vendors.\n");
// audio // audio