This sounds stupid, but I'm in the process of revising my current deferred rendering to better suit my game's needs. Currently, the geometry is Kitbashed, so it can easily exist in GPU memory indefinitely. However, in the end I'll use a lot of textures. The biggest performance impact appears to be coming from the fact that I need to rebind my textures on the Gbuffer pass pretty often. Even with sorting.
I decided to try a different approach, instead of using a diffuse, normal, and what have you pass...
I'd instead draw UVs, and Material IDs to the buffer. Similar to what is done for Bindless Texturing in Directx 12 and Vulkan.
But the problem I'm having to wrap my head around is how do you go about using specialized shaders?
For example, with a normal deferred pipeline, you can just render your junk per object. If each object had a unique shader, all is fine... just output the corresponding results to the correct buffers.
For example, you got a random floating oblisk with runes that have a pulsing glow. Or perhaps you have an object with light strips that move along a trim.
But with this techinque... I don't see a way to correctly do this.
You can have a massive uber shader and branching... which seems like a bad idea.
You could run as many passes as you have materials... but that would get costly.
You could have a limited set of materials... but then you loose flexibility.
Kinda wish that you had the ability to dynamically swap shaders during execution at this point.