From 7b6bd34a5853f4c615f444a27385b65eae7d33da Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 14 Jan 2020 19:50:47 +0100 Subject: [PATCH] - create the savepic framebuffer without multisampling. It didn't work and doesn't need it so let's save that piece of video memory. --- source/common/rendering/gl/renderer/gl_renderbuffers.cpp | 3 ++- source/common/rendering/gl/renderer/gl_renderbuffers.h | 3 ++- source/common/rendering/gl/renderer/gl_renderer.cpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/common/rendering/gl/renderer/gl_renderbuffers.cpp b/source/common/rendering/gl/renderer/gl_renderbuffers.cpp index 37617cee8..1aaa6cd3a 100644 --- a/source/common/rendering/gl/renderer/gl_renderbuffers.cpp +++ b/source/common/rendering/gl/renderer/gl_renderbuffers.cpp @@ -44,8 +44,9 @@ namespace OpenGLRenderer // //========================================================================== -FGLRenderBuffers::FGLRenderBuffers() +FGLRenderBuffers::FGLRenderBuffers(int ms) { + gl_multisample = ms; glGetIntegerv(GL_MAX_SAMPLES, &mMaxSamples); } diff --git a/source/common/rendering/gl/renderer/gl_renderbuffers.h b/source/common/rendering/gl/renderer/gl_renderbuffers.h index d1fb45666..88b7360f0 100644 --- a/source/common/rendering/gl/renderer/gl_renderbuffers.h +++ b/source/common/rendering/gl/renderer/gl_renderbuffers.h @@ -101,8 +101,9 @@ private: class FGLRenderBuffers { + int gl_multisample = 0; // intentionally overload the global CVAR public: - FGLRenderBuffers(); + FGLRenderBuffers(int ms); ~FGLRenderBuffers(); void Setup(int width, int height, int sceneWidth, int sceneHeight); diff --git a/source/common/rendering/gl/renderer/gl_renderer.cpp b/source/common/rendering/gl/renderer/gl_renderer.cpp index 560f8cbe4..7bde82962 100644 --- a/source/common/rendering/gl/renderer/gl_renderer.cpp +++ b/source/common/rendering/gl/renderer/gl_renderer.cpp @@ -88,8 +88,8 @@ FGLRenderer::FGLRenderer(OpenGLFrameBuffer *fb) void FGLRenderer::Initialize(int width, int height) { - mScreenBuffers = new FGLRenderBuffers(); - mSaveBuffers = new FGLRenderBuffers(); + mScreenBuffers = new FGLRenderBuffers(gl_multisample); + mSaveBuffers = new FGLRenderBuffers(0); mBuffers = mScreenBuffers; mPresentShader = new FPresentShader(); mPresent3dCheckerShader = new FPresent3DCheckerShader();