|
7 | 7 | #include "flutter/shell/common/shell_io_manager.h"
|
8 | 8 | #include "include/gpu/GrDirectContext.h"
|
9 | 9 | #include "include/gpu/vk/GrVkBackendContext.h"
|
| 10 | +#include "include/gpu/vk/GrVkExtensions.h" |
10 | 11 | #include "shell/gpu/gpu_surface_vulkan.h"
|
11 | 12 | #include "shell/gpu/gpu_surface_vulkan_delegate.h"
|
12 | 13 |
|
@@ -103,30 +104,31 @@ sk_sp<GrDirectContext> EmbedderSurfaceVulkan::CreateGrContext(
|
103 | 104 | return nullptr;
|
104 | 105 | }
|
105 | 106 |
|
106 |
| - GrVkBackendContext backend_context = { |
107 |
| - .fInstance = instance, |
108 |
| - .fPhysicalDevice = device_.GetPhysicalDeviceHandle(), |
109 |
| - .fDevice = device_.GetHandle(), |
110 |
| - .fQueue = device_.GetQueueHandle(), |
111 |
| - .fGraphicsQueueIndex = device_.GetGraphicsQueueIndex(), |
112 |
| - .fMinAPIVersion = VK_MAKE_VERSION(1, 0, 0), |
113 |
| - .fMaxAPIVersion = VK_MAKE_VERSION(1, 0, 0), |
114 |
| - .fFeatures = skia_features, |
115 |
| - .fGetProc = get_proc, |
116 |
| - .fOwnsInstanceAndDevice = false, |
117 |
| - }; |
| 107 | + GrVkExtensions extensions; |
| 108 | + |
| 109 | + GrVkBackendContext backend_context = {}; |
| 110 | + backend_context.fInstance = instance; |
| 111 | + backend_context.fPhysicalDevice = device_.GetPhysicalDeviceHandle(); |
| 112 | + backend_context.fDevice = device_.GetHandle(); |
| 113 | + backend_context.fQueue = device_.GetQueueHandle(); |
| 114 | + backend_context.fGraphicsQueueIndex = device_.GetGraphicsQueueIndex(); |
| 115 | + backend_context.fMinAPIVersion = VK_MAKE_VERSION(1, 0, 0); |
| 116 | + backend_context.fMaxAPIVersion = VK_MAKE_VERSION(1, 0, 0); |
| 117 | + backend_context.fFeatures = skia_features; |
| 118 | + backend_context.fVkExtensions = &extensions; |
| 119 | + backend_context.fGetProc = get_proc; |
| 120 | + backend_context.fOwnsInstanceAndDevice = false; |
| 121 | + |
118 | 122 | // TODO(bdero): Activate MEMORY_REQUIREMENTS_2 if available because VMA (the
|
119 | 123 | // allocator used by Skia) knows how to take advantage of these
|
120 | 124 | // features.
|
121 | 125 | /*
|
122 | 126 | const char* device_extensions[] = {
|
123 | 127 | VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME,
|
124 | 128 | };
|
125 |
| - GrVkExtensions vk_extensions; |
126 |
| - vk_extensions.init(backend_context.fGetProc, backend_context.fInstance, |
| 129 | + extensions.init(backend_context.fGetProc, backend_context.fInstance, |
127 | 130 | backend_context.fPhysicalDevice, 0, nullptr,
|
128 | 131 | countof(device_extensions), device_extensions);
|
129 |
| - backend_context.fVkExtensions = &vk_extensions; |
130 | 132 | */
|
131 | 133 |
|
132 | 134 | GrContextOptions options =
|
|
0 commit comments