mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-09 20:23:14 +00:00
liverpool_to_vk: Add R32Uint depth promote. (#2145)
This commit is contained in:
parent
c10f9b8269
commit
53d0a309cc
2 changed files with 30 additions and 4 deletions
|
@ -71,8 +71,35 @@ vk::ClearValue ColorBufferClearValue(const AmdGpu::Liverpool::ColorBuffer& color
|
|||
|
||||
vk::SampleCountFlagBits NumSamples(u32 num_samples, vk::SampleCountFlags supported_flags);
|
||||
|
||||
static inline bool IsFormatDepthCompatible(vk::Format fmt) {
|
||||
switch (fmt) {
|
||||
// 32-bit float compatible
|
||||
case vk::Format::eD32Sfloat:
|
||||
case vk::Format::eR32Sfloat:
|
||||
case vk::Format::eR32Uint:
|
||||
// 16-bit unorm compatible
|
||||
case vk::Format::eD16Unorm:
|
||||
case vk::Format::eR16Unorm:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool IsFormatStencilCompatible(vk::Format fmt) {
|
||||
switch (fmt) {
|
||||
// 8-bit uint compatible
|
||||
case vk::Format::eS8Uint:
|
||||
case vk::Format::eR8Uint:
|
||||
case vk::Format::eR8Unorm:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static inline vk::Format PromoteFormatToDepth(vk::Format fmt) {
|
||||
if (fmt == vk::Format::eR32Sfloat) {
|
||||
if (fmt == vk::Format::eR32Sfloat || fmt == vk::Format::eR32Uint) {
|
||||
return vk::Format::eD32Sfloat;
|
||||
} else if (fmt == vk::Format::eR16Unorm) {
|
||||
return vk::Format::eD16Unorm;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue