Skip to content
Snippets Groups Projects
Commit 525279eb authored by Niklas Haas's avatar Niklas Haas
Browse files

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
1 merge request!92Some renderer refactors (new struct img, new FBO handling, fix some hypothetical unnecessary FBO redirections)
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment