aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorkraibse <33869366+kraibse@users.noreply.github.com>2026-11-01 12:19:37 +0100
committerkraibse <33869366+kraibse@users.noreply.github.com>2026-11-02 00:11:25 +0100
commit16967eb30e97937f4ac3b200e681adde70089161 (patch)
treeecff50840d93a7b49430f7e91b28df3f120ba507 /src/video_core/renderer_vulkan
parent10e70639058b9adc4f7fc77e11982bb834fce86b (diff)
vulkan: don't make small images unbacked when device memory runs out
When VRAM ran out, any image that failed to allocate became a sparse image with nothing bound, which AMD's drivers don't survive being sampled (an RX 6600 died mid-flood, an RX 7800 XT made 211 of them, 8x8 ones included). Try host memory first, and count the images that didn't fit: the texture cache then keeps more room under the budget (512 MiB a step, up to 3 GiB, decaying) so its collector runs earlier. The sparse fallback stays for images too large to back.
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h
index e7ae9752a8..5ac833e787 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.h
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.h
@@ -76,6 +76,11 @@ public:
bool CanReportMemoryUsage() const;
+ /// Images that did not fit the device memory budget so far (see MemoryAllocator).
+ u32 MemoryPressureEvents() const noexcept {
+ return memory_allocator.MemoryPressureEvents();
+ }
+
void LogMemoryStatistics() const;
/// True when ASTC is re-compressed to BC3 and opaque images may use BC1 instead.