mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Fix depth texture sizes.
Fixed depth compare when internal resolution set by native resolution factor is greater then screen/window resolution.
This commit is contained in:
parent
f9a8ff7087
commit
67e75ad997
|
@ -139,25 +139,16 @@ void DepthBuffer::_initDepthBufferTexture(FrameBuffer * _pBuffer, CachedTexture
|
||||||
if (_multisample) {
|
if (_multisample) {
|
||||||
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _pTexture->glName);
|
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _pTexture->glName);
|
||||||
#if defined(GLES3_1)
|
#if defined(GLES3_1)
|
||||||
if (_pBuffer != NULL)
|
glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, _pTexture->realWidth, _pTexture->realHeight, false);
|
||||||
glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, _pBuffer->m_pTexture->realWidth, _pBuffer->m_pTexture->realHeight, false);
|
|
||||||
else
|
|
||||||
glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, video().getWidth(), video().getHeight(), false);
|
|
||||||
#else
|
#else
|
||||||
if (_pBuffer != NULL)
|
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, _pTexture->realWidth, _pTexture->realHeight, false);
|
||||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, _pBuffer->m_pTexture->realWidth, _pBuffer->m_pTexture->realHeight, false);
|
|
||||||
else
|
|
||||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_DEPTH_COMPONENT, video().getWidth(), video().getHeight(), false);
|
|
||||||
#endif
|
#endif
|
||||||
_pTexture->frameBufferTexture = CachedTexture::fbMultiSample;
|
_pTexture->frameBufferTexture = CachedTexture::fbMultiSample;
|
||||||
} else
|
} else
|
||||||
#endif // GL_MULTISAMPLING_SUPPORT
|
#endif // GL_MULTISAMPLING_SUPPORT
|
||||||
{
|
{
|
||||||
glBindTexture(GL_TEXTURE_2D, _pTexture->glName);
|
glBindTexture(GL_TEXTURE_2D, _pTexture->glName);
|
||||||
if (_pBuffer != NULL)
|
glTexImage2D(GL_TEXTURE_2D, 0, fboFormats.depthInternalFormat, _pTexture->realWidth, _pTexture->realHeight, 0, GL_DEPTH_COMPONENT, fboFormats.depthType, NULL);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, fboFormats.depthInternalFormat, _pBuffer->m_pTexture->realWidth, _pBuffer->m_pTexture->realHeight, 0, GL_DEPTH_COMPONENT, fboFormats.depthType, NULL);
|
|
||||||
else
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, fboFormats.depthInternalFormat, video().getWidth(), video().getHeight(), 0, GL_DEPTH_COMPONENT, fboFormats.depthType, NULL);
|
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user