summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-01-10 15:09:29 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-01-10 23:50:57 -0800
commit19966a5cb3a8d9cf8edbae225953da042dadfa96 (patch)
treefd041758fb8f7301d2d699faa420ea80d5fc08e0 /src/modules
parentcffc3da34523b996393f730bed5a65934b499167 (diff)
*: introduce paths for module contexts
There needs to be a way to address module context instances by name externally, in a manner complementary to settings and taps. This commit adds a string-based path to til_module_context_t, and modifies til_module_create_context() to accept a parent path which is then concatenated with the name of the module to produce the module instance's new path. The name separator used in the paths is '/' just like filesystem paths, but these paths have no relationship to filesystems or files. The root module context creation in rototiller's main simply passes "" as the parent path, resulting in a "/" root as one would expect. There are some obvious complications introduced here however: - checkers in particular creates a context per cpu, simply using the same seed and setup to try make the contexts identical at the same ticks value. With this commit I'm simply passing the incoming path as the parent for creating those contexts, but it's unclear to me if that will work OK. With an eye towards taps deriving their parent path from the context path, I guess these taps would all get the same parent and hash to the same value despite being duplicated. Maybe it Just Works, but one thing is clear - there won't be any way to address the per-cpu taps as-is. Maybe that's desirable though, there's probably not much use in trying to control the taps at the CPU granularity. - when the recursive settings stuff lands, it should bring along the ability to explicitly name settings blocks. Those names should override the module name in constructing the path. I've noted as such in the code. - these paths probably need to be hashed @ initialization time so there needs to be a hash function added to til, and a hash value accompanying the name in the module context. It'd be dumb to keep recomputing the hash when these paths get used for hash table lookups multiple times per frame... there's probably more I'm forgetting right now, but this seems like a good first step. fixup root path
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/blinds/blinds.c4
-rw-r--r--src/modules/checkers/checkers.c6
-rw-r--r--src/modules/compose/compose.c10
-rw-r--r--src/modules/drizzle/drizzle.c4
-rw-r--r--src/modules/flui2d/flui2d.c4
-rw-r--r--src/modules/julia/julia.c4
-rw-r--r--src/modules/meta2d/meta2d.c4
-rw-r--r--src/modules/moire/moire.c4
-rw-r--r--src/modules/montage/montage.c8
-rw-r--r--src/modules/pixbounce/pixbounce.c4
-rw-r--r--src/modules/plasma/plasma.c4
-rw-r--r--src/modules/plato/plato.c4
-rw-r--r--src/modules/ray/ray.c4
-rw-r--r--src/modules/roto/roto.c4
-rw-r--r--src/modules/rtv/rtv.c10
-rw-r--r--src/modules/shapes/shapes.c4
-rw-r--r--src/modules/snow/snow.c4
-rw-r--r--src/modules/sparkler/sparkler.c4
-rw-r--r--src/modules/spiro/spiro.c4
-rw-r--r--src/modules/stars/stars.c4
-rw-r--r--src/modules/strobe/strobe.c4
-rw-r--r--src/modules/submit/submit.c4
-rw-r--r--src/modules/swab/swab.c4
-rw-r--r--src/modules/swarm/swarm.c4
-rw-r--r--src/modules/voronoi/voronoi.c4
25 files changed, 59 insertions, 59 deletions
diff --git a/src/modules/blinds/blinds.c b/src/modules/blinds/blinds.c
index d93a3c9..890b569 100644
--- a/src/modules/blinds/blinds.c
+++ b/src/modules/blinds/blinds.c
@@ -37,14 +37,14 @@ static blinds_setup_t blinds_default_setup = {
};
-static til_module_context_t * blinds_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * blinds_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
blinds_context_t *ctxt;
if (!setup)
setup = &blinds_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(blinds_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(blinds_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/checkers/checkers.c b/src/modules/checkers/checkers.c
index 9dcc05c..b7a4f11 100644
--- a/src/modules/checkers/checkers.c
+++ b/src/modules/checkers/checkers.c
@@ -79,7 +79,7 @@ static checkers_setup_t checkers_default_setup = {
};
-static til_module_context_t * checkers_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * checkers_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
size_t size = sizeof(checkers_context_t);
checkers_context_t *ctxt;
@@ -90,7 +90,7 @@ static til_module_context_t * checkers_create_context(unsigned seed, unsigned ti
if (((checkers_setup_t *)setup)->fill_module)
size += sizeof(til_module_context_t *) * n_cpus;
- ctxt = til_module_context_new(size, ticks, seed, n_cpus);
+ ctxt = til_module_context_new(size, ticks, seed, n_cpus, path);
if (!ctxt)
return NULL;
@@ -104,7 +104,7 @@ static til_module_context_t * checkers_create_context(unsigned seed, unsigned ti
/* since checkers is already threaded, create an n_cpus=1 context per-cpu */
for (unsigned i = 0; i < n_cpus; i++) /* TODO: errors */
- (void) til_module_create_context(module, seed, ticks, 1, module_setup, &ctxt->fill_module_contexts[i]);
+ (void) til_module_create_context(module, seed, ticks, 1, path /* FIXME TODO path-per-context breaks down on these per-cpu-context abuses */, module_setup, &ctxt->fill_module_contexts[i]);
/* XXX: it would be interesting to support various patterns/layouts by varying the seed, but this will require
* more complex context allocation strategies while also maintaining the per-cpu allocation.
diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c
index 613c864..a73f2b7 100644
--- a/src/modules/compose/compose.c
+++ b/src/modules/compose/compose.c
@@ -47,7 +47,7 @@ typedef struct compose_setup_t {
char *layers[];
} compose_setup_t;
-static til_module_context_t * compose_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup);
+static til_module_context_t * compose_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup);
static void compose_destroy_context(til_module_context_t *context);
static void compose_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr);
static int compose_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
@@ -67,7 +67,7 @@ til_module_t compose_module = {
};
-static til_module_context_t * compose_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * compose_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
compose_context_t *ctxt;
size_t n;
@@ -77,7 +77,7 @@ static til_module_context_t * compose_create_context(unsigned seed, unsigned tic
for (n = 0; ((compose_setup_t *)setup)->layers[n]; n++);
- ctxt = til_module_context_new(sizeof(compose_context_t) + n * sizeof(compose_layer_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(compose_context_t) + n * sizeof(compose_layer_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -89,7 +89,7 @@ static til_module_context_t * compose_create_context(unsigned seed, unsigned tic
(void) til_module_randomize_setup(layer_module, rand_r(&seed), &layer_setup, NULL);
ctxt->layers[i].module = layer_module;
- (void) til_module_create_context(layer_module, rand_r(&seed), ticks, 0, layer_setup, &ctxt->layers[i].module_ctxt);
+ (void) til_module_create_context(layer_module, rand_r(&seed), ticks, 0, path, layer_setup, &ctxt->layers[i].module_ctxt);
til_setup_free(layer_setup);
ctxt->n_layers++;
@@ -101,7 +101,7 @@ static til_module_context_t * compose_create_context(unsigned seed, unsigned tic
ctxt->texture.module = til_lookup_module(((compose_setup_t *)setup)->texture);
(void) til_module_randomize_setup(ctxt->texture.module, rand_r(&seed), &texture_setup, NULL);
- (void) til_module_create_context(ctxt->texture.module, rand_r(&seed), ticks, 0, texture_setup, &ctxt->texture.module_ctxt);
+ (void) til_module_create_context(ctxt->texture.module, rand_r(&seed), ticks, 0, path, texture_setup, &ctxt->texture.module_ctxt);
til_setup_free(texture_setup);
}
diff --git a/src/modules/drizzle/drizzle.c b/src/modules/drizzle/drizzle.c
index f8aabcd..e5b79eb 100644
--- a/src/modules/drizzle/drizzle.c
+++ b/src/modules/drizzle/drizzle.c
@@ -85,14 +85,14 @@ static inline uint32_t color_to_uint32(v3f_t color) {
}
-static til_module_context_t * drizzle_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * drizzle_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
drizzle_context_t *ctxt;
if (!setup)
setup = &drizzle_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(drizzle_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(drizzle_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/flui2d/flui2d.c b/src/modules/flui2d/flui2d.c
index 5272e4d..4b75520 100644
--- a/src/modules/flui2d/flui2d.c
+++ b/src/modules/flui2d/flui2d.c
@@ -245,7 +245,7 @@ static void gamma_init(float gamma)
}
-static til_module_context_t * flui2d_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * flui2d_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
static int initialized;
flui2d_context_t *ctxt;
@@ -253,7 +253,7 @@ static til_module_context_t * flui2d_create_context(unsigned seed, unsigned tick
if (!setup)
setup = &flui2d_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(flui2d_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(flui2d_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/julia/julia.c b/src/modules/julia/julia.c
index 2668061..0dcefe5 100644
--- a/src/modules/julia/julia.c
+++ b/src/modules/julia/julia.c
@@ -67,11 +67,11 @@ static uint32_t colors[] = {
};
-static til_module_context_t * julia_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * julia_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
julia_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(julia_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(julia_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/meta2d/meta2d.c b/src/modules/meta2d/meta2d.c
index 8af3981..978f32f 100644
--- a/src/modules/meta2d/meta2d.c
+++ b/src/modules/meta2d/meta2d.c
@@ -67,11 +67,11 @@ static inline uint32_t color_to_uint32(v3f_t color) {
}
-static til_module_context_t * meta2d_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * meta2d_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
meta2d_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(meta2d_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(meta2d_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/moire/moire.c b/src/modules/moire/moire.c
index d528f8c..9bf782c 100644
--- a/src/modules/moire/moire.c
+++ b/src/modules/moire/moire.c
@@ -47,14 +47,14 @@ static moire_setup_t moire_default_setup = {
};
-static til_module_context_t * moire_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * moire_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
moire_context_t *ctxt;
if (!setup)
setup = &moire_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(moire_context_t) + ((moire_setup_t *)setup)->n_centers * sizeof(moire_center_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(moire_context_t) + ((moire_setup_t *)setup)->n_centers * sizeof(moire_center_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/montage/montage.c b/src/modules/montage/montage.c
index 1191a60..6697bc5 100644
--- a/src/modules/montage/montage.c
+++ b/src/modules/montage/montage.c
@@ -16,7 +16,7 @@ typedef struct montage_context_t {
size_t n_modules;
} montage_context_t;
-static til_module_context_t * montage_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup);
+static til_module_context_t * montage_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup);
static void montage_destroy_context(til_module_context_t *context);
static void montage_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan);
static void montage_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr);
@@ -32,13 +32,13 @@ til_module_t montage_module = {
};
-static til_module_context_t * montage_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * montage_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
const til_module_t **modules, *rtv_module, *compose_module;
size_t n_modules;
montage_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(montage_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(montage_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -92,7 +92,7 @@ static til_module_context_t * montage_create_context(unsigned seed, unsigned tic
(void) til_module_randomize_setup(module, rand_r(&seed), &setup, NULL);
/* FIXME errors */
- (void) til_module_create_context(module, rand_r(&seed), ticks, 1, setup, &ctxt->contexts[i]);
+ (void) til_module_create_context(module, rand_r(&seed), ticks, 1, path, setup, &ctxt->contexts[i]);
til_setup_free(setup);
}
diff --git a/src/modules/pixbounce/pixbounce.c b/src/modules/pixbounce/pixbounce.c
index 6a6bfb3..f10bd5b 100644
--- a/src/modules/pixbounce/pixbounce.c
+++ b/src/modules/pixbounce/pixbounce.c
@@ -240,11 +240,11 @@ static uint32_t pick_color(unsigned *seedp)
return makergb(rand_r(seedp)%256, rand_r(seedp)%256, rand_r(seedp)%256, 1);
}
-static til_module_context_t * pixbounce_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * pixbounce_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
pixbounce_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(pixbounce_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(pixbounce_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/plasma/plasma.c b/src/modules/plasma/plasma.c
index b58e34f..f49b396 100644
--- a/src/modules/plasma/plasma.c
+++ b/src/modules/plasma/plasma.c
@@ -53,7 +53,7 @@ static void init_plasma(int32_t *costab, int32_t *sintab)
}
-static til_module_context_t * plasma_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * plasma_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
static int initialized;
plasma_context_t *ctxt;
@@ -64,7 +64,7 @@ static til_module_context_t * plasma_create_context(unsigned seed, unsigned tick
init_plasma(costab, sintab);
}
- ctxt = til_module_context_new(sizeof(plasma_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(plasma_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/plato/plato.c b/src/modules/plato/plato.c
index c3302f6..1e9f6bd 100644
--- a/src/modules/plato/plato.c
+++ b/src/modules/plato/plato.c
@@ -629,11 +629,11 @@ static void draw_polyhedron(const polyhedron_t *polyhedron, m4f_t *transform, ti
}
-static til_module_context_t * plato_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * plato_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
plato_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(plato_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(plato_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/ray/ray.c b/src/modules/ray/ray.c
index 9814dcc..e3887b6 100644
--- a/src/modules/ray/ray.c
+++ b/src/modules/ray/ray.c
@@ -132,11 +132,11 @@ typedef struct ray_context_t {
} ray_context_t;
-static til_module_context_t * ray_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * ray_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
ray_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(ray_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(ray_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/roto/roto.c b/src/modules/roto/roto.c
index 1427947..c5106ab 100644
--- a/src/modules/roto/roto.c
+++ b/src/modules/roto/roto.c
@@ -62,7 +62,7 @@ static void init_roto(uint8_t texture[256][256], int32_t *costab, int32_t *sinta
}
-static til_module_context_t * roto_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * roto_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
static int initialized;
roto_context_t *ctxt;
@@ -73,7 +73,7 @@ static til_module_context_t * roto_create_context(unsigned seed, unsigned ticks,
init_roto(texture, costab, sintab);
}
- ctxt = til_module_context_new(sizeof(roto_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(roto_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c
index 13c8da9..a8cac2a 100644
--- a/src/modules/rtv/rtv.c
+++ b/src/modules/rtv/rtv.c
@@ -61,7 +61,7 @@ typedef struct rtv_setup_t {
} rtv_setup_t;
static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks);
-static til_module_context_t * rtv_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup);
+static til_module_context_t * rtv_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup);
static void rtv_destroy_context(til_module_context_t *context);
static void rtv_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr);
static void rtv_finish_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr);
@@ -188,7 +188,7 @@ static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks)
}
if (!ctxt->channel->module_ctxt)
- (void) til_module_create_context(ctxt->channel->module, rand_r(&ctxt->til_module_context.seed), ticks, 0, ctxt->channel->module_setup, &ctxt->channel->module_ctxt);
+ (void) til_module_create_context(ctxt->channel->module, rand_r(&ctxt->til_module_context.seed), ticks, 0, ctxt->til_module_context.path, ctxt->channel->module_setup, &ctxt->channel->module_ctxt);
ctxt->channel->last_on_time = now;
}
@@ -215,7 +215,7 @@ static int rtv_should_skip_module(const rtv_setup_t *setup, const til_module_t *
}
-static til_module_context_t * rtv_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * rtv_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
rtv_context_t *ctxt;
const til_module_t **modules;
@@ -232,7 +232,7 @@ static til_module_context_t * rtv_create_context(unsigned seed, unsigned ticks,
n_channels++;
}
- ctxt = til_module_context_new(sizeof(rtv_context_t) + n_channels * sizeof(rtv_channel_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(rtv_context_t) + n_channels * sizeof(rtv_channel_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -244,7 +244,7 @@ static til_module_context_t * rtv_create_context(unsigned seed, unsigned ticks,
ctxt->snow_channel.module = &rtv_none_module;
if (((rtv_setup_t *)setup)->snow_module) {
ctxt->snow_channel.module = til_lookup_module(((rtv_setup_t *)setup)->snow_module);
- (void) til_module_create_context(ctxt->snow_channel.module, rand_r(&seed), ticks, 0, NULL, &ctxt->snow_channel.module_ctxt);
+ (void) til_module_create_context(ctxt->snow_channel.module, rand_r(&seed), ticks, 0, path, NULL, &ctxt->snow_channel.module_ctxt);
}
for (size_t i = 0; i < n_modules; i++) {
diff --git a/src/modules/shapes/shapes.c b/src/modules/shapes/shapes.c
index bce0a37..65a13fa 100644
--- a/src/modules/shapes/shapes.c
+++ b/src/modules/shapes/shapes.c
@@ -98,14 +98,14 @@ static shapes_setup_t shapes_default_setup = {
};
-static til_module_context_t * shapes_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * shapes_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
shapes_context_t *ctxt;
if (!setup)
setup = &shapes_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(shapes_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(shapes_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/snow/snow.c b/src/modules/snow/snow.c
index 1a171ee..9a86689 100644
--- a/src/modules/snow/snow.c
+++ b/src/modules/snow/snow.c
@@ -22,11 +22,11 @@ typedef struct snow_context_t {
} snow_context_t;
-static til_module_context_t * snow_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * snow_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
snow_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(snow_context_t) + n_cpus * sizeof(snow_seed_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(snow_context_t) + n_cpus * sizeof(snow_seed_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/sparkler/sparkler.c b/src/modules/sparkler/sparkler.c
index 339e3e9..1a2c8bb 100644
--- a/src/modules/sparkler/sparkler.c
+++ b/src/modules/sparkler/sparkler.c
@@ -35,14 +35,14 @@ extern particle_ops_t simple_ops;
static sparkler_setup_t sparkler_default_setup;
-static til_module_context_t * sparkler_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * sparkler_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
sparkler_context_t *ctxt;
if (!setup)
setup = &sparkler_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(sparkler_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(sparkler_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/spiro/spiro.c b/src/modules/spiro/spiro.c
index 76b3a80..236dd4a 100644
--- a/src/modules/spiro/spiro.c
+++ b/src/modules/spiro/spiro.c
@@ -31,12 +31,12 @@ typedef struct spiro_context_t {
} spiro_context_t;
-static til_module_context_t * spiro_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * spiro_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
spiro_context_t *ctxt;
float z;
- ctxt = til_module_context_new(sizeof(spiro_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(spiro_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/stars/stars.c b/src/modules/stars/stars.c
index 12de4ed..e8a2f18 100644
--- a/src/modules/stars/stars.c
+++ b/src/modules/stars/stars.c
@@ -69,7 +69,7 @@ float get_random_unit_coord(unsigned *seed) {
}
-static til_module_context_t * stars_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * stars_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
stars_context_t *ctxt;
float z;
@@ -78,7 +78,7 @@ static til_module_context_t * stars_create_context(unsigned seed, unsigned ticks
if (!setup)
setup = &stars_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(stars_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(stars_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/strobe/strobe.c b/src/modules/strobe/strobe.c
index bff1e64..bc0c365 100644
--- a/src/modules/strobe/strobe.c
+++ b/src/modules/strobe/strobe.c
@@ -40,14 +40,14 @@ static strobe_setup_t strobe_default_setup = {
};
-static til_module_context_t * strobe_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * strobe_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
strobe_context_t *ctxt;
if (!setup)
setup = &strobe_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(strobe_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(strobe_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/submit/submit.c b/src/modules/submit/submit.c
index 5f46461..f46a205 100644
--- a/src/modules/submit/submit.c
+++ b/src/modules/submit/submit.c
@@ -267,14 +267,14 @@ static void setup_grid(submit_context_t *ctxt)
}
-static til_module_context_t * submit_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * submit_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
submit_context_t *ctxt;
if (!setup)
setup = &submit_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(submit_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(submit_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/swab/swab.c b/src/modules/swab/swab.c
index 6d1c3d9..b7ccf9d 100644
--- a/src/modules/swab/swab.c
+++ b/src/modules/swab/swab.c
@@ -66,11 +66,11 @@ static inline uint32_t color_to_uint32(color_t color) {
}
-static til_module_context_t * swab_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * swab_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
swab_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(swab_context_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(swab_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/swarm/swarm.c b/src/modules/swarm/swarm.c
index c896735..48b70aa 100644
--- a/src/modules/swarm/swarm.c
+++ b/src/modules/swarm/swarm.c
@@ -181,14 +181,14 @@ static inline uint32_t color_to_uint32(v3f_t color) {
}
-static til_module_context_t * swarm_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * swarm_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
swarm_context_t *ctxt;
if (!setup)
setup = &swarm_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(swarm_context_t) + sizeof(*(ctxt->boids)) * SWARM_SIZE, seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(swarm_context_t) + sizeof(*(ctxt->boids)) * SWARM_SIZE, seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
diff --git a/src/modules/voronoi/voronoi.c b/src/modules/voronoi/voronoi.c
index 2d1c8e5..bf82ca3 100644
--- a/src/modules/voronoi/voronoi.c
+++ b/src/modules/voronoi/voronoi.c
@@ -80,14 +80,14 @@ static void voronoi_randomize(voronoi_context_t *ctxt)
}
-static til_module_context_t * voronoi_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup)
+static til_module_context_t * voronoi_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
voronoi_context_t *ctxt;
if (!setup)
setup = &voronoi_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(voronoi_context_t) + ((voronoi_setup_t *)setup)->n_cells * sizeof(voronoi_cell_t), seed, ticks, n_cpus);
+ ctxt = til_module_context_new(sizeof(voronoi_context_t) + ((voronoi_setup_t *)setup)->n_cells * sizeof(voronoi_cell_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
© All Rights Reserved