Skip to content

Commit

Permalink
Migrate from VkExportDeviceMemoryMAGMA (deprecated). (flutter#4288)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejurka authored Oct 27, 2017
1 parent 963a29b commit 93da8c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 7 additions & 2 deletions content_handler/vulkan_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,16 @@ bool VulkanSurface::AllocateDeviceMemory(sk_sp<GrContext> context,
{
// Acquire the VMO for the device memory.
uint32_t vmo_handle = 0;
if (VK_CALL_LOG_ERROR(vk_.ExportDeviceMemoryMAGMA(
backend_context_->fDevice, vk_memory_, &vmo_handle)) !=

VkMemoryGetFuchsiaHandleInfoKHR get_handle_info = {
VK_STRUCTURE_TYPE_MEMORY_GET_FUCHSIA_HANDLE_INFO_KHR, nullptr,
vk_memory_, VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR};
if (VK_CALL_LOG_ERROR(vk_.GetMemoryFuchsiaHandleKHR(
backend_context_->fDevice, &get_handle_info, &vmo_handle)) !=
VK_SUCCESS) {
return false;
}

exported_vmo.reset(static_cast<zx_handle_t>(vmo_handle));
}

Expand Down
4 changes: 1 addition & 3 deletions vulkan/vulkan_proc_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ bool VulkanProcTable::SetupInstanceProcAddresses(
#if OS_FUCHSIA
[this, &handle]() -> bool {
ACQUIRE_PROC(CreateMagmaSurfaceKHR, handle);
ACQUIRE_PROC(ExportDeviceMemoryMAGMA, handle);
ACQUIRE_PROC(GetPhysicalDeviceMagmaPresentationSupportKHR, handle);
ACQUIRE_PROC(ImportSemaphoreFuchsiaHandleKHR, handle);
return true;
}();
#endif // OS_FUCHSIA
Expand Down Expand Up @@ -146,7 +144,7 @@ bool VulkanProcTable::SetupDeviceProcAddresses(
ACQUIRE_PROC(ResetFences, handle);
ACQUIRE_PROC(WaitForFences, handle);
#if OS_FUCHSIA
ACQUIRE_PROC(ExportDeviceMemoryMAGMA, handle);
ACQUIRE_PROC(GetMemoryFuchsiaHandleKHR, handle);
ACQUIRE_PROC(ImportSemaphoreFuchsiaHandleKHR, handle);
#endif // OS_FUCHSIA
device_ = {handle, nullptr};
Expand Down
2 changes: 1 addition & 1 deletion vulkan/vulkan_proc_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class VulkanProcTable : public fxl::RefCountedThreadSafe<VulkanProcTable> {
#endif // OS_ANDROID
#if OS_FUCHSIA
DEFINE_PROC(CreateMagmaSurfaceKHR);
DEFINE_PROC(ExportDeviceMemoryMAGMA);
DEFINE_PROC(GetMemoryFuchsiaHandleKHR);
DEFINE_PROC(GetPhysicalDeviceMagmaPresentationSupportKHR);
DEFINE_PROC(ImportSemaphoreFuchsiaHandleKHR);
#endif // OS_FUCHSIA
Expand Down

0 comments on commit 93da8c8

Please sign in to comment.