From d4615861aef3655156ae11142765ff8ec311ae1b Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 6 Aug 2016 23:42:37 +0200 Subject: [PATCH] Fix missing FGLRenderBuffers::IsEnabled checks --- src/gl/renderer/gl_postprocess.cpp | 4 ++-- src/gl/renderer/gl_renderbuffers.cpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gl/renderer/gl_postprocess.cpp b/src/gl/renderer/gl_postprocess.cpp index a997f5b47..f249aa1cc 100644 --- a/src/gl/renderer/gl_postprocess.cpp +++ b/src/gl/renderer/gl_postprocess.cpp @@ -207,7 +207,7 @@ void FGLRenderer::BloomScene() void FGLRenderer::TonemapScene() { - if (gl_tonemap == 0) + if (gl_tonemap == 0 || !FGLRenderBuffers::IsEnabled()) return; FGLPostProcessState savedState; @@ -229,7 +229,7 @@ void FGLRenderer::TonemapScene() void FGLRenderer::LensDistortScene() { - if (gl_lens == 0) + if (gl_lens == 0 || !FGLRenderBuffers::IsEnabled()) return; float k[4] = diff --git a/src/gl/renderer/gl_renderbuffers.cpp b/src/gl/renderer/gl_renderbuffers.cpp index 490d73ed0..3b402d801 100644 --- a/src/gl/renderer/gl_renderbuffers.cpp +++ b/src/gl/renderer/gl_renderbuffers.cpp @@ -141,6 +141,9 @@ void FGLRenderBuffers::DeleteFrameBuffer(GLuint &handle) void FGLRenderBuffers::Setup(int width, int height) { + if (!IsEnabled()) + return; + int samples = GetCvarSamples(); if (width == mWidth && height == mHeight && mSamples != samples)