mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-02 09:03:37 +00:00
Fix postprocessor when native resolution factor and AA enabled.
This commit is contained in:
parent
d571587531
commit
70ede8237e
|
@ -318,22 +318,15 @@ PostProcessor::PostProcessor()
|
|||
, m_bloomProgram(0)
|
||||
, m_gammaCorrectionProgram(0)
|
||||
, m_pResultBuffer(nullptr)
|
||||
, m_FBO_resolved(0)
|
||||
, m_FBO_glowMap(0)
|
||||
, m_FBO_blur(0)
|
||||
, m_pTextureOriginal(nullptr)
|
||||
, m_pTextureResolved(nullptr)
|
||||
, m_pTextureGlowMap(nullptr)
|
||||
, m_pTextureBlur(nullptr)
|
||||
{}
|
||||
|
||||
void PostProcessor::_initCommon()
|
||||
{
|
||||
if (config.video.multisampling != 0) {
|
||||
m_pTextureResolved = _createTexture();
|
||||
m_FBO_resolved = _createFBO(m_pTextureResolved);
|
||||
}
|
||||
|
||||
m_pResultBuffer = new FrameBuffer();
|
||||
_initTexture(m_pResultBuffer->m_pTexture);
|
||||
_initFBO(m_pResultBuffer->m_FBO, m_pResultBuffer->m_pTexture);
|
||||
|
@ -418,14 +411,6 @@ void PostProcessor::init()
|
|||
|
||||
void PostProcessor::_destroyCommon()
|
||||
{
|
||||
if (m_FBO_resolved != 0)
|
||||
glDeleteFramebuffers(1, &m_FBO_resolved);
|
||||
m_FBO_resolved = 0;
|
||||
|
||||
if (m_pTextureResolved != nullptr)
|
||||
textureCache().removeFrameBufferTexture(m_pTextureResolved);
|
||||
m_pTextureResolved = nullptr;
|
||||
|
||||
delete m_pResultBuffer;
|
||||
m_pResultBuffer = nullptr;
|
||||
|
||||
|
@ -526,15 +511,9 @@ void PostProcessor::_preDraw(FrameBuffer * _pBuffer)
|
|||
#ifdef GLES2
|
||||
m_pTextureOriginal = _pBuffer->m_pTexture;
|
||||
#else
|
||||
if (config.video.multisampling != 0) {
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, _pBuffer->m_FBO);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_FBO_resolved);
|
||||
glBlitFramebuffer(
|
||||
0, 0, _pBuffer->m_pTexture->realWidth, _pBuffer->m_pTexture->realHeight,
|
||||
0, 0, m_pTextureResolved->realWidth, m_pTextureResolved->realHeight,
|
||||
GL_COLOR_BUFFER_BIT, GL_LINEAR
|
||||
);
|
||||
m_pTextureOriginal = m_pTextureResolved;
|
||||
if (_pBuffer->m_pTexture->frameBufferTexture == CachedTexture::fbMultiSample) {
|
||||
_pBuffer->resolveMultisampledTexture(true);
|
||||
m_pTextureOriginal = _pBuffer->m_pResolveTexture;
|
||||
} else
|
||||
m_pTextureOriginal = _pBuffer->m_pTexture;
|
||||
#endif
|
||||
|
|
|
@ -37,12 +37,10 @@ private:
|
|||
|
||||
FrameBuffer * m_pResultBuffer;
|
||||
|
||||
GLuint m_FBO_resolved;
|
||||
GLuint m_FBO_glowMap;
|
||||
GLuint m_FBO_blur;
|
||||
|
||||
CachedTexture * m_pTextureOriginal;
|
||||
CachedTexture * m_pTextureResolved;
|
||||
CachedTexture * m_pTextureGlowMap;
|
||||
CachedTexture * m_pTextureBlur;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user