mirror of
https://github.com/brl/mutter.git
synced 2025-02-17 05:44:08 +00:00
![Robert Bragg](/assets/img/avatar_default.png)
Previously the backend private state was used to either link to an authority material or provide authoritative program state. The mechanism seemed overly complex and felt very fragile. I made a recent comment which added a lot of documentation to make it easier to understand but still it didn't feel very elegant. This patch takes a slightly different approach; we now have a ref-counted ArbfpProgramState object which encapsulates a single ARBfp program and the backend private state now just has a single member which is a pointer to one of these arbfp_program_state objects. We no longer need to cache pointers to our arbfp-authority and so we can get rid of a lot of awkward code that ensured these pointers were updated/invalidated at the right times. The program state objects are not tightly bound to a material so it will also allow us to later implement a cache mechanism that lets us share state outside a materials ancestry. This may help to optimize code not following the recommendations of deriving materials from templates, avoiding one-shot materials and not repeatedly modifying materials because even if a material's ancestry doesn't naturally lead us to shareable state we can fallback to searching for shareable state using central hash tables.
Description
Languages
C
98.9%
Meson
0.7%
Python
0.3%