Compare commits

..

1 Commits

Author SHA1 Message Date
PavelBARABANOV df57a094b2 [vk_texture_cashe] improve MSAA copy fallback when specialized pass unavailable 2026-02-17 16:24:25 +01:00
5 changed files with 9 additions and 16 deletions
+1 -2
View File
@@ -545,8 +545,7 @@ struct Values {
SwitchableSetting<bool> fix_bloom_effects{linkage, false, "fix_bloom_effects",
Category::RendererHacks};
SwitchableSetting<bool> force_smaller_buffers{linkage, false, "force_smaller_buffers",
Category::RendererHacks};
SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders",
Category::RendererHacks};
@@ -340,10 +340,6 @@ 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,7 +15,6 @@
#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"
@@ -544,9 +543,7 @@ private:
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
.pNext = nullptr,
.flags = 0,
.size = ::Settings::values.force_smaller_buffers.GetValue()
? (SamplesQueryBank::QUERY_SIZE * (1ULL << log_2))
: (SamplesQueryBank::QUERY_SIZE * num_needed),
.size = SamplesQueryBank::QUERY_SIZE * (1ULL << log_2),
.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT |
VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
.sharingMode = VK_SHARING_MODE_EXCLUSIVE,
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
@@ -14,7 +14,6 @@
#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"
@@ -187,7 +186,7 @@ StagingBufferRef StagingBufferPool::CreateStagingBuffer(size_t size, MemoryUsage
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
.pNext = nullptr,
.flags = 0,
.size = ::Settings::values.force_smaller_buffers.GetValue() ? size : (1ULL << log2),
.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,
@@ -1583,11 +1583,13 @@ void TextureCacheRuntime::CopyImage(Image& dst, Image& src,
void TextureCacheRuntime::CopyImageMSAA(Image& dst, Image& src,
std::span<const VideoCommon::ImageCopy> copies) {
const bool msaa_to_non_msaa = src.info.num_samples > 1 && dst.info.num_samples == 1;
if (msaa_copy_pass) {
return msaa_copy_pass->CopyImage(dst, src, copies, msaa_to_non_msaa);
msaa_copy_pass->CopyImage(dst, src, copies,
src.info.num_samples > 1 && dst.info.num_samples == 1);
return;
}
UNIMPLEMENTED_MSG("Copying images with different samples is not supported.");
CopyImage(dst, src, copies);
}
u64 TextureCacheRuntime::GetDeviceLocalMemory() const {