OGRECave / ogre-next

aka ogre v2 - scene-oriented, flexible 3D C++ engine
https://ogrecave.github.io/ogre-next/api/latest
Other
1.08k stars 234 forks source link

Compositor local textures not working correctly in macOS with GL3+ #231

Open srmainwaring opened 3 years ago

srmainwaring commented 3 years ago

System Information

Detailled description

When using a compositor that uses a local texture (e.g. Postprocessing.compositor) on macOS with the GL3+ render system; the local textures do not seem to be working properly.

To trace the problem I created a simple compositor example available here: https://github.com/srmainwaring/ogre-next/tree/feature/v2-2-macos-sample-compositor.

The compositor clears a local texture to a colour (green for the example below) and the render window to yellow, then a render_quad pass is used to copy the local texture to the render window.

I use a modified version of the Copyback_4xFP32_ps.glsl shader to display the channels in quadrants (with a similar version for metal):

#version 330

uniform sampler2D tex;

in block
{
    vec2 uv0;
} inPs;

out vec4 fragColour;

void main()
{
    // original code
    //fragColour = texture( tex, inPs.uv0 );

    // debug1 display uv coordinates
    //fragColour = vec4( inPs.uv0.x, inPs.uv0.y, 0, 1 );

    // debug2 display individual channels in quadrants
    vec4 texColour = texture( tex, inPs.uv0 );
    if (inPs.uv0.x < 0.5)
    {
        if (inPs.uv0.y < 0.5)
        {
            fragColour = vec4(texColour.x, 0, 0, 1);
        }
        else
        {
            fragColour = vec4(0, texColour.y, 0, 1);
        }
    }
    else
    {
        if (inPs.uv0.y < 0.5)
        {
            fragColour = vec4(0, 0, texColour.z, 1);
        }
        else
        {
            fragColour = vec4(texColour.www, 1);
        }
    }
}

Metal

The metal version works as expected with the green quadrant visible and the alpha quadrant white.

ogre2-2_metal_copyback_test

GL3+

The GL3+ version does not show green. The blue quadrant is visible and the alpha channel is not white.

ogre2-2_gl3plus_copyback_test

Setting the pixel shader to display the texture coordinates confirms that the GLSL Quad vertex shader is working correctly, which points to a possible issue with the GL3PlusTextureGpuRenderTarget on macOS.

There doesn't seem to be anything in the log to indicate an OpenGL compilation error (this with ENABLE_GL_CHECK 1 in OgreGL3PlusPrerequisites.h).

Ogre.log

2021-10-07 15:19:20.923875+0100 Sample_Tutorial20_Compositor[32573:33093831] [default] 0x100000b56: TCC deny IOHIDDeviceOpen
2021-10-07 15:19:20.924118+0100 Sample_Tutorial20_Compositor[32573:33093831] [default] 0x10001380a: TCC deny IOHIDDeviceOpen
Creating resource group General
Creating resource group Internal
Creating resource group Autodetect
SceneManagerFactory for type 'DefaultSceneManager' registered.
Registering ResourceManager for type Material
Registering ResourceManager for type Mesh
Registering ResourceManager for type Mesh2
Registering ResourceManager for type OldSkeleton
MovableObjectFactory for type 'ParticleSystem' registered.
ArchiveFactory for archive type FileSystem registered.
ArchiveFactory for archive type Zip registered.
ArchiveFactory for archive type EmbeddedZip registered.
DDS codec registering
FreeImage version: 3.18.0
This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,psb,cut,xbm,xpm,gif,hdr,g3,sgi,rgb,rgba,bw,exr,j2k,j2c,jp2,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti,x3f,webp,jxr,wdp,hdp
ETC codec registering
OITD codec registering
Registering ResourceManager for type HighLevelGpuProgram
MovableObjectFactory for type 'Decal' registered.
MovableObjectFactory for type 'InternalCubemapProbe' registered.
MovableObjectFactory for type 'Entity' registered.
MovableObjectFactory for type 'Item' registered.
MovableObjectFactory for type 'Light' registered.
MovableObjectFactory for type 'Rectangle2Dv2' registered.
MovableObjectFactory for type 'BillboardSet' registered.
MovableObjectFactory for type 'ManualObject2' registered.
MovableObjectFactory for type 'BillboardChain' registered.
MovableObjectFactory for type 'RibbonTrail' registered.
MovableObjectFactory for type 'WireAabb' registered.
Loading library RenderSystem_Metal
Installing plugin: Metal RenderSystem
Metal: Devices Detection Starts
2021-10-07 15:19:20.952152+0100 Sample_Tutorial20_Compositor[32573:33093831] Metal API Validation Enabled
2021-10-07 15:19:20.976364+0100 Sample_Tutorial20_Compositor[32573:33093831] +[MTLIOAccelDevice registerDevices]: Zero Metal services found
Metal: "AMD Radeon Pro W5700X"
Metal: Devices Detection Ends
Plugin successfully installed
Loading library RenderSystem_GL3Plus
Installing plugin: GL 3+ RenderSystem
OpenGL 3+ Rendering Subsystem created.
Plugin successfully installed
Loading library Plugin_ParticleFX
Installing plugin: ParticleFX
Particle Emitter Type 'Point' registered
Particle Emitter Type 'Box' registered
Particle Emitter Type 'Ellipsoid' registered
Particle Emitter Type 'Cylinder' registered
Particle Emitter Type 'Ring' registered
Particle Emitter Type 'HollowEllipsoid' registered
Particle Affector Type 'LinearForce' registered
Particle Affector Type 'ColourFader' registered
Particle Affector Type 'ColourFader2' registered
Particle Affector Type 'ColourImage' registered
Particle Affector Type 'ColourInterpolator' registered
Particle Affector Type 'Scaler' registered
Particle Affector Type 'Rotator' registered
Particle Affector Type 'DirectionRandomiser' registered
Particle Affector Type 'DeflectorPlane' registered
Plugin successfully installed
*-*-* OGRE Initialising
*-*-* Version 2.2.6 (Cerberus)
***********************************************
***  Stopping Mac OS X OpenGL 3+ Subsystem  ***
***********************************************
CPU Identifier & Features
-------------------------
 *   CPU ID: GenuineIntel: Intel(R) Xeon(R) W-3245 CPU @ 3.20GHz
 *   Logical cores: 32
 *      SSE: yes
 *     SSE2: yes
 *     SSE3: yes
 *      MMX: yes
 *   MMXEXT: yes
 *    3DNOW: no
 * 3DNOWEXT: no
 *     CMOV: yes
 *      TSC: yes
 *      FPU: yes
 *      PRO: yes
 *       HT: no
-------------------------
Metal: Devices Detection Starts
Metal: "AMD Radeon Pro W5700X"
Metal: Devices Detection Ends
Metal: Requested "(default)", selected "AMD Radeon Pro W5700X (system default)"
Supports: OSX_GPUFamily1_v1
Registering ResourceManager for type GpuProgram
DefaultWorkQueue('Root') initialising on thread main.
Particle Renderer Type 'billboard' registered
OverlayElementFactory for type Panel registered.
OverlayElementFactory for type BorderPanel registered.
OverlayElementFactory for type TextArea registered.
Registering ResourceManager for type Font
Creating resource group Essential
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/DebugPack.zip' of type 'Zip' to resource group 'Essential'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/CornellBox.zip' of type 'Zip' to resource group 'Essential'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/2.0/scripts/materials/Common' of type 'FileSystem' to resource group 'General'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/2.0/scripts/materials/Common/Any' of type 'FileSystem' to resource group 'General'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/2.0/scripts/materials/Common/GLSL' of type 'FileSystem' to resource group 'General'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/2.0/scripts/materials/Common/GLSLES' of type 'FileSystem' to resource group 'General'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/2.0/scripts/materials/Common/HLSL' of type 'FileSystem' to resource group 'General'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/2.0/scripts/materials/Common/Metal' of type 'FileSystem' to resource group 'General'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/Hlms/Common/Any' of type 'FileSystem' to resource group 'General'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/Hlms/Common/GLSL' of type 'FileSystem' to resource group 'General'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/Hlms/Common/HLSL' of type 'FileSystem' to resource group 'General'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/Hlms/Common/Metal' of type 'FileSystem' to resource group 'General'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/Compute/Algorithms/IBL' of type 'FileSystem' to resource group 'General'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/Compute/Tools/Any' of type 'FileSystem' to resource group 'General'
Creating resource group Popular
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/2.0/scripts/Compositors' of type 'FileSystem' to resource group 'Popular'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/models' of type 'FileSystem' to resource group 'Popular'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/textures' of type 'FileSystem' to resource group 'Popular'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/textures/Cubemaps' of type 'FileSystem' to resource group 'Popular'
Added resource location '/Users/rhys/Code/ogre/ogre-next2.2/build_xcode/bin/Debug/Sample_Tutorial20_Compositor.app/Contents/Resources/2.0/scripts/materials/Tutorial20_Compositor' of type 'FileSystem' to resource group 'General'
Parsing scripts for resource group Autodetect
Finished parsing scripts for resource group Autodetect
Creating resources for group Autodetect
All done
Parsing scripts for resource group Essential
Parsing script Materials.material
Parsing script CornellBox.material.json
Parsing script DebugFont.fontdef
Finished parsing scripts for resource group Essential
Creating resources for group Essential
All done
Parsing scripts for resource group General
Parsing script Quad.program
Shader Ogre/Compositor/Quad_vs_Metal compiled successfully.
Shader Ogre/Compositor/QuadCameraDir_vs_Metal compiled successfully.
Shader Ogre/Compositor/QuadCameraDirNoUV_vs_Metal compiled successfully.
Parsing script Copyback.material
Shader Ogre/Copy/4xFP32_ps_Metal compiled successfully.
Shader Ogre/Copy/4xFP32_2DArray_ps_Metal compiled successfully.
Shader Ogre/Copy/3xFP32_ps_Metal compiled successfully.
Shader Ogre/Copy/1xFP32_ps_Metal compiled successfully.
Shader Ogre/Resolve/1xFP32_Subsample0_ps_Metal compiled successfully.
Parsing script DepthUtils.material
Shader Ogre/Depth/DownscaleMax_ps_Metal compiled successfully.
Parsing script DPM.material
Shader Ogre/DPM/CubeToDpm_4xFP16_ps_Metal compiled successfully.
Parsing script DPSM.material
Shader Ogre/DPSM/CubeToDpsm_ps_Metal compiled successfully.
Shader Ogre/DPSM/CubeToDpsm_Colour_ps_Metal compiled successfully.
Parsing script EsmGaussianBlurLogFilter.material
Shader ESM/GaussianLogFilterH_ps_Metal compiled successfully.
Shader ESM/GaussianLogFilterV_ps_Metal compiled successfully.
Parsing script HiddenAreaMeshVr.material
Shader Ogre/VR/HiddenAreaMeshVr_vs_Metal compiled successfully.
Shader Ogre/VR/HiddenAreaMeshVr_ps_Metal compiled successfully.
Parsing script PccDepthCompressor.material
Shader PccDepthCompressor_ps_Metal compiled successfully.
Parsing script RadialDensityMask.material
Shader Ogre/Compositor/RadialDensityMask_vs_Metal compiled successfully.
Shader Ogre/VR/RadialDensityMask_ps_Metal compiled successfully.
Parsing script Sky.material
Shader Ogre/Sky/Cubemap_ps_Metal compiled successfully.
Shader Ogre/Sky/Equirectangular_ps_Metal compiled successfully.
Parsing script TestRenderQuad.compositor
Parsing script EsmGaussianBlurLogFilter.material.json
Parsing script Mipmaps.material.json
Parsing script IBL.material.json
Finished parsing scripts for resource group General
Creating resources for group General
All done
Parsing scripts for resource group Internal
Finished parsing scripts for resource group Internal
Creating resources for group Internal
All done
Parsing scripts for resource group Popular
Parsing script InstancedStereo.compositor
Parsing script IrradianceFieldRaster.compositor
Parsing script LocalCubemaps.compositor
Parsing script PbsMaterials.compositor
Parsing script PlanarReflections.compositor
Parsing script Refractions.compositor
Parsing script ScreenSpaceReflections.compositor
Parsing script ShadowMapDebugging.compositor
Parsing script StaticShadowMaps.compositor
Parsing script StencilTest.compositor
Parsing script StereoRendering.compositor
Parsing script Tutorial_DynamicCubemap.compositor
Parsing script Tutorial_OpenVRWorkspace.compositor
Parsing script Tutorial_ReconstructPosFromDepth.compositor
Parsing script Tutorial_Terrain.compositor
Parsing script TutorialSky_Postprocess.compositor
Parsing script TutorialUav01_Setup.compositor
Parsing script TutorialUav02_Setup.compositor
Parsing script UvBaking.compositor
Finished parsing scripts for resource group Popular
Creating resources for group Popular
All done
darksylinc commented 3 years ago

A small nitpick that is probably not of relevance on macOS GL3 (but relevant everywhere else).

You first clear but then tell the GPU to ignore that clear:

    target rt_output
    {
        // Clear to yellow
        pass clear
        {
            colour_value 1 1 0 1
        }

        // Copy texture from rt_green
        pass render_quad
        {
            //use_quad yes
            load { all dont_care }
            material Ogre/Copy/4xFP32
            input 0 rt_green
        }
    }

