-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to Interstate / HUB 75 for panels with different color orders #660
Conversation
I can't tell a visual speed difference running the |
Which resolution display @helgibbons? At 32x32 pixels that would be around 54μs per pixel extra. This could potentially be optimised by doing the switch in I can't see any obvious (at least non-horrible) ways to optimise the colour order otherwise- you can't beat a good ol' compiler-optimised switch. I have noticed that I think I could probably see ways to optimise this -
It might be worth exploring those. Making |
64 x 64! |
Okay Oh at 64*64 that would be more like 14μs per pixel. Should probably just delete the bounds checking from AFAIK it's impossible to call We could almost certainly handle the interleaving better than a per pixel: if(y >= height / 2) {
y -= height / 2;
offset = (y * width + x) * 2;
offset += 1;
} else {
offset = (y * width + x) * 2;
} By stepping through the source frame buffer in two separate fields and incrementing an offset rather than including multiplication. That code above basically ensures that the bottom and top half of a given display are interleaved so that row: 1, 2, 3, 4 Becomes: 1, 3, 2, 4 And they can be blasted out more efficiently. Basically this change as-is is fine, there are bigger performance issues - I think - than what's introduced here. This code could really use the eye someone with a head for optimisation and some spare time! 😆 |
Thanks for looking this over @Gadgetoid . I had hoped to be smart be changing the pin order in the Constructor, but sadly the bin defines don't seem to be used beyond the initial init. The PIO assumes a fixed pin order regardless.
That first part can certainly be me. If only the second part were true 😭 |
The code here is very similar to Cosmic/Galactic which I have miserably failed to make any faster. Since I don't want to have to set up a counter for "times the compiler has totally humbled my attempts to optimise something" I'm just going to merge this one and worry about performance later. The fact of the matter is- very little we can do behind the scenes will have as big an impact as the user's drawing code. I should totally port my fast numpy-powered FX demos to Interstate75 though. |
This follows the same approach as used for Plasma. However, plasma is a lower number of pixels, so this may make rendering slower. I am unsure how to properly test this at the moment though.