Enable menu blur in stereo 3d.

Use more blitting to avoid confusing framebuffer state management in stereo 3D.
This commit is contained in:
Christopher Bruns 2019-02-26 21:15:13 -08:00 committed by Christoph Oelckers
commit 8becc0e78d
4 changed files with 37 additions and 16 deletions

View file

@ -550,6 +550,24 @@ void FGLRenderBuffers::BlitToEyeTexture(int eye)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
void FGLRenderBuffers::BlitFromEyeTexture(int eye)
{
CreateEyeBuffers(eye);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, mPipelineFB[mCurrentPipelineTexture].handle);
glBindFramebuffer(GL_READ_FRAMEBUFFER, mEyeFBs[eye].handle);
glBlitFramebuffer(0, 0, mWidth, mHeight, 0, 0, mWidth, mHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST);
if ((gl.flags & RFL_INVALIDATE_BUFFER) != 0)
{
GLenum attachments[2] = { GL_COLOR_ATTACHMENT0, GL_DEPTH_STENCIL_ATTACHMENT };
glInvalidateFramebuffer(GL_READ_FRAMEBUFFER, 2, attachments);
}
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
void FGLRenderBuffers::BindEyeTexture(int eye, int texunit)
{
CreateEyeBuffers(eye);
@ -557,12 +575,6 @@ void FGLRenderBuffers::BindEyeTexture(int eye, int texunit)
glBindTexture(GL_TEXTURE_2D, mEyeTextures[eye].handle);
}
void FGLRenderBuffers::BindEyeFB(int eye, bool readBuffer)
{
CreateEyeBuffers(eye);
glBindFramebuffer(readBuffer ? GL_READ_FRAMEBUFFER : GL_FRAMEBUFFER, mEyeFBs[eye].handle);
}
void FGLRenderBuffers::BindDitherTexture(int texunit)
{
if (!mDitherTexture)