mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-02 09:03:37 +00:00
Code refactor: replace
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO) by frameBufferList().setCurrentDrawBuffer()
This commit is contained in:
parent
8a9ec948d7
commit
ef5af03aaa
|
@ -345,7 +345,7 @@ void DepthBufferList::clearBuffer(u32 _uly, u32 _lry)
|
|||
video().getRender().drawRect(0,0,VI.width, VI.height, color);
|
||||
gDP.otherMode.cycleType = cycleType;
|
||||
glBindImageTexture(depthImageUnit, m_pCurrent->m_pDepthImageTexture->glName, 0, GL_FALSE, 0, GL_READ_WRITE, fboFormats.depthImageInternalFormat);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO);
|
||||
frameBufferList().setCurrentDrawBuffer();
|
||||
#endif // GL_IMAGE_TEXTURES_SUPPORT
|
||||
}
|
||||
|
||||
|
|
|
@ -406,7 +406,7 @@ void FrameBuffer::resolveMultisampledTexture(bool _bForce)
|
|||
GL_COLOR_BUFFER_BIT, GL_NEAREST
|
||||
);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO);
|
||||
frameBufferList().setCurrentDrawBuffer();
|
||||
gDP.changed |= CHANGED_SCISSOR;
|
||||
m_resolved = true;
|
||||
#endif
|
||||
|
@ -481,6 +481,12 @@ void FrameBufferList::clearBuffersChanged()
|
|||
pBuffer->m_changed = false;
|
||||
}
|
||||
|
||||
void FrameBufferList::setCurrentDrawBuffer() const
|
||||
{
|
||||
if (m_pCurrent != nullptr)
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_pCurrent->m_FBO);
|
||||
}
|
||||
|
||||
FrameBuffer * FrameBufferList::findBuffer(u32 _startAddress)
|
||||
{
|
||||
for (FrameBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
|
||||
|
@ -1154,8 +1160,8 @@ bool FrameBufferToRDRAM::_prepareCopy(u32 _startAddress)
|
|||
0, 0, VI.width, VI.height,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST
|
||||
);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_FBO);
|
||||
frameBufferList().setCurrentDrawBuffer();
|
||||
}
|
||||
|
||||
m_frameCount = curFrame;
|
||||
|
@ -1449,7 +1455,7 @@ bool DepthBufferToRDRAM::_prepareCopy(u32 _address, bool _copyChunk)
|
|||
0, 0, pBuffer->m_width, pBuffer->m_height,
|
||||
GL_DEPTH_BUFFER_BIT, GL_NEAREST
|
||||
);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO);
|
||||
frameBufferList().setCurrentDrawBuffer();
|
||||
m_frameCount = curFrame;
|
||||
return true;
|
||||
}
|
||||
|
@ -1792,7 +1798,7 @@ void RDRAMtoFrameBuffer::CopyFromRDRAM(u32 _address, bool _bCFB)
|
|||
0.0f, 0.0f, width - 1.0f, height - 1.0f, 1.0f, 1.0f,
|
||||
false, true, false, m_pCurBuffer);
|
||||
video().getRender().drawTexturedRect(params);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO);
|
||||
frameBufferList().setCurrentDrawBuffer();
|
||||
|
||||
gSP.textureTile[0] = pTile0;
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ public:
|
|||
void setBufferChanged();
|
||||
void correctHeight();
|
||||
void clearBuffersChanged();
|
||||
void setCurrentDrawBuffer() const;
|
||||
|
||||
FrameBuffer * getCopyBuffer() const { return m_pCopy; }
|
||||
void setCopyBuffer(FrameBuffer * _pBuffer) { m_pCopy = _pBuffer; }
|
||||
|
|
Loading…
Reference in New Issue
Block a user