diff --git a/src/gl/renderer/gl_renderbuffers.cpp b/src/gl/renderer/gl_renderbuffers.cpp index abf32500a4..c4f1b5fee3 100644 --- a/src/gl/renderer/gl_renderbuffers.cpp +++ b/src/gl/renderer/gl_renderbuffers.cpp @@ -280,12 +280,7 @@ int FGLRenderBuffers::GetCvarSamples() int maxSamples = 0; glGetIntegerv(GL_MAX_SAMPLES, &maxSamples); - int samples = clamp((int)gl_multisample, 0, maxSamples); - - int count; - for (count = 0; samples > 0; count++) - samples >>= 1; - return count; + return clamp((int)gl_multisample, 0, maxSamples); } //========================================================================== @@ -452,6 +447,13 @@ void FGLRenderBuffers::BlitSceneToTexture() glBindFramebuffer(GL_READ_FRAMEBUFFER, mSceneFB); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, mPipelineFB[mCurrentPipelineTexture]); 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); }