[Impeller] prefer 24 bit depth buffer format on vulkan backend. (#166854)

We really only need 24 bits of depth. 32 can be used as a fallback
instead of the other way around.
This commit is contained in:
Jonah Williams 2025-04-09 15:42:50 -07:00 committed by GitHub
parent f6c2b1dd78
commit cbc8ee416c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -520,11 +520,11 @@ bool CapabilitiesVK::SetPhysicalDevice(
default_color_format_ = PixelFormat::kUnknown;
}
if (HasSuitableDepthStencilFormat(device, vk::Format::eD32SfloatS8Uint)) {
default_depth_stencil_format_ = PixelFormat::kD32FloatS8UInt;
} else if (HasSuitableDepthStencilFormat(device,
vk::Format::eD24UnormS8Uint)) {
if (HasSuitableDepthStencilFormat(device, vk::Format::eD24UnormS8Uint)) {
default_depth_stencil_format_ = PixelFormat::kD24UnormS8Uint;
} else if (HasSuitableDepthStencilFormat(device,
vk::Format::eD32SfloatS8Uint)) {
default_depth_stencil_format_ = PixelFormat::kD32FloatS8UInt;
} else {
default_depth_stencil_format_ = PixelFormat::kUnknown;
}