From aedc575885e5a292eb4597eca1e096eec0e528eb Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 21 Feb 2024 23:43:25 -0800 Subject: [PATCH] fix discard copy --- src/Refresh_Driver_Vulkan.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Refresh_Driver_Vulkan.c b/src/Refresh_Driver_Vulkan.c index aae3632..7dea313 100644 --- a/src/Refresh_Driver_Vulkan.c +++ b/src/Refresh_Driver_Vulkan.c @@ -8484,9 +8484,8 @@ static void VULKAN_SetData( ) { VulkanRenderer *renderer = (VulkanRenderer*) driverData; VulkanCpuBufferContainer *cpuBufferContainer = (VulkanCpuBufferContainer*) cpuBuffer; - VulkanBuffer *vulkanBuffer = cpuBufferContainer->activeBuffer->vulkanBuffer; - if (option == REFRESH_SETDATAOPTIONS_DISCARD && SDL_AtomicGet(&vulkanBuffer->referenceCount) > 0) + if (option == REFRESH_SETDATAOPTIONS_DISCARD && SDL_AtomicGet(&cpuBufferContainer->activeBuffer->vulkanBuffer->referenceCount) > 0) { VULKAN_INTERNAL_DiscardActiveCpuBuffer( renderer, @@ -8495,8 +8494,8 @@ static void VULKAN_SetData( } uint8_t *bufferPointer = - vulkanBuffer->usedRegion->allocation->mapPointer + - vulkanBuffer->usedRegion->resourceOffset + + cpuBufferContainer->activeBuffer->vulkanBuffer->usedRegion->allocation->mapPointer + + cpuBufferContainer->activeBuffer->vulkanBuffer->usedRegion->resourceOffset + copyParams->dstOffset; SDL_memcpy(