mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-12-11 04:41:06 +00:00
Fix multisample count bug
This commit is contained in:
parent
5eeac830eb
commit
3c08f5ae48
1 changed files with 8 additions and 6 deletions
|
@ -280,12 +280,7 @@ int FGLRenderBuffers::GetCvarSamples()
|
||||||
int maxSamples = 0;
|
int maxSamples = 0;
|
||||||
glGetIntegerv(GL_MAX_SAMPLES, &maxSamples);
|
glGetIntegerv(GL_MAX_SAMPLES, &maxSamples);
|
||||||
|
|
||||||
int samples = clamp((int)gl_multisample, 0, maxSamples);
|
return clamp((int)gl_multisample, 0, maxSamples);
|
||||||
|
|
||||||
int count;
|
|
||||||
for (count = 0; samples > 0; count++)
|
|
||||||
samples >>= 1;
|
|
||||||
return count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -452,6 +447,13 @@ void FGLRenderBuffers::BlitSceneToTexture()
|
||||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, mSceneFB);
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, mSceneFB);
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, mPipelineFB[mCurrentPipelineTexture]);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, mPipelineFB[mCurrentPipelineTexture]);
|
||||||
glBlitFramebuffer(0, 0, mWidth, mHeight, 0, 0, mWidth, mHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
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_READ_FRAMEBUFFER, 0);
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue