mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Use glTexStorage2DMultisample instead of glTexImage2DMultisample in case of GLSE3
This commit is contained in:
parent
70b1b9ad03
commit
a02d284645
|
@ -127,10 +127,17 @@ void DepthBuffer::_initDepthBufferTexture(FrameBuffer * _pBuffer, CachedTexture
|
|||
#endif
|
||||
if (_multisample) {
|
||||
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _pTexture->glName);
|
||||
#ifndef GLESX
|
||||
if (_pBuffer != NULL)
|
||||
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);
|
||||
#elif defined(GLES3)
|
||||
if (_pBuffer != NULL)
|
||||
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);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
glBindTexture(GL_TEXTURE_2D, _pTexture->glName);
|
||||
|
|
|
@ -192,11 +192,19 @@ void FrameBuffer::init(u32 _address, u32 _endAddress, u16 _format, u16 _size, u1
|
|||
|
||||
if (config.video.multisampling != 0) {
|
||||
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, m_pTexture->glName);
|
||||
#ifndef GLESX
|
||||
if (_size > G_IM_SIZ_8b)
|
||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_RGBA8, m_pTexture->realWidth, m_pTexture->realHeight, false);
|
||||
else
|
||||
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, monohromeInternalformat, m_pTexture->realWidth, m_pTexture->realHeight, false);
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, m_pTexture->glName, 0);
|
||||
#elif defined(GLES3)
|
||||
if (_size > G_IM_SIZ_8b)
|
||||
glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, GL_RGBA8, m_pTexture->realWidth, m_pTexture->realHeight, false);
|
||||
else
|
||||
glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, config.video.multisampling, monohromeInternalformat, m_pTexture->realWidth, m_pTexture->realHeight, false);
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, m_pTexture->glName, 0);
|
||||
#endif
|
||||
|
||||
m_pResolveTexture = textureCache().addFrameBufferTexture();
|
||||
_initTexture(_format, _size, m_pResolveTexture);
|
||||
|
|
Loading…
Reference in New Issue
Block a user