renderer: completely refactor struct img
Rather than this merely representing an "in-flight" image, with the img->sh only living for as long as this exists between different pass types, `img` is now conceptually persistent and either in one of two modes: `sh`, or `tex`. This allows us to, in principle, avoid doing redundant FBO roundtrips for cases where the previous pass thinks the next pass needs a tex but the next pass actually needs a sh, such as is currently the case for the AV1 grain shader. Since `pass_hook` in particular can randomly mutate `img` to either of the two forms, callers must now be somewhat vigilant to make sure they always use `img_tex()` and `img_sh()` to access the "current" shader/texture, rather than relying on local variables staying persistent. The use of locally initialized pl_shader is now exclusive to passes that keep their own pl_dispatch_begin calls (for various reasons).
parent
fae66ede
No related branches found
No related tags found
Loading