(cherry picked from commit 76f8705c1243640c7933f05fddf75f3e16fd7dff)
@@ -2452,6 +2452,11 @@ static void VULKAN_INTERNAL_TrackTextureTransfer(
VulkanCommandBuffer *commandBuffer,
VulkanTexture *texture)
{
+ // Textures not managed by our allocator (i.e. the swapchain) don't need to be refcounted.
+ if (texture->usedRegion == NULL) {
+ return;
+ }
+
TRACK_RESOURCE(
texture,
VulkanTexture *,