This is because the 2nd pass says "dont_care", you're literally saying I don't care what was in the render target I am about to render to (which you just cleared).

A fix would be to just do:

    target rt_output
    {
        // Copy texture from rt_green
        pass render_quad
        {
            //use_quad yes
            load
           {
            all clear
        // Clear to yellow
            clear_colour 1 1 0 1
            }
            material Ogre/Copy/4xFP32
            input 0 rt_green
        }
    }
srmainwaring commented 3 years ago

@darksylinc thanks for the fix, please excuse the mistakes. The example doesn't really need to clear to yellow but it does help trace the render when stepping through Xcode on the Metal version. Unfortunately there aren't equivalent tools for OpenGL on macOS now.

I'm happy to continue with the detailed investigation but could do with some guidance on where & what to look for. My next thoughts are to look at setting an initial texture for the GL3PlusTextureGpuRenderTarget in the code where it is created and initialised to check if it is transitioned to resident correctly - but you may have better suggestions on how to best go about isolating the issue.

darksylinc commented 3 years ago

Give the simplicity of your sample, things I can think of:

  1. Clear is broken. We changed how we clear a lot in 2.2; the relevant code is in GL3PlusRenderPassDescriptor::performLoadActions
  2. Try disabling sRGB entirely (sRGB Gamma Conversion = No; or simply params.insert( std::make_pair("gamma", "No") );) and declare your compo local texture as PFG_RGBA8_UNORM
  3. This would be weird but perhaps macOS' glTexStorage2D is broken and we must resort to emulating it with glTexImage2D; i.e. they're doing this internally (emulating glTexStorage2D with glTexImage2D) and they screwed up
srmainwaring commented 3 years ago

Thanks for the suggestions. Analysis so far:

  1. Try disabling sRGB entirely (sRGB Gamma Conversion = No; or simply params.insert( std::make_pair("gamma", "No") );) and declare your compo local texture as PFG_RGBA8_UNORM

Tried this first with no change in the outcome.

  1. Clear is broken. We changed how we clear a lot in 2.2; the relevant code is in GL3PlusRenderPassDescriptor::performLoadActions

I have not looked through the implementation yet, but modified the compositor to remove the clear pass on the local texture (and remove the dependency on clear (?)).

Changes:

Result: no change in outcome. This suggests that clear is not the problem.

Next step is to look at emulating glTexStorage2D, IIRC think there's code for this in Ogre2.1 so I'll look that up.

darksylinc commented 3 years ago

Next step is to look at emulating glTexStorage2D, IIRC think there's code for this in Ogre2.1 so I'll look that up.

Since we're trying to determine the cause of the problem and your sample is very simple, I think simply replacing glTexStorage2D() calls with a glTexImage that always creates an RGBA8888 will do.

darksylinc commented 3 years ago

Btw what happens if you change the clear colour? i.e. from green to blue or red? Same result? Different? That is key.

srmainwaring commented 3 years ago

Result for GL3+ is independent of the clear colour. Always returns the second image posted above.

darksylinc commented 3 years ago

Oh that's a good help!

It could mean:

  1. Texture is not bound correctly (weird... lots of regular textures would be broken too), i.e. GL3PlusRenderSystem::_setTexture
  2. uniform sampler2D tex; points to the wrong sampler unit. I doubt this is it, because this code didn't change from 2.1 to 2.2
  3. FBO was not created correctly (i.e. the GL texture was not properly associated with the FBO). GL3PlusRenderPassDescriptor::updateColourFbo handles this
  4. FBO was not bound correctly. GL3PlusRenderPassDescriptor::performLoadActions does this when it calls glBindFramebuffer and glDrawBuffer. GL3PlusRenderPassDescriptor::performStoreActions unbinds the FBO.
darksylinc commented 3 years ago

I just realized that if shadow mapping is working, then FBO and RenderToTexture stuff is working fine. This is heck a lot confusing.

Edit: I assume you're working with MSAA disabled, at least the problem is isolated. MSAA adds a lot of uncertainty I'd rather not deal right now.

darksylinc commented 3 years ago

Btw this is stupid, but I didn't ask for Ogre.log. Perhaps there's relevant info there. Could you upload it? Thanks

srmainwaring commented 3 years ago

This from a more recent version than pushed to github (Ogre/ColourGreen/4xFP32_ps_GLSL is Ogre/Copy/4xFP32_ps_GLSL with a hardcoded fragment).

