diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-05-01 11:43:42 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-05-01 13:50:26 -0700 |
commit | a81425632db81527bcecd2d0fbdb5b09c25141ba (patch) | |
tree | bdc6ba54c39e9a859d2c87e9a0a87d70b85e00a8 /src/modules | |
parent | 45d1f956b35fa9003106716e42425cc86cadc7a1 (diff) |
modules/*: make use of generic fragmenters
Just one case, modules/submit, was using 32x32 tiles and is now
using 64x64. I don't expect it to make any difference.
While here I fixed up the num_cpus/n_cpus naming inconsistencies,
normalizing on n_cpus.
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/blinds/blinds.c | 2 | ||||
-rw-r--r-- | src/modules/checkers/checkers.c | 2 | ||||
-rw-r--r-- | src/modules/compose/compose.c | 6 | ||||
-rw-r--r-- | src/modules/drizzle/drizzle.c | 14 | ||||
-rw-r--r-- | src/modules/flui2d/flui2d.c | 10 | ||||
-rw-r--r-- | src/modules/julia/julia.c | 14 | ||||
-rw-r--r-- | src/modules/meta2d/meta2d.c | 15 | ||||
-rw-r--r-- | src/modules/montage/montage.c | 4 | ||||
-rw-r--r-- | src/modules/pixbounce/pixbounce.c | 4 | ||||
-rw-r--r-- | src/modules/plasma/plasma.c | 14 | ||||
-rw-r--r-- | src/modules/plato/plato.c | 5 | ||||
-rw-r--r-- | src/modules/ray/ray.c | 10 | ||||
-rw-r--r-- | src/modules/roto/roto.c | 14 | ||||
-rw-r--r-- | src/modules/rtv/rtv.c | 7 | ||||
-rw-r--r-- | src/modules/snow/snow.c | 14 | ||||
-rw-r--r-- | src/modules/sparkler/sparkler.c | 15 | ||||
-rw-r--r-- | src/modules/spiro/spiro.c | 2 | ||||
-rw-r--r-- | src/modules/stars/stars.c | 2 | ||||
-rw-r--r-- | src/modules/submit/submit.c | 10 | ||||
-rw-r--r-- | src/modules/swab/swab.c | 14 | ||||
-rw-r--r-- | src/modules/swarm/swarm.c | 2 | ||||
-rw-r--r-- | src/modules/voronoi/voronoi.c | 12 |
22 files changed, 39 insertions, 153 deletions
diff --git a/src/modules/blinds/blinds.c b/src/modules/blinds/blinds.c index 9996d8a..b14997e 100644 --- a/src/modules/blinds/blinds.c +++ b/src/modules/blinds/blinds.c @@ -35,7 +35,7 @@ static blinds_setup_t blinds_default_setup = { }; -static void * blinds_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * blinds_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { blinds_context_t *ctxt; diff --git a/src/modules/checkers/checkers.c b/src/modules/checkers/checkers.c index 99812cc..ba5f4c7 100644 --- a/src/modules/checkers/checkers.c +++ b/src/modules/checkers/checkers.c @@ -61,7 +61,7 @@ static checkers_setup_t checkers_default_setup = { }; -static void * checkers_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * checkers_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { checkers_context_t *ctxt; diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c index 78ec75a..d672bf0 100644 --- a/src/modules/compose/compose.c +++ b/src/modules/compose/compose.c @@ -43,7 +43,7 @@ typedef struct compose_setup_t { char *layers[]; } compose_setup_t; -static void * compose_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup); +static void * compose_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup); static void compose_destroy_context(void *context); static void compose_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter); 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); @@ -63,7 +63,7 @@ til_module_t compose_module = { }; -static void * compose_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * compose_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { compose_context_t *ctxt; size_t n; @@ -77,7 +77,7 @@ static void * compose_create_context(unsigned ticks, unsigned num_cpus, til_setu if (!ctxt) return NULL; - ctxt->n_cpus = num_cpus; + ctxt->n_cpus = n_cpus; for (int i = 0; i < n; i++) { const til_module_t *layer_module; diff --git a/src/modules/drizzle/drizzle.c b/src/modules/drizzle/drizzle.c index 498b857..4fb62f6 100644 --- a/src/modules/drizzle/drizzle.c +++ b/src/modules/drizzle/drizzle.c @@ -42,7 +42,6 @@ typedef struct drizzle_setup_t { typedef struct drizzle_context_t { puddle_t *puddle; - unsigned n_cpus; drizzle_setup_t setup; } drizzle_context_t; @@ -73,7 +72,7 @@ static inline uint32_t color_to_uint32(v3f_t color) { } -static void * drizzle_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * drizzle_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { drizzle_context_t *ctxt; @@ -90,7 +89,6 @@ static void * drizzle_create_context(unsigned ticks, unsigned num_cpus, til_setu return NULL; } - ctxt->n_cpus = num_cpus; ctxt->setup = *(drizzle_setup_t *)setup; return ctxt; @@ -106,19 +104,11 @@ static void drizzle_destroy_context(void *context) } -static int drizzle_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) -{ - drizzle_context_t *ctxt = context; - - return til_fb_fragment_slice_single(fragment, ctxt->n_cpus, number, res_fragment); -} - - static void drizzle_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) { drizzle_context_t *ctxt = context; - *res_fragmenter = drizzle_fragmenter; + *res_fragmenter = til_fragmenter_slice_per_cpu; for (int i = 0; i < DRIZZLE_CNT; i++) { int x = rand() % (PUDDLE_SIZE - 1); diff --git a/src/modules/flui2d/flui2d.c b/src/modules/flui2d/flui2d.c index e00dcca..dae73d8 100644 --- a/src/modules/flui2d/flui2d.c +++ b/src/modules/flui2d/flui2d.c @@ -243,7 +243,7 @@ static void gamma_init(float gamma) } -static void * flui2d_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * flui2d_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { static int initialized; flui2d_context_t *ctxt; @@ -276,19 +276,13 @@ static void flui2d_destroy_context(void *context) } -static int flui2d_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) -{ - return til_fb_fragment_tile_single(fragment, 64, number, res_fragment); -} - - /* Prepare a frame for concurrent drawing of fragment using multiple fragments */ static void flui2d_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) { flui2d_context_t *ctxt = context; float r = (ticks % (unsigned)(2 * M_PI * 1000)) * .001f; - *res_fragmenter = flui2d_fragmenter; + *res_fragmenter = til_fragmenter_tile64; switch (ctxt->emitters) { case FLUI2D_EMITTERS_FIGURE8: { diff --git a/src/modules/julia/julia.c b/src/modules/julia/julia.c index fc0f092..48f85da 100644 --- a/src/modules/julia/julia.c +++ b/src/modules/julia/julia.c @@ -19,7 +19,6 @@ typedef struct julia_context_t { float creal; float cimag; float threshold; - unsigned n_cpus; } julia_context_t; static uint32_t colors[] = { @@ -66,7 +65,7 @@ static uint32_t colors[] = { }; -static void * julia_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * julia_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { return calloc(1, sizeof(julia_context_t)); } @@ -102,21 +101,12 @@ static inline unsigned julia_iter(float real, float imag, float creal, float cim } -static int julia_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) -{ - julia_context_t *ctxt = context; - - return til_fb_fragment_slice_single(fragment, ctxt->n_cpus, number, res_fragment); -} - - /* Prepare a frame for concurrent drawing of fragment using multiple fragments */ static void julia_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) { julia_context_t *ctxt = context; - *res_fragmenter = julia_fragmenter; - ctxt->n_cpus = n_cpus; + *res_fragmenter = til_fragmenter_slice_per_cpu; ctxt->rr += .01; /* Rather than just sweeping creal,cimag from -2.0-+2.0, I try to keep things confined diff --git a/src/modules/meta2d/meta2d.c b/src/modules/meta2d/meta2d.c index 327a4d9..01bbc58 100644 --- a/src/modules/meta2d/meta2d.c +++ b/src/modules/meta2d/meta2d.c @@ -39,7 +39,6 @@ typedef struct meta2d_context_t { unsigned n; din_t *din_a, *din_b; float din_t; - unsigned n_cpus; meta2d_ball_t balls[META2D_NUM_BALLS]; } meta2d_context_t; @@ -66,7 +65,7 @@ static inline uint32_t color_to_uint32(v3f_t color) { } -static void * meta2d_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * meta2d_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { meta2d_context_t *ctxt; @@ -76,8 +75,6 @@ static void * meta2d_create_context(unsigned ticks, unsigned num_cpus, til_setup ctxt->din_a = din_new(10, 10, META2D_NUM_BALLS + 2); ctxt->din_b = din_new(10, 10, META2D_NUM_BALLS + 2); - ctxt->n_cpus = num_cpus; - for (int i = 0; i < META2D_NUM_BALLS; i++) { meta2d_ball_t *ball = &ctxt->balls[i]; @@ -100,19 +97,11 @@ static void meta2d_destroy_context(void *context) } -static int meta2d_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) -{ - meta2d_context_t *ctxt = context; - - return til_fb_fragment_slice_single(fragment, ctxt->n_cpus, number, res_fragment); -} - - static void meta2d_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) { meta2d_context_t *ctxt = context; - *res_fragmenter = meta2d_fragmenter; + *res_fragmenter = til_fragmenter_slice_per_cpu; /* move the balls around */ for (int i = 0; i < META2D_NUM_BALLS; i++) { diff --git a/src/modules/montage/montage.c b/src/modules/montage/montage.c index 19562db..8444616 100644 --- a/src/modules/montage/montage.c +++ b/src/modules/montage/montage.c @@ -15,7 +15,7 @@ typedef struct montage_context_t { } montage_context_t; static void setup_next_module(montage_context_t *ctxt); -static void * montage_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup); +static void * montage_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup); static void montage_destroy_context(void *context); static void montage_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter); static void montage_render_fragment(void *context, unsigned ticks, unsigned cpu, til_fb_fragment_t *fragment); @@ -31,7 +31,7 @@ til_module_t montage_module = { }; -static void * montage_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * montage_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { const til_module_t **modules, *rtv_module, *compose_module; size_t n_modules; diff --git a/src/modules/pixbounce/pixbounce.c b/src/modules/pixbounce/pixbounce.c index 67f35a9..e864763 100644 --- a/src/modules/pixbounce/pixbounce.c +++ b/src/modules/pixbounce/pixbounce.c @@ -129,7 +129,6 @@ char pix_map[][16*16] = { }; typedef struct pixbounce_context_t { - unsigned n_cpus; int x, y; int x_dir, y_dir; int pix_num; @@ -154,7 +153,7 @@ static uint32_t pick_color() return makergb(rand()%256, rand()%256, rand()%256, 1); } -static void * pixbounce_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * pixbounce_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { pixbounce_context_t *ctxt; @@ -162,7 +161,6 @@ static void * pixbounce_create_context(unsigned ticks, unsigned num_cpus, til_se if (!ctxt) return NULL; - ctxt->n_cpus = num_cpus; ctxt->x = -1; ctxt->y = -1; ctxt->x_dir = 0; diff --git a/src/modules/plasma/plasma.c b/src/modules/plasma/plasma.c index a498f6d..d319d90 100644 --- a/src/modules/plasma/plasma.c +++ b/src/modules/plasma/plasma.c @@ -32,7 +32,6 @@ static int32_t costab[FIXED_TRIG_LUT_SIZE], sintab[FIXED_TRIG_LUT_SIZE]; typedef struct plasma_context_t { unsigned rr; - unsigned n_cpus; } plasma_context_t; @@ -52,7 +51,7 @@ static void init_plasma(int32_t *costab, int32_t *sintab) } -static void * plasma_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * plasma_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { static int initialized; @@ -72,21 +71,12 @@ static void plasma_destroy_context(void *context) } -static int plasma_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) -{ - plasma_context_t *ctxt = context; - - return til_fb_fragment_slice_single(fragment, ctxt->n_cpus, number, res_fragment); -} - - /* Prepare a frame for concurrent drawing of fragment using multiple fragments */ static void plasma_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) { plasma_context_t *ctxt = context; - *res_fragmenter = plasma_fragmenter; - ctxt->n_cpus = n_cpus; + *res_fragmenter = til_fragmenter_slice_per_cpu; ctxt->rr += 3; } diff --git a/src/modules/plato/plato.c b/src/modules/plato/plato.c index ec53dd1..163a785 100644 --- a/src/modules/plato/plato.c +++ b/src/modules/plato/plato.c @@ -49,7 +49,6 @@ typedef struct plato_context_t { - unsigned n_cpus; float r; } plato_context_t; @@ -609,7 +608,7 @@ static void draw_polyhedron(const polyhedron_t *polyhedron, m4f_t *transform, ti } -static void * plato_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * plato_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { plato_context_t *ctxt; @@ -617,8 +616,6 @@ static void * plato_create_context(unsigned ticks, unsigned num_cpus, til_setup_ if (!ctxt) return NULL; - ctxt->n_cpus = num_cpus; - return ctxt; } diff --git a/src/modules/ray/ray.c b/src/modules/ray/ray.c index 6ecb2ff..2b3c836 100644 --- a/src/modules/ray/ray.c +++ b/src/modules/ray/ray.c @@ -130,7 +130,7 @@ typedef struct ray_context_t { } ray_context_t; -static void * ray_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * ray_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { return calloc(1, sizeof(ray_context_t)); } @@ -142,18 +142,12 @@ static void ray_destroy_context(void *context) } -static int ray_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) -{ - return til_fb_fragment_tile_single(fragment, 64, number, res_fragment); -} - - /* prepare a frame for concurrent rendering */ static void ray_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) { ray_context_t *ctxt = context; - *res_fragmenter = ray_fragmenter; + *res_fragmenter = til_fragmenter_tile64; #if 1 /* animated point light source */ diff --git a/src/modules/roto/roto.c b/src/modules/roto/roto.c index 98fffc0..06a9e11 100644 --- a/src/modules/roto/roto.c +++ b/src/modules/roto/roto.c @@ -25,14 +25,13 @@ typedef struct color_t { typedef struct roto_context_t { unsigned r, rr; - unsigned n_cpus; } roto_context_t; static int32_t costab[FIXED_TRIG_LUT_SIZE], sintab[FIXED_TRIG_LUT_SIZE]; static uint8_t texture[256][256]; static color_t palette[2]; -static void * roto_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * roto_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { return calloc(1, sizeof(roto_context_t)); } @@ -169,14 +168,6 @@ static void init_roto(uint8_t texture[256][256], int32_t *costab, int32_t *sinta } -static int roto_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) -{ - roto_context_t *ctxt = context; - - return til_fb_fragment_slice_single(fragment, ctxt->n_cpus, number, res_fragment); -} - - /* prepare a frame for concurrent rendering */ static void roto_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) { @@ -189,8 +180,7 @@ static void roto_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, t init_roto(texture, costab, sintab); } - *res_fragmenter = roto_fragmenter; - ctxt->n_cpus = n_cpus; + *res_fragmenter = til_fragmenter_slice_per_cpu; // This governs the rotation and color cycle. ctxt->r += FIXED_TO_INT(FIXED_MULT(FIXED_SIN(ctxt->rr), FIXED_NEW(16))); diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c index f50d9a8..ef6be98 100644 --- a/src/modules/rtv/rtv.c +++ b/src/modules/rtv/rtv.c @@ -33,8 +33,6 @@ typedef struct rtv_channel_t { } rtv_channel_t; typedef struct rtv_context_t { - unsigned n_cpus; - time_t next_switch, next_hide_caption; rtv_channel_t *channel, *last_channel; txt_t *caption; @@ -61,7 +59,7 @@ typedef struct rtv_setup_t { } rtv_setup_t; static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks); -static void * rtv_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup); +static void * rtv_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup); static void rtv_destroy_context(void *context); static void rtv_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter); static void rtv_finish_frame(void *context, unsigned ticks, til_fb_fragment_t *fragment); @@ -207,7 +205,7 @@ static int rtv_should_skip_module(const rtv_setup_t *setup, const til_module_t * } -static void * rtv_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * rtv_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { rtv_context_t *ctxt; const til_module_t **modules; @@ -228,7 +226,6 @@ static void * rtv_create_context(unsigned ticks, unsigned num_cpus, til_setup_t if (!ctxt) return NULL; - ctxt->n_cpus = num_cpus; ctxt->duration = ((rtv_setup_t *)setup)->duration; ctxt->context_duration = ((rtv_setup_t *)setup)->context_duration; ctxt->snow_duration = ((rtv_setup_t *)setup)->snow_duration; diff --git a/src/modules/snow/snow.c b/src/modules/snow/snow.c index 685d1bc..dc49a1a 100644 --- a/src/modules/snow/snow.c +++ b/src/modules/snow/snow.c @@ -15,7 +15,7 @@ typedef union snow_seed_t { } snow_seed_t; typedef struct snow_context_t { - unsigned n_cpus; + unsigned unused; snow_seed_t seeds[]; } snow_context_t; @@ -31,8 +31,6 @@ static void * snow_create_context(unsigned ticks, unsigned n_cpus, til_setup_t * for (unsigned i = 0; i < n_cpus; i++) ctxt->seeds[i].seed = rand(); - ctxt->n_cpus = n_cpus; - return ctxt; } @@ -43,17 +41,9 @@ static void snow_destroy_context(void *context) } -static int snow_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) -{ - snow_context_t *ctxt = context; - - return til_fb_fragment_slice_single(fragment, ctxt->n_cpus, number, res_fragment); -} - - static void snow_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) { - *res_fragmenter = snow_fragmenter; + *res_fragmenter = til_fragmenter_slice_per_cpu; } diff --git a/src/modules/sparkler/sparkler.c b/src/modules/sparkler/sparkler.c index e4e241d..08d0e9a 100644 --- a/src/modules/sparkler/sparkler.c +++ b/src/modules/sparkler/sparkler.c @@ -26,7 +26,6 @@ typedef struct sparkler_setup_t { typedef struct sparkler_context_t { particles_t *particles; - unsigned n_cpus; sparkler_setup_t setup; } sparkler_context_t; @@ -34,7 +33,7 @@ extern particle_ops_t simple_ops; static sparkler_setup_t sparkler_default_setup; -static void * sparkler_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * sparkler_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { sparkler_context_t *ctxt; @@ -73,19 +72,11 @@ static void sparkler_destroy_context(void *context) } -static int sparkler_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) +static void sparkler_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) { sparkler_context_t *ctxt = context; - return til_fb_fragment_slice_single(fragment, ctxt->n_cpus, number, res_fragment); -} - -static void sparkler_prepare_frame(void *context, unsigned ticks, unsigned ncpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) -{ - sparkler_context_t *ctxt = context; - - *res_fragmenter = sparkler_fragmenter; - ctxt->n_cpus = ncpus; + *res_fragmenter = til_fragmenter_slice_per_cpu; if (ctxt->setup.show_bsp_matches) til_fb_fragment_clear(fragment); diff --git a/src/modules/spiro/spiro.c b/src/modules/spiro/spiro.c index 50a44e8..f588638 100644 --- a/src/modules/spiro/spiro.c +++ b/src/modules/spiro/spiro.c @@ -29,7 +29,7 @@ typedef struct spiro_context_t { } spiro_context_t; -static void * spiro_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * spiro_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { spiro_context_t *ctxt; float z; diff --git a/src/modules/stars/stars.c b/src/modules/stars/stars.c index 0629c36..43e7622 100644 --- a/src/modules/stars/stars.c +++ b/src/modules/stars/stars.c @@ -49,7 +49,7 @@ float get_random_unit_coord() { } -static void * stars_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * stars_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { stars_context_t *ctxt; float z; diff --git a/src/modules/submit/submit.c b/src/modules/submit/submit.c index ebda531..f0be5eb 100644 --- a/src/modules/submit/submit.c +++ b/src/modules/submit/submit.c @@ -265,7 +265,7 @@ static void setup_grid(submit_context_t *ctxt) } -static void * submit_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * submit_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { submit_context_t *ctxt; @@ -292,17 +292,11 @@ static void submit_destroy_context(void *context) } -static int submit_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) -{ - return til_fb_fragment_tile_single(fragment, 32, number, res_fragment); -} - - static void submit_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) { submit_context_t *ctxt = context; - *res_fragmenter = submit_fragmenter; + *res_fragmenter = til_fragmenter_tile64; if (ctxt->game_winner) setup_grid(ctxt); diff --git a/src/modules/swab/swab.c b/src/modules/swab/swab.c index 63d5649..8c71049 100644 --- a/src/modules/swab/swab.c +++ b/src/modules/swab/swab.c @@ -31,7 +31,6 @@ typedef struct swab_context_t { din_t *din; float r; - unsigned n_cpus; } swab_context_t; typedef struct color_t { @@ -65,7 +64,7 @@ static inline uint32_t color_to_uint32(color_t color) { } -static void * swab_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * swab_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { swab_context_t *ctxt; @@ -92,22 +91,13 @@ static void swab_destroy_context(void *context) } -static int swab_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) -{ - swab_context_t *ctxt = context; - - return til_fb_fragment_tile_single(fragment, 64, number, res_fragment); -} - - static void swab_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, til_fb_fragment_t *fragment, til_fragmenter_t *res_fragmenter) { swab_context_t *ctxt = context; - *res_fragmenter = swab_fragmenter; + *res_fragmenter = til_fragmenter_tile64; ctxt->r += .0001f; - ctxt->n_cpus = n_cpus; } diff --git a/src/modules/swarm/swarm.c b/src/modules/swarm/swarm.c index 0271693..e2381ab 100644 --- a/src/modules/swarm/swarm.c +++ b/src/modules/swarm/swarm.c @@ -179,7 +179,7 @@ static inline uint32_t color_to_uint32(v3f_t color) { } -static void * swarm_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * swarm_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { swarm_context_t *ctxt; diff --git a/src/modules/voronoi/voronoi.c b/src/modules/voronoi/voronoi.c index 204746f..ea90389 100644 --- a/src/modules/voronoi/voronoi.c +++ b/src/modules/voronoi/voronoi.c @@ -77,7 +77,7 @@ static void voronoi_randomize(voronoi_context_t *ctxt) } -static void * voronoi_create_context(unsigned ticks, unsigned num_cpus, til_setup_t *setup) +static void * voronoi_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) { voronoi_context_t *ctxt; @@ -105,14 +105,6 @@ static void voronoi_destroy_context(void *context) } -static int voronoi_fragmenter(void *context, unsigned n_cpus, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment) -{ - voronoi_context_t *ctxt = context; - - return til_fb_fragment_tile_single(fragment, 64, number, res_fragment); -} - - static inline size_t voronoi_cell_origin_to_distance_idx(const voronoi_context_t *ctxt, const voronoi_cell_t *cell) { size_t x, y; @@ -289,7 +281,7 @@ static void voronoi_prepare_frame(void *context, unsigned ticks, unsigned n_cpus { voronoi_context_t *ctxt = context; - *res_fragmenter = voronoi_fragmenter; + *res_fragmenter = til_fragmenter_tile64; if (!ctxt->distances.buf || ctxt->distances.width != fragment->frame_width || |