From 60ad782b533c4bef4d3f2ba60ff94b39852c2a96 Mon Sep 17 00:00:00 2001 From: kjpou1 Date: Thu, 28 Feb 2013 09:09:08 +0100 Subject: [PATCH] Take out check for GL Error on FrambufferRenderbuffer commands in SetRenderTargets. --- MonoGame.Framework/Graphics/GraphicsDevice.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/MonoGame.Framework/Graphics/GraphicsDevice.cs b/MonoGame.Framework/Graphics/GraphicsDevice.cs index a33cfca59f1..0c7ff3f1959 100644 --- a/MonoGame.Framework/Graphics/GraphicsDevice.cs +++ b/MonoGame.Framework/Graphics/GraphicsDevice.cs @@ -1663,11 +1663,17 @@ internal void ApplyRenderTargets(RenderTargetBinding[] renderTargets) if (renderTarget.DepthStencilFormat != DepthFormat.None) { GL.FramebufferRenderbuffer(GLFramebuffer, GLDepthAttachment, GLRenderbuffer, renderTarget.glDepthStencilBuffer); - GraphicsExtensions.CheckGLError(); + // http://www.songho.ca/opengl/gl_fbo.html + // FramebufferRenderbuffer should be checked with CheckFramebufferStatus(GLFramebuffer) which is being done + // below. If we check for GLError here we could be catching errors from previous commands and not this. + //GraphicsExtensions.CheckGLError(); if (renderTarget.DepthStencilFormat == DepthFormat.Depth24Stencil8) { GL.FramebufferRenderbuffer(GLFramebuffer, GLStencilAttachment, GLRenderbuffer, renderTarget.glDepthStencilBuffer); - GraphicsExtensions.CheckGLError(); + // http://www.songho.ca/opengl/gl_fbo.html + // FramebufferRenderbuffer should be checked with CheckFramebufferStatus(GLFramebuffer) which is being done + // below. If we check for GLError here we could be catching errors from previous commands and not this. + //GraphicsExtensions.CheckGLError(); } }