diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-06-05 17:02:49 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-06-05 17:02:49 -0700 |
commit | c5597fa6d5e4b6f0f79a54b93b0f405b979beb81 (patch) | |
tree | 88c22d56597c39387a7e11a27543a9d2a1275dba /src/til.h | |
parent | 9c3a5bad857ac5ee8584e96ee66c2e337efa55c0 (diff) |
til: introduce til_module_create_contexts() variant
checkers::fill_module is presently implemented via creating
n_cpus identical module contexts, each having n_cpus=1.
Establishing a set of cloned per-cpu contexts, allowing threaded
rendering using any fill_module, regardless of if that module
internally implements threaded rendering.
This works fine, but creates some awkwardness for a future where
contexts are registered and discoverable within the stream at
their respective setup's path. In the checkers::fill_module
case, there would be n_cpus contexts at the same path since they
share the same til_setup_t. Those need to be dealt with
gracefully, ideally making the clones available to another
potentially clone-needing module (imagine a checkers::fill_module
transitionining to another checkers::fill_module situation, where
the transitioned-to fill_module refers to the context by path, it
should get all the contexts out of the stream as-is)
In this commit I'm adding a more formalized method of creating
multiple contexts from the same set of parameters, in preparation
for a future where module contexts get registered on the stream
at their til_setup_t.path. By putting the cloned creates behind
the til API it should at least be relatively trivial to get the
on-stream context registration to capture the multiple contexts.
Diffstat (limited to 'src/til.h')
-rw-r--r-- | src/til.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -44,6 +44,7 @@ const til_module_t * til_lookup_module(const char *name); void til_get_modules(const til_module_t ***res_modules, size_t *res_n_modules); char * til_get_module_names(unsigned flags_excluded, const char **exclusions); void til_module_render(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr); +int til_module_create_contexts(const til_module_t *module, til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup, size_t n_contexts, til_module_context_t **res_contexts); int til_module_create_context(const til_module_t *module, til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup, til_module_context_t **res_context); til_module_context_t * til_module_destroy_context(til_module_context_t *context, til_stream_t *stream); int til_module_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup); |