mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-05 07:39:17 +00:00
FramebufferManager: Correctly handle read back D24S8 textures
Needed for the Adreno/Vulkan workaround, and if we ever switch to a D24 texture for the depth buffer w/ unrestricted depth range.
This commit is contained in:
parent
2698e311aa
commit
06daf58032
4 changed files with 54 additions and 39 deletions
|
@ -88,20 +88,19 @@ bool AbstractTexture::IsStencilFormat(AbstractTextureFormat format)
|
|||
return format == AbstractTextureFormat::D24_S8 || format == AbstractTextureFormat::D32F_S8;
|
||||
}
|
||||
|
||||
AbstractTextureFormat AbstractTexture::GetColorFormatForDepthFormat(AbstractTextureFormat format)
|
||||
bool AbstractTexture::IsCompatibleDepthAndColorFormats(AbstractTextureFormat depth_format,
|
||||
AbstractTextureFormat color_format)
|
||||
{
|
||||
switch (format)
|
||||
switch (depth_format)
|
||||
{
|
||||
case AbstractTextureFormat::D16:
|
||||
return AbstractTextureFormat::R16;
|
||||
return color_format == AbstractTextureFormat::R16;
|
||||
|
||||
case AbstractTextureFormat::D24_S8: // TODO: Incorrect
|
||||
case AbstractTextureFormat::D32F:
|
||||
case AbstractTextureFormat::D32F_S8:
|
||||
return AbstractTextureFormat::R32F;
|
||||
return color_format == AbstractTextureFormat::R32F;
|
||||
|
||||
default:
|
||||
return format;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue