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(