| Flutter Impeller |

Public Types | Public Member Functions | List of all members
impeller::CapabilitiesVK Class Referencefinal

The Vulkan layers and extensions wrangler. More...

`#include <capabilities_vk.h>`

Inheritance diagram for impeller::CapabilitiesVK:

## Public Types
using | PhysicalDeviceFeatures = vk::StructureChain< vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR >

## Public Member Functions
| CapabilitiesVK (bool enable_validations)
| ~CapabilitiesVK ()
bool | IsValid () const
bool | AreValidationsEnabled () const
bool | HasExtension (RequiredCommonDeviceExtensionVK ext) const
bool | HasExtension (RequiredAndroidDeviceExtensionVK ext) const
bool | HasExtension (OptionalDeviceExtensionVK ext) const
std::optional< std::vector< std::string > > | GetEnabledLayers () const
std::optional< std::vector< std::string > > | GetEnabledInstanceExtensions () const
std::optional< std::vector< std::string > > | GetEnabledDeviceExtensions (const vk::PhysicalDevice &physical_device) const
std::optional< PhysicalDeviceFeatures > | GetEnabledDeviceFeatures (const vk::PhysicalDevice &physical_device) const
bool | SetPhysicalDevice (const vk::PhysicalDevice &physical_device)
const vk::PhysicalDeviceProperties & | GetPhysicalDeviceProperties () const
void | SetOffscreenFormat (PixelFormat pixel_format) const
bool | SupportsOffscreenMSAA () const override
| Whether the context backend supports attaching offscreen MSAA color/stencil textures. More...
bool | SupportsImplicitResolvingMSAA () const override
| Whether the context backend supports multisampled rendering to the on-screen surface without requiring an explicit resolve of the MSAA color attachment. More...
bool | SupportsSSBO () const override
| Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines. More...
bool | SupportsBufferToTextureBlits () const override
| Whether the context backend supports blitting from a given `DeviceBuffer` view to a texture region (via the relevant `BlitPass::AddCopy` overloads). More...
bool | SupportsTextureToTextureBlits () const override
| Whether the context backend supports blitting from one texture region to another texture region (via the relevant `BlitPass::AddCopy` overloads). More...
bool | SupportsFramebufferFetch () const override
| Whether the context backend is able to support pipelines with shaders that read from the framebuffer (i.e. pixels that have been written by previous draw calls in the current render pass). More...
bool | SupportsCompute () const override
| Whether the context backend supports `ComputePass`. More...
bool | SupportsComputeSubgroups () const override
| Whether the context backend supports configuring `ComputePass` command subgroups. More...
bool | SupportsReadFromResolve () const override
| Whether the context backend supports binding the current `RenderPass` attachments. This is supported if the backend can guarantee that attachment textures will not be mutated until the render pass has fully completed. More...
bool | SupportsDecalSamplerAddressMode () const override
| Whether the context backend supports `SamplerAddressMode::Decal`. More...
bool | SupportsDeviceTransientTextures () const override
| Whether the context backend supports allocating `StorageMode::kDeviceTransient` (aka "memoryless") textures, which are temporary textures kept in tile memory for the duration of the `RenderPass` it's attached to. More...
PixelFormat | GetDefaultColorFormat () const override
| Returns a supported `PixelFormat` for textures that store 4-channel colors (red/green/blue/alpha). More...
PixelFormat | GetDefaultStencilFormat () const override
| Returns a supported `PixelFormat` for textures that store stencil information. May include a depth channel if a stencil-only format is not available. More...
PixelFormat | GetDefaultDepthStencilFormat () const override
| Returns a supported `PixelFormat` for textures that store both a stencil and depth component. This will never return a depth-only or stencil-only texture. Returns `PixelFormat::kUnknown` if no suitable depth+stencil format was found. More...
PixelFormat | GetDefaultGlyphAtlasFormat () const override
| Returns the default pixel format for the alpha bitmap glyph atlas. More...
Public Member Functions inherited from impeller::Capabilities
virtual | ~Capabilities ()

## Additional Inherited Members
Static Public Member Functions inherited from impeller::BackendCast< CapabilitiesVK, Capabilities >
static CapabilitiesVK & | Cast (Capabilities &base)
static const CapabilitiesVK & | Cast (const Capabilities &base)
static CapabilitiesVK * | Cast (Capabilities *base)
static const CapabilitiesVK * | Cast (const Capabilities *base)
Protected Member Functions inherited from impeller::Capabilities
| Capabilities ()
| Capabilities (const Capabilities &)=delete
Capabilities & | operator= (const Capabilities &)=delete

## Detailed Description

The Vulkan layers and extensions wrangler.

