Compare commits
1 Commits
pintocputh
...
vk-fix-oom
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c55017480 |
@@ -525,6 +525,8 @@ struct Values {
|
||||
Category::RendererAdvanced};
|
||||
SwitchableSetting<bool> use_video_framerate{linkage, false, "use_video_framerate",
|
||||
Category::RendererAdvanced};
|
||||
SwitchableSetting<bool> force_smaller_buffers{linkage, false, "force_smaller_buffers",
|
||||
Category::RendererAdvanced};
|
||||
SwitchableSetting<bool> barrier_feedback_loops{linkage, true, "barrier_feedback_loops",
|
||||
Category::RendererAdvanced};
|
||||
|
||||
|
||||
@@ -319,6 +319,10 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent)
|
||||
tr("Sync to framerate of video playback"),
|
||||
tr("Run the game at normal speed during video playback, even when the framerate is "
|
||||
"unlocked."));
|
||||
INSERT(Settings,
|
||||
force_smaller_buffers,
|
||||
tr("Force smaller buffers"),
|
||||
tr("Forces buffers to be smaller, may cause reads/writes out of bounds for some games but can fix Out-of-memory errors."));
|
||||
INSERT(Settings,
|
||||
barrier_feedback_loops,
|
||||
tr("Barrier feedback loops"),
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <vector>
|
||||
#include "video_core/renderer_vulkan/vk_texture_cache.h"
|
||||
#include "common/bit_util.h"
|
||||
#include "common/settings.h"
|
||||
#include "common/common_types.h"
|
||||
#include "video_core/engines/draw_manager.h"
|
||||
#include "video_core/host1x/gpu_device_memory_manager.h"
|
||||
@@ -556,7 +557,9 @@ private:
|
||||
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
.size = SamplesQueryBank::QUERY_SIZE * (1ULL << log_2),
|
||||
.size = ::Settings::values.force_smaller_buffers.GetValue()
|
||||
? (SamplesQueryBank::QUERY_SIZE * (1ULL << log_2))
|
||||
: (SamplesQueryBank::QUERY_SIZE * num_needed),
|
||||
.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT |
|
||||
VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
|
||||
.sharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "common/assert.h"
|
||||
#include "common/bit_util.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/settings.h"
|
||||
#include "common/literals.h"
|
||||
#include "video_core/renderer_vulkan/vk_scheduler.h"
|
||||
#include "video_core/renderer_vulkan/vk_staging_buffer_pool.h"
|
||||
@@ -186,7 +187,7 @@ StagingBufferRef StagingBufferPool::CreateStagingBuffer(size_t size, MemoryUsage
|
||||
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
.size = 1ULL << log2,
|
||||
.size = ::Settings::values.force_smaller_buffers.GetValue() ? size : (1ULL << log2),
|
||||
.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT |
|
||||
VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT |
|
||||
VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
|
||||
|
||||
Reference in New Issue
Block a user