From 5947526a4d7f2ee1c88f928154433e4715193806 Mon Sep 17 00:00:00 2001 From: Lander Gallastegi Date: Wed, 30 Apr 2025 08:07:05 +0200 Subject: [PATCH] Fix store_index --- src/video_core/host_shaders/fault_buffer_process.comp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_core/host_shaders/fault_buffer_process.comp b/src/video_core/host_shaders/fault_buffer_process.comp index cdff9f302..a712cf441 100644 --- a/src/video_core/host_shaders/fault_buffer_process.comp +++ b/src/video_core/host_shaders/fault_buffer_process.comp @@ -33,10 +33,10 @@ void main() { uint bit = findLSB(word); word &= word - 1; uint page = base_bit + bit; - uint store_index = atomicAdd(download_buffer32[0], 1u); + uint store_index = atomicAdd(download_buffer32[0], 1u) + 1u; // It is very unlikely, but should we check for overflow? if (store_index < 1024u) { // only support 1024 page faults download_buffer[store_index] = uint64_t(page) << CACHING_PAGEBITS; } } -} \ No newline at end of file +}