mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2024-12-27 18:16:23 +00:00
vk_instance: Add additional fallback for missing D16UnormS8Uint. (#1810)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
This commit is contained in:
parent
87773a417b
commit
ccfb1bbfa8
|
@ -583,23 +583,20 @@ bool Instance::IsFormatSupported(const vk::Format format,
|
|||
return (GetFormatFeatureFlags(format) & flags) == flags;
|
||||
}
|
||||
|
||||
static vk::Format GetAlternativeFormat(const vk::Format format) {
|
||||
switch (format) {
|
||||
case vk::Format::eD16UnormS8Uint:
|
||||
return vk::Format::eD24UnormS8Uint;
|
||||
default:
|
||||
return format;
|
||||
}
|
||||
}
|
||||
|
||||
vk::Format Instance::GetSupportedFormat(const vk::Format format,
|
||||
const vk::FormatFeatureFlags2 flags) const {
|
||||
if (IsFormatSupported(format, flags)) [[likely]] {
|
||||
return format;
|
||||
if (!IsFormatSupported(format, flags)) [[unlikely]] {
|
||||
switch (format) {
|
||||
case vk::Format::eD16UnormS8Uint:
|
||||
if (IsFormatSupported(vk::Format::eD24UnormS8Uint, flags)) {
|
||||
return vk::Format::eD24UnormS8Uint;
|
||||
}
|
||||
if (IsFormatSupported(vk::Format::eD32SfloatS8Uint, flags)) {
|
||||
return vk::Format::eD32SfloatS8Uint;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
const vk::Format alternative = GetAlternativeFormat(format);
|
||||
if (IsFormatSupported(alternative, flags)) [[likely]] {
|
||||
return alternative;
|
||||
}
|
||||
return format;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue