Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

[fuchsia] Use memory_requirements_2 extension. #19678

Merged
merged 1 commit into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 11 additions & 0 deletions shell/platform/fuchsia/flutter/vulkan_surface_producer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/GrContext.h"
#include "third_party/skia/include/gpu/vk/GrVkBackendContext.h"
#include "third_party/skia/include/gpu/vk/GrVkExtensions.h"
#include "third_party/skia/include/gpu/vk/GrVkTypes.h"

namespace flutter_runner {
Expand Down Expand Up @@ -126,6 +127,16 @@ bool VulkanSurfaceProducer::Initialize(scenic::Session* scenic_session) {
backend_context.fFeatures = skia_features;
backend_context.fGetProc = std::move(getProc);
backend_context.fOwnsInstanceAndDevice = false;
// The memory_requirements_2 extension is required on Fuchsia as the AMD
// memory allocator used by Skia benefit from it.
const char* device_extensions[] = {
VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME,
};
GrVkExtensions vk_extensions;
vk_extensions.init(backend_context.fGetProc, backend_context.fInstance,
backend_context.fPhysicalDevice, 0, nullptr,
countof(device_extensions), device_extensions);
backend_context.fVkExtensions = &vk_extensions;

context_ = GrContext::MakeVulkan(backend_context);

Expand Down
1 change: 1 addition & 0 deletions vulkan/vulkan_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ VulkanDevice::VulkanDevice(VulkanProcTable& p_vk,
VK_FUCHSIA_EXTERNAL_MEMORY_EXTENSION_NAME,
VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME,
VK_FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME,
VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME,
#endif
};

Expand Down