From 7c14003ebdd84539c6466c993ac2ad4ba0928d53 Mon Sep 17 00:00:00 2001 From: Collecting Date: Sun, 25 Jan 2026 14:35:44 +0100 Subject: [PATCH 1/2] fix(android): Double for static_cast Signed-off-by: Collecting --- src/video_core/texture_cache/texture_cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index a121d7b7e..0a92b3189 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -175,7 +175,7 @@ void TextureCache

::RunGarbageCollector() { num_iterations = base_iterations * 2; } else if (high_priority_mode) { ticks_to_destroy = base_ticks; - num_iterations = static_cast(base_iterations * 1.5); + num_iterations = static_cast(static_cast(base_iterations) * 1.5); } else { ticks_to_destroy = base_ticks * 2; num_iterations = base_iterations; From dcf6e4058fa96976b5c77638b0e2926309011939 Mon Sep 17 00:00:00 2001 From: Collecting Date: Sun, 25 Jan 2026 14:36:41 +0100 Subject: [PATCH 2/2] fix(android): Required multiple static_cast fixes Signed-off-by: Collecting --- src/video_core/buffer_cache/buffer_cache.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index d32f228e2..8f54408a1 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -43,7 +43,7 @@ BufferCache

::BufferCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, R if (configured_limit_mb > 0) { vram_limit_bytes = static_cast(configured_limit_mb) * 1_MiB; } else { - vram_limit_bytes = static_cast(device_local_memory * 0.80); + vram_limit_bytes = static_cast(static_cast(device_local_memory) * 0.80); } // Adjust thresholds based on GC aggressiveness setting @@ -74,8 +74,8 @@ BufferCache

::BufferCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, R break; } - minimum_memory = static_cast(vram_limit_bytes * expected_ratio); - critical_memory = static_cast(vram_limit_bytes * critical_ratio); + minimum_memory = static_cast(static_cast(vram_limit_bytes) * expected_ratio); + critical_memory = static_cast(static_cast(vram_limit_bytes) * critical_ratio); LOG_INFO(Render_Vulkan, "Buffer cache VRAM initialized: limit={}MB, minimum={}MB, critical={}MB", @@ -95,7 +95,7 @@ void BufferCache

::RunGarbageCollector() { } const bool aggressive_gc = total_used_memory >= critical_memory; - const bool emergency_gc = total_used_memory >= static_cast(vram_limit_bytes * BUFFER_VRAM_CRITICAL_THRESHOLD); + const bool emergency_gc = total_used_memory >= static_cast(static_cast(vram_limit_bytes) * BUFFER_VRAM_CRITICAL_THRESHOLD); // FIXED: VRAM leak prevention - Get eviction frames from settings const u64 eviction_frames = Settings::values.buffer_eviction_frames.GetValue(); @@ -207,7 +207,7 @@ void BufferCache

::TickFrame() { const auto gc_level = Settings::values.gc_aggressiveness.GetValue(); const bool should_gc = gc_level != Settings::GCAggressiveness::Off && (total_used_memory >= minimum_memory || - total_used_memory >= static_cast(vram_limit_bytes * BUFFER_VRAM_WARNING_THRESHOLD)); + total_used_memory >= static_cast(static_cast(vram_limit_bytes) * BUFFER_VRAM_WARNING_THRESHOLD)); if (should_gc) { RunGarbageCollector();