Skip to content

Commit ffe5947

Browse files
committed
[Impeller] Enable ETC2/ASTC LDR/BC texture compression features at Vulkan device creation
The read-back in SetPhysicalDevice checks enabled_features for textureCompressionETC2, textureCompressionASTC_LDR, and textureCompressionBC, but GetEnabledDeviceFeatures never requested these core Vulkan 1.0 features at device creation. As a result, flutter_gpu always reports no compressed texture support on Android Vulkan devices, regardless of hardware capability. This was a three-line omission in PR flutter#187077 which wired the read-back on all three backends but only enabled the features on GLES and Metal. ASTC HDR was already correctly enabled via VK_EXT_texture_compression_astc_hdr. Mirror the existing samplerAnisotropy pattern: request each feature if supported, so the read-back reflects real hardware support. Fixes flutter#189107
1 parent d776076 commit ffe5947

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎engine/src/flutter/impeller/renderer/backend/vulkan/capabilities_vk.cc‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,15 @@ CapabilitiesVK::GetEnabledDeviceFeatures(
456456
// `max_anisotropy` greater than 1 may only be created when this feature
457457
// is enabled.
458458
required.samplerAnisotropy = supported.samplerAnisotropy;
459+
460+
// Enable block-compressed texture format support when available.
461+
// These core Vulkan 1.0 features must be explicitly requested at device
462+
// creation; otherwise the capability read-back in SetPhysicalDevice
463+
// (which reads from enabled_features) will always report false.
464+
// See: https://github.com/flutter/flutter/issues/189107
465+
required.textureCompressionETC2 = supported.textureCompressionETC2;
466+
required.textureCompressionASTC_LDR = supported.textureCompressionASTC_LDR;
467+
required.textureCompressionBC = supported.textureCompressionBC;
459468
}
460469
// VK_KHR_sampler_ycbcr_conversion features.
461470
if (IsExtensionInList(

0 commit comments

Comments
 (0)