Fix multisample count bug

This commit is contained in:
Magnus Norddahl 2016-08-17 17:37:49 +02:00
parent 5eeac830eb
commit 3c08f5ae48

View file

@ -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);
}