Ogre.log

AFAIK MSAA is disabled (I am using the default config settings aside from screen size).

Edit: I have observed some odd behaviour in the samples that are rendering which suggest not all is well. The PbsMaterials sample will not render properly if the block that sets the environment cube maps on the translucent spheres is removed. The Forward3D sample will run but has the light tiles all misaligned (they don't initially show, but if you increase the number of lights they appear and stay visible, but misaligned, when the number of lights is decreased again).

darksylinc commented 3 years ago

This could be a major facepalm:

What happens if you do:

// out vec4 fragColour; // Comment it out
#define gl_FragColor fragColour
srmainwaring commented 3 years ago

Compile error:

GLSL compile log: Ogre/Copy/4xFP32_ps_GLSL
ERROR: 0:28: Use of undeclared identifier 'fragColour'
ERROR: 0:33: Use of undeclared identifier 'fragColour'
ERROR: 0:41: Use of undeclared identifier 'fragColour'
ERROR: 0:46: Use of undeclared identifier 'fragColour'
WARNING: GraphicsSystem::deinitialize() not called!!!
An exception has occured: OGRE EXCEPTION(3:RenderingAPIException): Fragment Program Ogre/Copy/4xFP32_ps_GLSL failed to compile. See compile log above for details. in GLSLShader::compile at /Volumes/MacPro2_DV1/Code/ogre/ogre-next2.2/RenderSystems/GL3Plus/src/GLSL/OgreGLSLShader.cpp (line 314)
Program ended with exit code: 255

(this on my modified version returning the channels in quadrants - so the 4x appearance of fragColour)

darksylinc commented 3 years ago

Sorry I messed up, it should've been:

#define fragColour gl_FragColor

srmainwaring commented 3 years ago

Still compile error:

GLSL compile log: Ogre/Copy/4xFP32_ps_GLSL
ERROR: 0:28: Use of undeclared identifier 'gl_FragColor'
ERROR: 0:33: Use of undeclared identifier 'gl_FragColor'
ERROR: 0:41: Use of undeclared identifier 'gl_FragColor'
ERROR: 0:46: Use of undeclared identifier 'gl_FragColor'
WARNING: GraphicsSystem::deinitialize() not called!!!
An exception has occured: OGRE EXCEPTION(3:RenderingAPIException): Fragment Program Ogre/Copy/4xFP32_ps_GLSL failed to compile. See compile log above for details. in GLSLShader::compile at /Volumes/MacPro2_DV1/Code/ogre/ogre-next2.2/RenderSystems/GL3Plus/src/GLSL/OgreGLSLShader.cpp (line 314)
Program ended with exit code: 255
darksylinc commented 3 years ago

Wtf? Ok then try:

layout(location = 0, index = 0) out vec4 fragColour;

srmainwaring commented 3 years ago

Compiling correctly. Runs with same result as above.

srmainwaring commented 3 years ago

3. This would be weird but perhaps macOS' glTexStorage2D is broken and we must resort to emulating it with glTexImage2D; i.e. they're doing this internally (emulating glTexStorage2D with glTexImage2D) and they screwed up

I don't think there is an issue with glTexStorage2D: Ogre2.1 is using glTexStorage2D (with a fallback to glTexImage2D) and on my mac the GL_ARB_texture_storage branch is executed and working correctly.

Edit

Ok - I think the problem is that the colour attachment on the FBO is never set on macOS. I've put a break on every glFramebuffer.... call in GL3PlusRenderPassDescriptor and AFAICT none that set colour attachments are being hit.

In GL3PlusRenderPassDescriptor::updateColourFbo the loop over mNumColourEntries that attaches the colour entries skips the calls to either glFramebufferRenderbuffer or glFramebufferTexture because bSupportsTIR == false (which takes out both the if and else-if branches).

Still issues to resolve, but have something rendering now (if not the main scene). I have just set bSupportsTIR = true in GL3PlusRenderPassDescriptor::updateColourFbo, commented out the block setting various framebuffer params and tried running the Postprocessing sample. This with the Old TV effect on:

ogre2-2_gl3plus_postprocessing_oldtv

and FBO errors which are not unexpected given the hack above:

OpenGL error 0x0502 GL_INVALID_OPERATION in void Ogre::GL3PlusRenderPassDescriptor::updateColourFbo(Ogre::uint8) at line 282 for glFramebufferTextureLayer

Now need to set about understanding what a proper fix involves.