Skip to content

Some renderer refactors (new struct img, new FBO handling, fix some hypothetical unnecessary FBO redirections)

Niklas Haas requested to merge img_refactor into master

I'm not sure I'm happy with this. My original goal was to allow merging the AV1 plane shaders with the main scaler, but I realized midway through writing this logic that that would never be possible because the AV1 shader obviously has fixed output size requirements and therefore a FBO indirection is strictly needed. And the same is true for the vast majority of interesting user shaders.

So instead we just ended up moving around a bit and arriving nowhere, but I took the opportunity to at least simplify pass_hook. And maybe un-simplify the rest of the struct img handling as well. I'm not convinced this refactor was a net gain, but I also don't want to throw it away. It contains some minor improvements. Maybe I can un-do the tex-preserving parts of it later. Or maybe we'll find a use case for it eventually. Who knows.

This refactor also introduces new FBO handling logic, to try and re-use FBOs more aggressively. And simplify the FBO generation in the process. So at least it's something. Slightly annoyed by how it requires allocating an array for every single frame. Maybe a bitfield would be better, together with a hard-coded maximum of 64 FBOs?

Merge request reports