Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update device_buffer_vk.cc
  • Loading branch information
Jonah Williams authored Jun 9, 2023
commit 6045e20a0e9ad9a47734ef126a8a43bc618fe0ce
2 changes: 2 additions & 0 deletions impeller/renderer/backend/vulkan/device_buffer_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ bool DeviceBufferVK::OnCopyHostBuffer(const uint8_t* source,
if (source) {
::memmove(dest + offset, source + source_range.offset, source_range.length);
}
// See https://github.com/flutter/flutter/issues/128556 . Some devices do not
// have support for coherent host memory and require an explicit flush.
::vmaFlushAllocation(allocator_, allocation_, offset, source_range.length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#ifdef FML_OS_ANDROID?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure? we can't actually test all the devices this will run on, and this will always be safe to call...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should probably just not request coherent memory if we don't need it and add the explict flushes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

It looks like we should be querying vmaGetMemoryProperties to see if the https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceMemoryProperties.html has a VkMemoryType that supports host coherent.


return true;
Expand Down