From 883f9e5049d60c7ab3f1b2ebd433b7fa2803a51b Mon Sep 17 00:00:00 2001 From: thagberg Date: Wed, 7 May 2025 16:31:22 -0400 Subject: [PATCH] Fix anti-aliasing on macOS Blitting to the resolve FBO in OSG::RenderStage was causing a GL_INVALID_FRAMEBUFFER_OPERATION due to a mismatch in attached colorbuffers between the FBOs bound in read and draw slots. This was because the normal attachment was invariantly attached to FBO_Interrupt, but not to other FBOs. --- apps/openmw/mwrender/postprocessor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp index 4847da9cee..8b835a4d47 100644 --- a/apps/openmw/mwrender/postprocessor.cpp +++ b/apps/openmw/mwrender/postprocessor.cpp @@ -503,6 +503,7 @@ namespace MWRender if (mSamples > 1) { fbos[FBO_Multisample] = new osg::FrameBufferObject; + fbos[FBO_Intercept] = new osg::FrameBufferObject; auto colorRB = createFrameBufferAttachmentFromTemplate( Usage::RENDER_BUFFER, width, height, textures[Tex_Scene], mSamples); if (mNormals && mNormalsSupported) @@ -511,6 +512,8 @@ namespace MWRender Usage::RENDER_BUFFER, width, height, textures[Tex_Normal], mSamples); fbos[FBO_Multisample]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1, normalRB); fbos[FBO_FirstPerson]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1, normalRB); + fbos[FBO_Intercept]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1, + Stereo::createMultiviewCompatibleAttachment(textures[Tex_Normal])); } auto depthRB = createFrameBufferAttachmentFromTemplate( Usage::RENDER_BUFFER, width, height, textures[Tex_Depth], mSamples); @@ -519,11 +522,8 @@ namespace MWRender osg::FrameBufferObject::BufferComponent::PACKED_DEPTH_STENCIL_BUFFER, depthRB); fbos[FBO_FirstPerson]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0, colorRB); - fbos[FBO_Intercept] = new osg::FrameBufferObject; fbos[FBO_Intercept]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0, Stereo::createMultiviewCompatibleAttachment(textures[Tex_Scene])); - fbos[FBO_Intercept]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1, - Stereo::createMultiviewCompatibleAttachment(textures[Tex_Normal])); } else {