Reverse depth & 32F buffer format

-Adds reversed depth projection model, dramatically increasing depth buffer effective resolution.
-Adds 32F depth 8U stencil format GFXFormatD32FS8X24 (following DX naming conventions). Note this is a 64-bit format, and likely not suitable for mobile platforms. Revert to GFXFormatD24S8 in renderManager.tscript for mobile & "ancient" platforms.
-Corrects alignment of texture type details array.
This commit is contained in:
AtomicWalrus 2023-04-14 20:13:28 -06:00
parent c08fa359d2
commit 75625dc679
37 changed files with 91 additions and 57 deletions

View file

@ -73,6 +73,7 @@ void GFXD3D11EnumTranslate::init()
GFXD3D11TextureFormat[GFXFormatD24S8] = DXGI_FORMAT_D24_UNORM_S8_UINT;
GFXD3D11TextureFormat[GFXFormatD24FS8] = DXGI_FORMAT_UNKNOWN;
GFXD3D11TextureFormat[GFXFormatD16] = DXGI_FORMAT_D16_UNORM;
GFXD3D11TextureFormat[GFXFormatD32FS8X24] = DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
//sRGB
GFXD3D11TextureFormat[GFXFormatR8G8B8A8_SRGB] = DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
GFXD3D11TextureFormat[GFXFormatR8G8B8_SRGB] = DXGI_FORMAT_B8G8R8X8_UNORM_SRGB;

View file

@ -173,7 +173,12 @@ void GFXD3D11TextureManager::_innerCreateTexture( GFXD3D11TextureObject *retTex,
desc.CPUAccessFlags = cpuFlags;
//depth stencil must be a typeless format if it is bound on render target and shader resource simultaneously
// we'll send the real format for the creation of the views
if (format == GFXFormatD24S8)
{
desc.Format = DXGI_FORMAT_R24G8_TYPELESS;
}
else // Note: right now only GFXFormatD24S8 and GFXFormatD32FS8U24 are supported. Additional cases required to support 16-bit depth for mobile.
desc.Format = DXGI_FORMAT_R32G8X24_TYPELESS;
desc.MipLevels = numMipLevels;
desc.SampleDesc.Count = antialiasLevel;
desc.SampleDesc.Quality = numQualityLevels;