mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-06 17:32:40 +00:00
renderer_vulkan: Don't crash if Depth Format is not recognized
This commit is contained in:
parent
345d55669e
commit
7110e2c1de
@ -71,13 +71,17 @@ vk::ClearValue ColorBufferClearValue(const AmdGpu::Liverpool::ColorBuffer& color
|
|||||||
|
|
||||||
vk::SampleCountFlagBits NumSamples(u32 num_samples, vk::SampleCountFlags supported_flags);
|
vk::SampleCountFlagBits NumSamples(u32 num_samples, vk::SampleCountFlags supported_flags);
|
||||||
|
|
||||||
static inline vk::Format PromoteFormatToDepth(vk::Format fmt) {
|
static vk::Format PromoteFormatToDepth(vk::Format fmt) {
|
||||||
if (fmt == vk::Format::eR32Sfloat) {
|
switch (fmt) {
|
||||||
|
case vk::Format::eR32Sfloat:
|
||||||
return vk::Format::eD32Sfloat;
|
return vk::Format::eD32Sfloat;
|
||||||
} else if (fmt == vk::Format::eR16Unorm) {
|
case vk::Format::eR16Unorm:
|
||||||
return vk::Format::eD16Unorm;
|
return vk::Format::eD16Unorm;
|
||||||
|
default:
|
||||||
|
LOG_ERROR(Render_Vulkan, "Unexpected Depth Format {}", vk::to_string(fmt));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
UNREACHABLE();
|
return fmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Vulkan::LiverpoolToVK
|
} // namespace Vulkan::LiverpoolToVK
|
||||||
|
Loading…
Reference in New Issue
Block a user