diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-07-09 17:18:14 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-07-09 20:38:19 -0700 |
commit | 907ee4e4e8500957003f16296780da8d921802b1 (patch) | |
tree | 058cc90b905ee5b76b73448d6f8c433bf98cb8c1 | |
parent | fc69ed659402c7dd357d06b6cb1b2598d3f8d3fb (diff) |
modules/spiro: skip color math+packing if textured
The color stuff as-is isn't cheap and doesn't even get used if
there's a texture present, so don't bother with it at all.
This is especially significant since this module isn't threaded,
so it ties up all the cores leaving most of them idle when part
of a composition.
Also since spiro doesn't clamp its coordinates to the fragment
dimensions, only considering the frame dimensions, it must
continue using the "checked" put_pixel variant...
-rw-r--r-- | src/modules/spiro/spiro.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/spiro/spiro.c b/src/modules/spiro/spiro.c index 75f4438..99a654b 100644 --- a/src/modules/spiro/spiro.c +++ b/src/modules/spiro/spiro.c @@ -85,10 +85,11 @@ static void spiro_render_fragment(til_module_context_t *context, til_stream_t *s int pos_x=display_origin_x+(my_x*display_R); int pos_y=display_origin_y+(my_y*display_R); til_fb_fragment_put_pixel_checked(fragment, TIL_FB_DRAW_FLAG_TEXTURABLE, pos_x, pos_y, - makergb(sinf(M_1_PI*t)*127+128, - sinf(M_1_PI*t+(2*M_PI*.333333333333f))*127+128, - sinf(M_1_PI*t+(4*M_PI*.333333333333f))*127+128, - 0.76)); + fragment->texture ? 0xffffffff : + makergb(sinf(M_1_PI*t)*127+128, + sinf(M_1_PI*t+(2*M_PI*.333333333333f))*127+128, + sinf(M_1_PI*t+(4*M_PI*.333333333333f))*127+128, + 0.76)); } #ifdef DEBUG |