Definition at line 113 of file capabilities_vk.h.

## Member Typedef Documentation

## ◆ PhysicalDeviceFeatures

using impeller::CapabilitiesVK::PhysicalDeviceFeatures = vk::StructureChain<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR>

Definition at line 139 of file capabilities_vk.h.

## Constructor & Destructor Documentation

## ◆ CapabilitiesVK()

impeller::CapabilitiesVK::CapabilitiesVK | ( | bool | enable_validations | ) |
| explicit

Definition at line 17 of file capabilities_vk.cc.

17 {
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 }

References impeller::kInstanceLayer.

## ◆ ~CapabilitiesVK()

impeller::CapabilitiesVK::~CapabilitiesVK | ( |  | ) |
| default

## Member Function Documentation

## ◆ AreValidationsEnabled()

bool impeller::CapabilitiesVK::AreValidationsEnabled | ( |  | ) | const

Definition at line 61 of file capabilities_vk.cc.

61 {
62 return validations_enabled_;
63 }

Referenced by impeller::DebugReportVK::DebugReportVK(), and impeller::testing::TEST().

## ◆ GetDefaultColorFormat()

PixelFormat impeller::CapabilitiesVK::GetDefaultColorFormat | ( |  | ) | const
| override virtual

Returns a supported `PixelFormat` for textures that store 4-channel colors (red/green/blue/alpha).

Implements impeller::Capabilities.

Definition at line 552 of file capabilities_vk.cc.

552 {
553 return default_color_format_;
554 }

## ◆ GetDefaultDepthStencilFormat()

PixelFormat impeller::CapabilitiesVK::GetDefaultDepthStencilFormat | ( |  | ) | const
| override virtual

Returns a supported `PixelFormat` for textures that store both a stencil and depth component. This will never return a depth-only or stencil-only texture. Returns `PixelFormat::kUnknown` if no suitable depth+stencil format was found.

Implements impeller::Capabilities.

Definition at line 562 of file capabilities_vk.cc.

562 {
563 return default_depth_stencil_format_;
564 }

Referenced by impeller::testing::TEST().

## ◆ GetDefaultGlyphAtlasFormat()

PixelFormat impeller::CapabilitiesVK::GetDefaultGlyphAtlasFormat | ( |  | ) | const
| override virtual

Returns the default pixel format for the alpha bitmap glyph atlas.

       Some backends may use Red channel while others use grey. This
       should not have any impact

Implements impeller::Capabilities.

Definition at line 571 of file capabilities_vk.cc.

571 {
572 return PixelFormat::kR8UNormInt;
573 }

References impeller::kR8UNormInt.

## ◆ GetDefaultStencilFormat()

PixelFormat impeller::CapabilitiesVK::GetDefaultStencilFormat | ( |  | ) | const
| override virtual

Returns a supported `PixelFormat` for textures that store stencil information. May include a depth channel if a stencil-only format is not available.

Implements impeller::Capabilities.

Definition at line 557 of file capabilities_vk.cc.

557 {
558 return default_stencil_format_;
559 }

Referenced by impeller::testing::TEST().

## ◆ GetEnabledDeviceExtensions()

std::optional< std::vector< std::string > > impeller::CapabilitiesVK::GetEnabledDeviceExtensions | ( | const vk::PhysicalDevice & | physical_device | ) | const

Definition at line 225 of file capabilities_vk.cc.

226 {
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 }

References impeller::GetExtensionName(), impeller::GetSupportedDeviceExtensions(), and VALIDATION_LOG.

Referenced by GetEnabledDeviceFeatures().

## ◆ GetEnabledDeviceFeatures()

std::optional< CapabilitiesVK::PhysicalDeviceFeatures > impeller::CapabilitiesVK::GetEnabledDeviceFeatures | ( | const vk::PhysicalDevice & | physical_device | ) | const

Definition at line 338 of file capabilities_vk.cc.

339 {
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 }

References GetEnabledDeviceExtensions(), impeller::HasRequiredProperties(), impeller::HasRequiredQueues(), impeller::IsExtensionInList(), impeller::kKHRSamplerYcbcrConversion, impeller::PhysicalDeviceSupportsRequiredFormats(), and VALIDATION_LOG.

Referenced by impeller::PickPhysicalDevice().

## ◆ GetEnabledInstanceExtensions()

std::optional< std::vector< std::string > > impeller::CapabilitiesVK::GetEnabledInstanceExtensions | ( |  | ) | const

Definition at line 78 of file capabilities_vk.cc.

78 {
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 }

References HasExtension(), and VALIDATION_LOG.

## ◆ GetEnabledLayers()

