|
|
|
@ -11,6 +11,7 @@ |
|
|
|
#include <memory> |
|
|
|
#include <numeric> |
|
|
|
|
|
|
|
#include "common/logging/log.h" |
|
|
|
#include "common/range_sets.inc" |
|
|
|
#include "video_core/buffer_cache/buffer_cache_base.h" |
|
|
|
#include "video_core/guest_memory.h" |
|
|
|
@ -36,6 +37,12 @@ BufferCache<P>::BufferCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, R |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if constexpr (!IS_OPENGL) { |
|
|
|
if (ForceOldUBOMethod()) { |
|
|
|
LOG_INFO(Render_Vulkan, "Vulkan BufferCache using legacy uniform binding path"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const s64 device_local_memory = static_cast<s64>(runtime.GetDeviceLocalMemory()); |
|
|
|
const s64 min_spacing_expected = device_local_memory - 1_GiB; |
|
|
|
const s64 min_spacing_critical = device_local_memory - 512_MiB; |
|
|
|
@ -797,7 +804,7 @@ void BufferCache<P>::BindHostGraphicsUniformBuffer(size_t stage, u32 index, u32 |
|
|
|
if constexpr (!IS_OPENGL) { |
|
|
|
if constexpr (requires(const Runtime& r) { r.GetMaxUniformBufferRange(); }) { |
|
|
|
max_range = runtime.GetMaxUniformBufferRange(); |
|
|
|
if (max_range != 0) { |
|
|
|
if (!force_old_ubo && max_range != 0) { |
|
|
|
size_for_bind = (std::min)(size_for_bind, max_range); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -983,7 +990,7 @@ void BufferCache<P>::BindHostComputeUniformBuffers() { |
|
|
|
if constexpr (!IS_OPENGL) { |
|
|
|
if constexpr (requires(const Runtime& r) { r.GetMaxUniformBufferRange(); }) { |
|
|
|
max_range = runtime.GetMaxUniformBufferRange(); |
|
|
|
if (max_range != 0) { |
|
|
|
if (!force_old_ubo && max_range != 0) { |
|
|
|
size_for_bind = (std::min)(size_for_bind, max_range); |
|
|
|
} |
|
|
|
} |
|
|
|
|