mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Correct FrameBufferToRDRAM.
Fixed out of memory writes in 1080 replay.
This commit is contained in:
parent
d4264e18a4
commit
8bd1b96e3c
|
@ -663,9 +663,9 @@ void FrameBufferToRDRAM::Init()
|
||||||
m_pTexture->maskT = 0;
|
m_pTexture->maskT = 0;
|
||||||
m_pTexture->mirrorS = 0;
|
m_pTexture->mirrorS = 0;
|
||||||
m_pTexture->mirrorT = 0;
|
m_pTexture->mirrorT = 0;
|
||||||
m_pTexture->realWidth = 1024;
|
m_pTexture->realWidth = 640;
|
||||||
m_pTexture->realHeight = 512;
|
m_pTexture->realHeight = 480;
|
||||||
m_pTexture->textureBytes = m_pTexture->realWidth * m_pTexture->realHeight * 4;
|
m_pTexture->textureBytes = 640 * 480 * 4;
|
||||||
textureCache().addFrameBufferTextureSize(m_pTexture->textureBytes);
|
textureCache().addFrameBufferTextureSize(m_pTexture->textureBytes);
|
||||||
glBindTexture( GL_TEXTURE_2D, m_pTexture->glName );
|
glBindTexture( GL_TEXTURE_2D, m_pTexture->glName );
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_pTexture->realWidth, m_pTexture->realHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_pTexture->realWidth, m_pTexture->realHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||||
|
@ -705,7 +705,7 @@ void FrameBufferToRDRAM::CopyToRDRAM( u32 address, bool bSync ) {
|
||||||
if (VI.width == 0) // H width is zero. Don't copy
|
if (VI.width == 0) // H width is zero. Don't copy
|
||||||
return;
|
return;
|
||||||
FrameBuffer *pBuffer = frameBufferList().findBuffer(address);
|
FrameBuffer *pBuffer = frameBufferList().findBuffer(address);
|
||||||
if (pBuffer == NULL)
|
if (pBuffer == NULL || pBuffer->m_width < VI.width)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
address = pBuffer->m_startAddress;
|
address = pBuffer->m_startAddress;
|
||||||
|
@ -719,7 +719,7 @@ void FrameBufferToRDRAM::CopyToRDRAM( u32 address, bool bSync ) {
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_FBO);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_FBO);
|
||||||
glBlitFramebuffer(
|
glBlitFramebuffer(
|
||||||
0, 0, video().getWidth(), video().getHeight(),
|
0, 0, video().getWidth(), video().getHeight(),
|
||||||
0, 0, pBuffer->m_width, pBuffer->m_height,
|
0, 0, VI.width, VI.height,
|
||||||
GL_COLOR_BUFFER_BIT, GL_LINEAR
|
GL_COLOR_BUFFER_BIT, GL_LINEAR
|
||||||
);
|
);
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user