std::optional< std::vector< std::string > > impeller::CapabilitiesVK::GetEnabledLayers | ( |  | ) | const

Definition at line 65 of file capabilities_vk.cc.

66 {
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 }

## ◆ GetPhysicalDeviceProperties()

const vk::PhysicalDeviceProperties & impeller::CapabilitiesVK::GetPhysicalDeviceProperties | ( |  | ) | const

Definition at line 567 of file capabilities_vk.cc.

567 {
568 return device_properties_;
569 }

## ◆ HasExtension() [1/3]

bool impeller::CapabilitiesVK::HasExtension | ( | OptionalDeviceExtensionVK | ext | ) | const

Definition at line 585 of file capabilities_vk.cc.

585 {
586 return optional_device_extensions_.find(ext) !=
587 optional_device_extensions_.end();
588 }

## ◆ HasExtension() [2/3]

bool impeller::CapabilitiesVK::HasExtension | ( | RequiredAndroidDeviceExtensionVK | ext | ) | const

Definition at line 580 of file capabilities_vk.cc.

580 {
581 return required_android_device_extensions_.find(ext) !=
582 required_android_device_extensions_.end();
583 }

## ◆ HasExtension() [3/3]

bool impeller::CapabilitiesVK::HasExtension | ( | RequiredCommonDeviceExtensionVK | ext | ) | const

Definition at line 575 of file capabilities_vk.cc.

575 {
576 return required_common_device_extensions_.find(ext) !=
577 required_common_device_extensions_.end();
578 }

Referenced by GetEnabledInstanceExtensions().

## ◆ IsValid()

bool impeller::CapabilitiesVK::IsValid | ( |  | ) | const

Definition at line 57 of file capabilities_vk.cc.

57 {
58 return is_valid_;
59 }

## ◆ SetOffscreenFormat()

void impeller::CapabilitiesVK::SetOffscreenFormat | ( | PixelFormat | pixel_format | ) | const

Definition at line 410 of file capabilities_vk.cc.

410 {
411 default_color_format_ = pixel_format;
412 }

Referenced by impeller::ContextVK::SetOffscreenFormat().

## ◆ SetPhysicalDevice()

bool impeller::CapabilitiesVK::SetPhysicalDevice | ( | const vk::PhysicalDevice & | physical_device | ) |

Definition at line 414 of file capabilities_vk.cc.

414 {
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 }

References impeller::GetExtensionName(), impeller::GetSupportedDeviceExtensions(), impeller::HasSuitableDepthStencilFormat(), impeller::kD24UnormS8Uint, impeller::kD32FloatS8UInt, impeller::kS8UInt, and impeller::kUnknown.

## ◆ SupportsBufferToTextureBlits()

bool impeller::CapabilitiesVK::SupportsBufferToTextureBlits | ( |  | ) | const
| override virtual

Whether the context backend supports blitting from a given `DeviceBuffer` view to a texture region (via the relevant `BlitPass::AddCopy` overloads).

Implements impeller::Capabilities.

Definition at line 511 of file capabilities_vk.cc.

511 {
512 return true;
513 }

## ◆ SupportsCompute()

bool impeller::CapabilitiesVK::SupportsCompute | ( |  | ) | const
| override virtual

Whether the context backend supports `ComputePass`.

Implements impeller::Capabilities.

Definition at line 526 of file capabilities_vk.cc.

526 {
527 // Vulkan 1.1 requires support for compute.
528 return true;
529 }

## ◆ SupportsComputeSubgroups()

bool impeller::CapabilitiesVK::SupportsComputeSubgroups | ( |  | ) | const
| override virtual

Whether the context backend supports configuring `ComputePass` command subgroups.

Implements impeller::Capabilities.

Definition at line 532 of file capabilities_vk.cc.

532 {
533 // Set by |SetPhysicalDevice|.
534 return supports_compute_subgroups_;
535 }

## ◆ SupportsDecalSamplerAddressMode()

bool impeller::CapabilitiesVK::SupportsDecalSamplerAddressMode | ( |  | ) | const
| override virtual

Whether the context backend supports `SamplerAddressMode::Decal`.

Implements impeller::Capabilities.

Definition at line 542 of file capabilities_vk.cc.

542 {
543 return true;
544 }

## ◆ SupportsDeviceTransientTextures()

bool impeller::CapabilitiesVK::SupportsDeviceTransientTextures | ( |  | ) | const
| override virtual

Whether the context backend supports allocating `StorageMode::kDeviceTransient` (aka "memoryless") textures, which are temporary textures kept in tile memory for the duration of the `RenderPass` it's attached to.

This feature is especially useful for MSAA and stencils.

Implements impeller::Capabilities.

Definition at line 547 of file capabilities_vk.cc.

