fix discard copy

pull/50/head
cosmonaut 2024-02-21 23:43:25 -08:00
parent 578ac3634d
commit aedc575885
1 changed files with 3 additions and 4 deletions

View File

@ -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(