Here's the patch. I don't think there are any disadvantages to it, except for possible bugs (that shouldn't affect existing functionality)... I tested it with a few configurations. It's of course 100% backwards compatible.
The only thing I didn't consider was when the shared rendering targets should be destroyed (except when resizing).
And if someone creates duplicate rendering targets with the same name, the same thing happens as with the usual case - only the first rendering target will be returned, so someone could accidentally create two targets with differing parameters, and later on just the first one would be used. Maybe some error check could be added to that... anyway I already created the patch and I had trouble with Windows line breaks so I'm not keen to do it again.
Oh, I forgot one line related to resizing from the patch:
egMain should also resize the shared targets with:
Code:
DLLEXP void resize( int x, int y, int width, int height )
{
if( !initialized ) return;
Modules::renderer().resize( x, y, width, height );
// Update pipeline resources
for( uint32 i = 0; i < Modules::resMan().getResources().size(); ++i )
{
Resource *res = Modules::resMan().getResources()[i];
if( res != 0x0 && res->getType() == ResourceTypes::Pipeline )
{
((PipelineResource *)res)->resize();
}
}
PipelineShared::getInstance()->resize(); // <-- Add this line to patch
}