547 {
548 return supports_device_transient_textures_;
549 }

## ◆ SupportsFramebufferFetch()

bool impeller::CapabilitiesVK::SupportsFramebufferFetch | ( |  | ) | const
| override virtual

Whether the context backend is able to support pipelines with shaders that read from the framebuffer (i.e. pixels that have been written by previous draw calls in the current render pass).

Example of reading from the first color attachment in a GLSL shader: ``` uniform subpassInput subpass_input;

out vec4 frag_color;

void main() { vec4 color = subpassLoad(subpass_input); // Invert the colors drawn to the framebuffer. frag_color = vec4(vec3(1) - color.rgb, color.a); } ```

Implements impeller::Capabilities.

Definition at line 521 of file capabilities_vk.cc.

521 {
522 return true;
523 }

## ◆ SupportsImplicitResolvingMSAA()

bool impeller::CapabilitiesVK::SupportsImplicitResolvingMSAA | ( |  | ) | const
| override virtual

Whether the context backend supports multisampled rendering to the on-screen surface without requiring an explicit resolve of the MSAA color attachment.

Implements impeller::Capabilities.

Definition at line 501 of file capabilities_vk.cc.

501 {
502 return false;
503 }

## ◆ SupportsOffscreenMSAA()

bool impeller::CapabilitiesVK::SupportsOffscreenMSAA | ( |  | ) | const
| override virtual

Whether the context backend supports attaching offscreen MSAA color/stencil textures.

Implements impeller::Capabilities.

Definition at line 496 of file capabilities_vk.cc.

496 {
497 return true;
498 }

## ◆ SupportsReadFromResolve()

bool impeller::CapabilitiesVK::SupportsReadFromResolve | ( |  | ) | const
| override virtual

Whether the context backend supports binding the current `RenderPass` attachments. This is supported if the backend can guarantee that attachment textures will not be mutated until the render pass has fully completed.

This is possible because many mobile graphics cards track `RenderPass` attachment state in intermediary tile memory prior to Storing the pass in the heap allocated attachments on DRAM. Metal's hazard tracking and Vulkan's barriers are granular enough to allow for safely accessing attachment textures prior to storage in the same `RenderPass`.

Implements impeller::Capabilities.

Definition at line 538 of file capabilities_vk.cc.

538 {
539 return false;
540 }

## ◆ SupportsSSBO()

bool impeller::CapabilitiesVK::SupportsSSBO | ( |  | ) | const
| override virtual

Whether the context backend supports binding Shader Storage Buffer Objects (SSBOs) to pipelines.

Implements impeller::Capabilities.

Definition at line 506 of file capabilities_vk.cc.

506 {
507 return true;
508 }

## ◆ SupportsTextureToTextureBlits()

bool impeller::CapabilitiesVK::SupportsTextureToTextureBlits | ( |  | ) | const
| override virtual

Whether the context backend supports blitting from one texture region to another texture region (via the relevant `BlitPass::AddCopy` overloads).

Implements impeller::Capabilities.

Definition at line 516 of file capabilities_vk.cc.

516 {
517 return true;
518 }

The documentation for this class was generated from the following files:

- impeller/renderer/backend/vulkan/capabilities_vk.h
- impeller/renderer/backend/vulkan/capabilities_vk.cc

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::kInstanceLayer
static constexpr const char * kInstanceLayer
Definition: capabilities_vk.cc:15
impeller::PixelFormat::kR8UNormInt
@ kR8UNormInt
impeller::HasSuitableDepthStencilFormat
static bool HasSuitableDepthStencilFormat(const vk::PhysicalDevice &device, vk::Format format)
Definition: capabilities_vk.cc:290
impeller::HasRequiredQueues
static bool HasRequiredQueues(const vk::PhysicalDevice &physical_device)
Definition: capabilities_vk.cc:316
impeller::GetExtensionName
static const char * GetExtensionName(RequiredCommonDeviceExtensionVK ext)
Definition: capabilities_vk.cc:155
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::PhysicalDeviceSupportsRequiredFormats
static bool PhysicalDeviceSupportsRequiredFormats(const vk::PhysicalDevice &device)
Definition: capabilities_vk.cc:297
impeller::CapabilitiesVK::HasExtension
bool HasExtension(RequiredCommonDeviceExtensionVK ext) const
Definition: capabilities_vk.cc:575
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::PixelFormat::kD24UnormS8Uint
@ kD24UnormS8Uint
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::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::GetEnabledDeviceExtensions
std::optional< std::vector< std::string > > GetEnabledDeviceExtensions(const vk::PhysicalDevice &physical_device) const
Definition: capabilities_vk.cc:225