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

@ -132,6 +132,7 @@ void GFXGLEnumTranslate::init()
GFXGLTextureInternalFormat[GFXFormatD32] = GL_DEPTH_COMPONENT32;
GFXGLTextureInternalFormat[GFXFormatD24X8] = GL_DEPTH24_STENCIL8;
GFXGLTextureInternalFormat[GFXFormatD24S8] = GL_DEPTH24_STENCIL8;
GFXGLTextureInternalFormat[GFXFormatD32FS8X24] = GL_DEPTH32F_STENCIL8;
GFXGLTextureInternalFormat[GFXFormatR16G16B16A16] = GL_RGBA16;
GFXGLTextureInternalFormat[GFXFormatBC1] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
GFXGLTextureInternalFormat[GFXFormatBC2] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
@ -161,6 +162,7 @@ void GFXGLEnumTranslate::init()
GFXGLTextureFormat[GFXFormatD32] = GL_DEPTH_COMPONENT;
GFXGLTextureFormat[GFXFormatD24X8] = GL_DEPTH_STENCIL;
GFXGLTextureFormat[GFXFormatD24S8] = GL_DEPTH_STENCIL;
GFXGLTextureFormat[GFXFormatD32FS8X24] = GL_DEPTH_STENCIL;
GFXGLTextureFormat[GFXFormatR16G16B16A16] = GL_RGBA;
GFXGLTextureFormat[GFXFormatBC1] = GL_RGBA;
GFXGLTextureFormat[GFXFormatBC2] = GL_RGBA;
@ -190,6 +192,7 @@ void GFXGLEnumTranslate::init()
GFXGLTextureType[GFXFormatD32] = GL_UNSIGNED_INT;
GFXGLTextureType[GFXFormatD24X8] = GL_UNSIGNED_INT_24_8;
GFXGLTextureType[GFXFormatD24S8] = GL_UNSIGNED_INT_24_8;
GFXGLTextureType[GFXFormatD32FS8X24] = GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
GFXGLTextureType[GFXFormatR16G16B16A16] = GL_UNSIGNED_SHORT;
GFXGLTextureType[GFXFormatBC1] = GL_UNSIGNED_BYTE;
GFXGLTextureType[GFXFormatBC2] = GL_UNSIGNED_BYTE;