From 907ee4e4e8500957003f16296780da8d921802b1 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 9 Jul 2023 17:18:14 -0700 Subject: 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... --- src/modules/spiro/spiro.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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 -- cgit v1.2.3