| Flutter Impeller |

capabilities_vk.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "impeller/renderer/backend/vulkan/capabilities_vk.h"
6
7 #include <algorithm>
8
9 #include "impeller/base/validation.h"
10 #include "impeller/core/formats.h"
11 #include "impeller/renderer/backend/vulkan/vk.h"
12
13 namespace impeller {
14
15 static constexpr const char* kInstanceLayer = "ImpellerInstance";
16
17 CapabilitiesVK::CapabilitiesVK(bool enable_validations) {
18 auto extensions = vk::enumerateInstanceExtensionProperties();
19 auto layers = vk::enumerateInstanceLayerProperties();
20
21 if (extensions.result != vk::Result::eSuccess ||
22 layers.result != vk::Result::eSuccess) {
23 return;
24 }
25
26 for (const auto& ext : extensions.value) {
27 exts_[kInstanceLayer].insert(ext.extensionName);
28 }
29
30 for (const auto& layer : layers.value) {
31 const std::string layer_name = layer.layerName;
32 auto layer_exts = vk::enumerateInstanceExtensionProperties(layer_name);
33 if (layer_exts.result != vk::Result::eSuccess) {
34 return;
35 }
36 for (const auto& layer_ext : layer_exts.value) {
37 exts_[layer_name].insert(layer_ext.extensionName);
38 }
39 }
40
41 validations_enabled_ =
42 enable_validations && HasLayer("VK_LAYER_KHRONOS_validation");
43 if (enable_validations && !validations_enabled_) {
44 FML_LOG(ERROR)
45 << "Requested Impeller context creation with validations but the "
46 "validation layers could not be found. Expect no Vulkan validation "
47 "checks!";
48 }
49 if (validations_enabled_) {
50 FML_LOG(INFO) << "Vulkan validations are enabled.";
51 }
52 is_valid_ = true;
53 }
54
55 CapabilitiesVK::~CapabilitiesVK() = default;
56
57 bool CapabilitiesVK::IsValid() const {
58 return is_valid_;
59 }
60
61 bool CapabilitiesVK::AreValidationsEnabled() const {
62 return validations_enabled_;
63 }
64
65 std::optional<std::vector<std::string>> CapabilitiesVK::GetEnabledLayers()
66 const {
67 std::vector<std::string> required;
68
69 if (validations_enabled_) {
70 // The presence of this layer is already checked in the ctor.
71 required.push_back("VK_LAYER_KHRONOS_validation");
72 }
73
74 return required;
75 }
76
77 std::optional<std::vector<std::string>>
78 CapabilitiesVK::GetEnabledInstanceExtensions() const {
79 std::vector<std::string> required;
80
81 if (!HasExtension("VK_KHR_surface")) {
82 // Swapchain support is required and this is a dependency of
83 // VK_KHR_swapchain.
84 VALIDATION_LOG << "Could not find the surface extension.";
85 return std::nullopt;
86 }
87 required.push_back("VK_KHR_surface");
88
89 auto has_wsi = false;
90 if (HasExtension("VK_MVK_macos_surface")) {
91 required.push_back("VK_MVK_macos_surface");
92 has_wsi = true;
93 }
94
95 if (HasExtension("VK_EXT_metal_surface")) {
96 required.push_back("VK_EXT_metal_surface");
97 has_wsi = true;
98 }
99
100 if (HasExtension("VK_KHR_portability_enumeration")) {
101 required.push_back("VK_KHR_portability_enumeration");
102 has_wsi = true;
103 }
104
105 if (HasExtension("VK_KHR_win32_surface")) {
106 required.push_back("VK_KHR_win32_surface");
107 has_wsi = true;
108 }
109
110 if (HasExtension("VK_KHR_android_surface")) {
111 required.push_back("VK_KHR_android_surface");
112 has_wsi = true;
113 }
114
115 if (HasExtension("VK_KHR_xcb_surface")) {
116 required.push_back("VK_KHR_xcb_surface");
117 has_wsi = true;
118 }
119
120 if (HasExtension("VK_KHR_xlib_surface")) {
121 required.push_back("VK_KHR_xlib_surface");
122 has_wsi = true;
123 }
124
125 if (HasExtension("VK_KHR_wayland_surface")) {
126 required.push_back("VK_KHR_wayland_surface");
127 has_wsi = true;
128 }
129
130 if (!has_wsi) {
131 // Don't really care which WSI extension there is as long there is at least
132 // one.
133 VALIDATION_LOG << "Could not find a WSI extension.";
134 return std::nullopt;
135 }
136
137 if (validations_enabled_) {
138 if (!HasExtension("VK_EXT_debug_utils")) {
139 VALIDATION_LOG << "Requested validations but could not find the "
140 "VK_EXT_debug_utils extension.";
141 return std::nullopt;
142 }
143 required.push_back("VK_EXT_debug_utils");
144
145 if (HasExtension("VK_EXT_validation_features")) {
146 // It's valid to not have `VK_EXT_validation_features` available. That's
147 // the case when using AGI as a frame debugger.
148 required.push_back("VK_EXT_validation_features");
149 }
150 }
151
152 return required;
153 }
154
155 static const char* GetExtensionName(RequiredCommonDeviceExtensionVK ext) {
156 switch (ext) {
157 case RequiredCommonDeviceExtensionVK::kKHRSwapchain:
158 return VK_KHR_SWAPCHAIN_EXTENSION_NAME;
159 case RequiredCommonDeviceExtensionVK::kLast:
160 return "Unknown";
161 }
162 FML_UNREACHABLE();
163 }
164
165 static const char* GetExtensionName(RequiredAndroidDeviceExtensionVK ext) {
166 switch (ext) {
167 case RequiredAndroidDeviceExtensionVK::
168 kANDROIDExternalMemoryAndroidHardwareBuffer:
169 return "VK_ANDROID_external_memory_android_hardware_buffer";
170 case RequiredAndroidDeviceExtensionVK::kKHRSamplerYcbcrConversion:
171 return VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME;
172 case RequiredAndroidDeviceExtensionVK::kKHRExternalMemory:
173 return VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME;
174 case RequiredAndroidDeviceExtensionVK::kEXTQueueFamilyForeign:
175 return VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME;
176 case RequiredAndroidDeviceExtensionVK::kKHRDedicatedAllocation:
177 return VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME;
178 case RequiredAndroidDeviceExtensionVK::kLast:
179 return "Unknown";
180 }
181 FML_UNREACHABLE();
182 }
183
184 static const char* GetExtensionName(OptionalDeviceExtensionVK ext) {
185 switch (ext) {
186 case OptionalDeviceExtensionVK::kEXTPipelineCreationFeedback:
187 return VK_EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME;
188 case OptionalDeviceExtensionVK::kVKKHRPortabilitySubset:
189 return "VK_KHR_portability_subset";
190 case OptionalDeviceExtensionVK::kLast:
191 return "Unknown";
192 }
193 FML_UNREACHABLE();
194 }
195
196 template <class T>
197 static bool IterateExtensions(const std::function<bool(T)>& it) {
198 if (!it) {
199 return false;
200 }
201 for (size_t i = 0; i < static_cast<uint32_t>(T::kLast); i++) {
202 if (!it(static_cast<T>(i))) {
203 return false;
204 }
205 }
206 return true;
207 }
208
209 static std::optional<std::set<std::string>> GetSupportedDeviceExtensions(
210 const vk::PhysicalDevice& physical_device) {
211 auto device_extensions = physical_device.enumerateDeviceExtensionProperties();
212 if (device_extensions.result != vk::Result::eSuccess) {
213 return std::nullopt;
214 }
215
216 std::set<std::string> exts;
217 for (const auto& device_extension : device_extensions.value) {
218 exts.insert(device_extension.extensionName);
219 };
220
221 return exts;
222 }
223
224 std::optional<std::vector<std::string>>
225 CapabilitiesVK::GetEnabledDeviceExtensions(
226 const vk::PhysicalDevice& physical_device) const {
227 auto exts = GetSupportedDeviceExtensions(physical_device);
228
229 if (!exts.has_value()) {
230 return std::nullopt;
231 }
232
233 std::vector<std::string> enabled;
234
235 auto for_each_common_extension = [&](RequiredCommonDeviceExtensionVK ext) {
236 auto name = GetExtensionName(ext);
237 if (exts->find(name) == exts->end()) {
238 VALIDATION_LOG << "Device does not support required extension: " << name;
239 return false;
240 }
241 enabled.push_back(name);
242 return true;
243 };
244
245 auto for_each_android_extension = [&](RequiredAndroidDeviceExtensionVK ext) {
246 #ifdef FML_OS_ANDROID
247 auto name = GetExtensionName(ext);
248 if (exts->find(name) == exts->end()) {
249 VALIDATION_LOG << "Device does not support required Android extension: "
250 << name;
251 return false;
252 }
253 enabled.push_back(name);
254 #endif // FML_OS_ANDROID
255 return true;
256 };
257
258 auto for_each_optional_extension = [&](OptionalDeviceExtensionVK ext) {
259 auto name = GetExtensionName(ext);
260 if (exts->find(name) != exts->end()) {
261 enabled.push_back(name);
262 }
263 return true;
264 };
265
266 const auto iterate_extensions =
267 IterateExtensions<RequiredCommonDeviceExtensionVK>(
268 for_each_common_extension) &&
269 IterateExtensions<RequiredAndroidDeviceExtensionVK>(
270 for_each_android_extension) &&
271 IterateExtensions<OptionalDeviceExtensionVK>(for_each_optional_extension);
272
273 if (!iterate_extensions) {
274 VALIDATION_LOG << "Device not suitable since required extensions are not "
275 "supported.";
276 return std::nullopt;
277 }
278
279 return enabled;
280 }
281
282 static bool HasSuitableColorFormat(const vk::PhysicalDevice& device,
283 vk::Format format) {
284 const auto props = device.getFormatProperties(format);
285 // This needs to be more comprehensive.
286 return !!(props.optimalTilingFeatures &
287 vk::FormatFeatureFlagBits::eColorAttachment);
288 }
289
290 static bool HasSuitableDepthStencilFormat(const vk::PhysicalDevice& device,
291 vk::Format format) {
292 const auto props = device.getFormatProperties(format);
293 return !!(props.optimalTilingFeatures &
294 vk::FormatFeatureFlagBits::eDepthStencilAttachment);
295 }
296
297 static bool PhysicalDeviceSupportsRequiredFormats(
298 const vk::PhysicalDevice& device) {
299 const auto has_color_format =
300 HasSuitableColorFormat(device, vk::Format::eB8G8R8A8Unorm);
301 const auto has_stencil_format =
302 HasSuitableDepthStencilFormat(device, vk::Format::eD32SfloatS8Uint) ||
303 HasSuitableDepthStencilFormat(device, vk::Format::eD24UnormS8Uint);
304 return has_color_format && has_stencil_format;
305 }
306
307 static bool HasRequiredProperties(const vk::PhysicalDevice& physical_device) {
308 auto properties = physical_device.getProperties();
309 if (!(properties.limits.framebufferColorSampleCounts &
310 (vk::SampleCountFlagBits::e1 | vk::SampleCountFlagBits::e4))) {
311 return false;
312 }
313 return true;
314 }
315
316 static bool HasRequiredQueues(const vk::PhysicalDevice& physical_device) {
317 auto queue_flags = vk::QueueFlags{};
318 for (const auto& queue : physical_device.getQueueFamilyProperties()) {
319 if (queue.queueCount == 0) {
320 continue;
321 }
322 queue_flags |= queue.queueFlags;
323 }
324 return static_cast<VkQueueFlags>(queue_flags &
325 (vk::QueueFlagBits::eGraphics |
326 vk::QueueFlagBits::eCompute |
327 vk::QueueFlagBits::eTransfer));
328 }
329
330 template <class ExtensionEnum>
331 static bool IsExtensionInList(const std::vector<std::string>& list,
332 ExtensionEnum ext) {
333 const std::string name = GetExtensionName(ext);
334 return std::find(list.begin(), list.end(), name) != list.end();
335 }
336
337 std::optional<CapabilitiesVK::PhysicalDeviceFeatures>
338 CapabilitiesVK::GetEnabledDeviceFeatures(
339 const vk::PhysicalDevice& device) const {
340 if (!PhysicalDeviceSupportsRequiredFormats(device)) {
341 VALIDATION_LOG << "Device doesn't support the required formats.";
342 return std::nullopt;
343 }
344
345 if (!HasRequiredProperties(device)) {
346 VALIDATION_LOG << "Device doesn't support the required properties.";
347 return std::nullopt;
348 }
349
350 if (!HasRequiredQueues(device)) {
351 VALIDATION_LOG << "Device doesn't support the required queues.";
352 return std::nullopt;
353 }
354
355 const auto enabled_extensions = GetEnabledDeviceExtensions(device);
356 if (!enabled_extensions.has_value()) {
357 VALIDATION_LOG << "Device doesn't support the required queues.";
358 return std::nullopt;
359 }
360
361 PhysicalDeviceFeatures supported_chain;
362 device.getFeatures2(&supported_chain.get());
363
364 PhysicalDeviceFeatures required_chain;
365
366 // Base features.
367 {
368 auto& required = required_chain.get().features;
369 const auto& supported = supported_chain.get().features;
370
371 // We require this for enabling wireframes in the playground. But its not
372 // necessarily a big deal if we don't have this feature.
373 required.fillModeNonSolid = supported.fillModeNonSolid;
374 }
375 // VK_KHR_sampler_ycbcr_conversion features.
376 if (IsExtensionInList(
377 enabled_extensions.value(),
378 RequiredAndroidDeviceExtensionVK::kKHRSamplerYcbcrConversion)) {
379 auto& required =
380 required_chain
381 .get<vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR>();
382 const auto& supported =
383 supported_chain
384 .get<vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR>();
385
386 required.samplerYcbcrConversion = supported.samplerYcbcrConversion;
387 }
388
389 return required_chain;
390 }
391
392 bool CapabilitiesVK::HasLayer(const std::string& layer) const {
393 for (const auto& [found_layer, exts] : exts_) {
394 if (found_layer == layer) {
395 return true;
396 }
397 }
398 return false;
399 }
400
401 bool CapabilitiesVK::HasExtension(const std::string& ext) const {
402 for (const auto& [layer, exts] : exts_) {
403 if (exts.find(ext) != exts.end()) {
404 return true;
405 }
406 }
407 return false;
408 }
409
410 void CapabilitiesVK::SetOffscreenFormat(PixelFormat pixel_format) const {
411 default_color_format_ = pixel_format;
412 }
413
414 bool CapabilitiesVK::SetPhysicalDevice(const vk::PhysicalDevice& device) {
415 if (HasSuitableDepthStencilFormat(device, vk::Format::eD32SfloatS8Uint)) {
416 default_depth_stencil_format_ = PixelFormat::kD32FloatS8UInt;
417 } else if (HasSuitableDepthStencilFormat(device,
418 vk::Format::eD24UnormS8Uint)) {
419 default_depth_stencil_format_ = PixelFormat::kD24UnormS8Uint;
420 } else {
421 default_depth_stencil_format_ = PixelFormat::kUnknown;
422 }
423
424 if (HasSuitableDepthStencilFormat(device, vk::Format::eS8Uint)) {
425 default_stencil_format_ = PixelFormat::kS8UInt;
426 } else if (default_depth_stencil_format_ != PixelFormat::kUnknown) {
427 default_stencil_format_ = default_depth_stencil_format_;
428 }
429
430 device_properties_ = device.getProperties();
431
432 auto physical_properties_2 =
433 device.getProperties2<vk::PhysicalDeviceProperties2,
434 vk::PhysicalDeviceSubgroupProperties>();
435
436 // Currently shaders only want access to arithmetic subgroup features.
437 // If that changes this needs to get updated, and so does Metal (which right
438 // now assumes it from compile time flags based on the MSL target version).
439
440 supports_compute_subgroups_ =
441 !!(physical_properties_2.get<vk::PhysicalDeviceSubgroupProperties>()
442 .supportedOperations &
443 vk::SubgroupFeatureFlagBits::eArithmetic);
444
445 {
446 // Query texture support.
447 // TODO(jonahwilliams):
448 // https://github.com/flutter/flutter/issues/129784
449 vk::PhysicalDeviceMemoryProperties memory_properties;
450 device.getMemoryProperties(&memory_properties);
451
452 for (auto i = 0u; i < memory_properties.memoryTypeCount; i++) {
453 if (memory_properties.memoryTypes[i].propertyFlags &
454 vk::MemoryPropertyFlagBits::eLazilyAllocated) {
455 supports_device_transient_textures_ = true;
456 }
457 }
458 }
459
460 // Determine the optional device extensions this physical device supports.
461 {
462 required_common_device_extensions_.clear();
463 required_android_device_extensions_.clear();
464 optional_device_extensions_.clear();
465 auto exts = GetSupportedDeviceExtensions(device);
466 if (!exts.has_value()) {
467 return false;
468 }
469 IterateExtensions<RequiredCommonDeviceExtensionVK>([&](auto ext) -> bool {
470 auto ext_name = GetExtensionName(ext);
471 if (exts->find(ext_name) != exts->end()) {
472 required_common_device_extensions_.insert(ext);
473 }
474 return true;
475 });
476 IterateExtensions<RequiredAndroidDeviceExtensionVK>([&](auto ext) -> bool {
477 auto ext_name = GetExtensionName(ext);
478 if (exts->find(ext_name) != exts->end()) {
479 required_android_device_extensions_.insert(ext);
480 }
481 return true;
482 });
483 IterateExtensions<OptionalDeviceExtensionVK>([&](auto ext) -> bool {
484 auto ext_name = GetExtensionName(ext);
485 if (exts->find(ext_name) != exts->end()) {
486 optional_device_extensions_.insert(ext);
487 }
488 return true;
489 });
490 }
491
492 return true;
493 }
494
495 // |Capabilities|
496 bool CapabilitiesVK::SupportsOffscreenMSAA() const {
497 return true;
498 }
499
500 // |Capabilities|
501 bool CapabilitiesVK::SupportsImplicitResolvingMSAA() const {
502 return false;
503 }
504
505 // |Capabilities|
506 bool CapabilitiesVK::SupportsSSBO() const {
507 return true;
508 }
509
510 // |Capabilities|
511 bool CapabilitiesVK::SupportsBufferToTextureBlits() const {
512 return true;
513 }
514
515 // |Capabilities|
516 bool CapabilitiesVK::SupportsTextureToTextureBlits() const {
517 return true;
518 }
519
520 // |Capabilities|
521 bool CapabilitiesVK::SupportsFramebufferFetch() const {
522 return true;
523 }
524
525 // |Capabilities|
526 bool CapabilitiesVK::SupportsCompute() const {
527 // Vulkan 1.1 requires support for compute.
528 return true;
529 }
530
531 // |Capabilities|
532 bool CapabilitiesVK::SupportsComputeSubgroups() const {
533 // Set by |SetPhysicalDevice|.
534 return supports_compute_subgroups_;
535 }
536
537 // |Capabilities|
538 bool CapabilitiesVK::SupportsReadFromResolve() const {
539 return false;
540 }
541
542 bool CapabilitiesVK::SupportsDecalSamplerAddressMode() const {
543 return true;
544 }
545
546 // |Capabilities|
547 bool CapabilitiesVK::SupportsDeviceTransientTextures() const {
548 return supports_device_transient_textures_;
549 }
550
551 // |Capabilities|
552 PixelFormat CapabilitiesVK::GetDefaultColorFormat() const {
553 return default_color_format_;
554 }
555
556 // |Capabilities|
557 PixelFormat CapabilitiesVK::GetDefaultStencilFormat() const {
558 return default_stencil_format_;
559 }
560
561 // |Capabilities|
562 PixelFormat CapabilitiesVK::GetDefaultDepthStencilFormat() const {
563 return default_depth_stencil_format_;
564 }
565
566 const vk::PhysicalDeviceProperties&
567 CapabilitiesVK::GetPhysicalDeviceProperties() const {
568 return device_properties_;
569 }
570
571 PixelFormat CapabilitiesVK::GetDefaultGlyphAtlasFormat() const {
572 return PixelFormat::kR8UNormInt;
573 }
574
575 bool CapabilitiesVK::HasExtension(RequiredCommonDeviceExtensionVK ext) const {
576 return required_common_device_extensions_.find(ext) !=
577 required_common_device_extensions_.end();
578 }
579
580 bool CapabilitiesVK::HasExtension(RequiredAndroidDeviceExtensionVK ext) const {
581 return required_android_device_extensions_.find(ext) !=
582 required_android_device_extensions_.end();
583 }
584
585 bool CapabilitiesVK::HasExtension(OptionalDeviceExtensionVK ext) const {
586 return optional_device_extensions_.find(ext) !=
587 optional_device_extensions_.end();
588 }
589
590 } // namespace impeller
impeller::OptionalDeviceExtensionVK
OptionalDeviceExtensionVK
A device extension enabled if available. Subsystems cannot assume availability and must check if thes...
Definition: capabilities_vk.h:91
impeller::HasRequiredProperties
static bool HasRequiredProperties(const vk::PhysicalDevice &physical_device)
Definition: capabilities_vk.cc:307
impeller::PixelFormat::kS8UInt
@ kS8UInt
impeller::CapabilitiesVK::SupportsDecalSamplerAddressMode
bool SupportsDecalSamplerAddressMode() const override
Whether the context backend supports SamplerAddressMode::Decal.
Definition: capabilities_vk.cc:542
impeller::RequiredCommonDeviceExtensionVK::kLast
@ kLast
impeller::CapabilitiesVK::SetOffscreenFormat
void SetOffscreenFormat(PixelFormat pixel_format) const
Definition: capabilities_vk.cc:410
impeller::CapabilitiesVK::GetEnabledInstanceExtensions
std::optional< std::vector< std::string > > GetEnabledInstanceExtensions() const
Definition: capabilities_vk.cc:78
impeller::kInstanceLayer
static constexpr const char * kInstanceLayer
Definition: capabilities_vk.cc:15
impeller::CapabilitiesVK::IsValid
bool IsValid() const
Definition: capabilities_vk.cc:57
impeller::CapabilitiesVK::SupportsOffscreenMSAA
bool SupportsOffscreenMSAA() const override
Whether the context backend supports attaching offscreen MSAA color/stencil textures.
Definition: capabilities_vk.cc:496
impeller::CapabilitiesVK::SupportsFramebufferFetch
bool SupportsFramebufferFetch() const override
Whether the context backend is able to support pipelines with shaders that read from the framebuffer ...
Definition: capabilities_vk.cc:521
impeller::RequiredAndroidDeviceExtensionVK::kLast
@ kLast
impeller::PixelFormat::kR8UNormInt
@ kR8UNormInt
impeller::OptionalDeviceExtensionVK::kLast
@ kLast
formats.h
impeller::HasSuitableDepthStencilFormat
static bool HasSuitableDepthStencilFormat(const vk::PhysicalDevice &device, vk::Format format)
Definition: capabilities_vk.cc:290
impeller::CapabilitiesVK::GetDefaultStencilFormat
PixelFormat GetDefaultStencilFormat() const override
Returns a supported PixelFormat for textures that store stencil information. May include a depth chan...
Definition: capabilities_vk.cc:557
impeller::CapabilitiesVK::GetEnabledLayers
std::optional< std::vector< std::string > > GetEnabledLayers() const
Definition: capabilities_vk.cc:65
impeller::OptionalDeviceExtensionVK::kEXTPipelineCreationFeedback
@ kEXTPipelineCreationFeedback
impeller::CapabilitiesVK::SupportsTextureToTextureBlits
bool SupportsTextureToTextureBlits() const override
Whether the context backend supports blitting from one texture region to another texture region (via ...
Definition: capabilities_vk.cc:516
validation.h
impeller::HasRequiredQueues
static bool HasRequiredQueues(const vk::PhysicalDevice &physical_device)
Definition: capabilities_vk.cc:316
impeller::CapabilitiesVK::GetDefaultGlyphAtlasFormat
PixelFormat GetDefaultGlyphAtlasFormat() const override
Returns the default pixel format for the alpha bitmap glyph atlas.
Definition: capabilities_vk.cc:571
impeller::CapabilitiesVK::SupportsComputeSubgroups
bool SupportsComputeSubgroups() const override
Whether the context backend supports configuring ComputePass command subgroups.
Definition: capabilities_vk.cc:532
impeller::GetExtensionName
static const char * GetExtensionName(RequiredCommonDeviceExtensionVK ext)
Definition: capabilities_vk.cc:155
impeller::CapabilitiesVK::SupportsReadFromResolve
bool SupportsReadFromResolve() const override
Whether the context backend supports binding the current RenderPass attachments. This is supported if...
Definition: capabilities_vk.cc:538
vk.h
impeller::CapabilitiesVK::GetEnabledDeviceFeatures
std::optional< PhysicalDeviceFeatures > GetEnabledDeviceFeatures(const vk::PhysicalDevice &physical_device) const
Definition: capabilities_vk.cc:338
impeller::RequiredCommonDeviceExtensionVK
RequiredCommonDeviceExtensionVK
A device extension available on all platforms. Without the presence of these extensions,...
Definition: capabilities_vk.h:26
impeller::PixelFormat::kD32FloatS8UInt
@ kD32FloatS8UInt
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:100
impeller::PhysicalDeviceSupportsRequiredFormats
static bool PhysicalDeviceSupportsRequiredFormats(const vk::PhysicalDevice &device)
Definition: capabilities_vk.cc:297
impeller::CapabilitiesVK::SetPhysicalDevice
bool SetPhysicalDevice(const vk::PhysicalDevice &physical_device)
Definition: capabilities_vk.cc:414
capabilities_vk.h
impeller::CapabilitiesVK::~CapabilitiesVK
~CapabilitiesVK()
impeller::CapabilitiesVK::HasExtension
bool HasExtension(RequiredCommonDeviceExtensionVK ext) const
Definition: capabilities_vk.cc:575
impeller::RequiredAndroidDeviceExtensionVK::kKHRExternalMemory
@ kKHRExternalMemory
impeller::CapabilitiesVK::GetDefaultColorFormat
PixelFormat GetDefaultColorFormat() const override
Returns a supported PixelFormat for textures that store 4-channel colors (red/green/blue/alpha).
Definition: capabilities_vk.cc:552
impeller::IterateExtensions
static bool IterateExtensions(const std::function< bool(T)> &it)
Definition: capabilities_vk.cc:197
impeller::RequiredAndroidDeviceExtensionVK::kKHRDedicatedAllocation
@ kKHRDedicatedAllocation
impeller::RequiredAndroidDeviceExtensionVK::kANDROIDExternalMemoryAndroidHardwareBuffer
@ kANDROIDExternalMemoryAndroidHardwareBuffer
impeller::GetSupportedDeviceExtensions
static std::optional< std::set< std::string > > GetSupportedDeviceExtensions(const vk::PhysicalDevice &physical_device)
Definition: capabilities_vk.cc:209
impeller::RequiredAndroidDeviceExtensionVK::kKHRSamplerYcbcrConversion
@ kKHRSamplerYcbcrConversion
impeller::RequiredCommonDeviceExtensionVK::kKHRSwapchain
@ kKHRSwapchain
impeller::CapabilitiesVK::CapabilitiesVK
CapabilitiesVK(bool enable_validations)
Definition: capabilities_vk.cc:17
impeller::PixelFormat::kD24UnormS8Uint
@ kD24UnormS8Uint
impeller::CapabilitiesVK::GetDefaultDepthStencilFormat
PixelFormat GetDefaultDepthStencilFormat() const override
Returns a supported PixelFormat for textures that store both a stencil and depth component....
Definition: capabilities_vk.cc:562
impeller::CapabilitiesVK::SupportsBufferToTextureBlits
bool SupportsBufferToTextureBlits() const override
Whether the context backend supports blitting from a given DeviceBuffer view to a texture region (via...
Definition: capabilities_vk.cc:511
impeller::CapabilitiesVK::SupportsCompute
bool SupportsCompute() const override
Whether the context backend supports ComputePass.
Definition: capabilities_vk.cc:526
impeller::OptionalDeviceExtensionVK::kVKKHRPortabilitySubset
@ kVKKHRPortabilitySubset
impeller::PixelFormat::kUnknown
@ kUnknown
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:73
impeller::CapabilitiesVK::PhysicalDeviceFeatures
vk::StructureChain< vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR > PhysicalDeviceFeatures
Definition: capabilities_vk.h:139
impeller::HasSuitableColorFormat
static bool HasSuitableColorFormat(const vk::PhysicalDevice &device, vk::Format format)
Definition: capabilities_vk.cc:282
impeller::CapabilitiesVK::SupportsDeviceTransientTextures
bool SupportsDeviceTransientTextures() const override
Whether the context backend supports allocating StorageMode::kDeviceTransient (aka "memoryless") text...
Definition: capabilities_vk.cc:547
impeller::CapabilitiesVK::GetPhysicalDeviceProperties
const vk::PhysicalDeviceProperties & GetPhysicalDeviceProperties() const
Definition: capabilities_vk.cc:567
impeller::IsExtensionInList
static bool IsExtensionInList(const std::vector< std::string > &list, ExtensionEnum ext)
Definition: capabilities_vk.cc:331
impeller::RequiredAndroidDeviceExtensionVK
RequiredAndroidDeviceExtensionVK
A device extension available on all Android platforms. Without the presence of these extensions on An...
Definition: capabilities_vk.h:45
impeller::CapabilitiesVK::SupportsSSBO
bool SupportsSSBO() const override
Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines.
Definition: capabilities_vk.cc:506
impeller::CapabilitiesVK::AreValidationsEnabled
bool AreValidationsEnabled() const
Definition: capabilities_vk.cc:61
impeller::RequiredAndroidDeviceExtensionVK::kEXTQueueFamilyForeign
@ kEXTQueueFamilyForeign
impeller::CapabilitiesVK::GetEnabledDeviceExtensions
std::optional< std::vector< std::string > > GetEnabledDeviceExtensions(const vk::PhysicalDevice &physical_device) const
Definition: capabilities_vk.cc:225
impeller::CapabilitiesVK::SupportsImplicitResolvingMSAA
bool SupportsImplicitResolvingMSAA() const override
Whether the context backend supports multisampled rendering to the on-screen surface without requirin...
Definition: capabilities_vk.cc:501
impeller
Definition: aiks_blur_unittests.cc:20