-
Notifications
You must be signed in to change notification settings - Fork 638
Description
I'm not an expert, so my thoughts may be flawed here.
Some investigation that I have done has left me a little bit confused.
At the end of the draw pipeline, nuclear starts to push different primative draw commands into a continuous buffer stored in the CTX. Each new command gets tacked onto the end except in the case of a popup which gets stitched in at the nk_end
call.
Within all of these pushes and buffer writing and pointer movement, there is a lot of math being done for memory alignment of the commands in the buffer. This isn't necessarily a bad thing (it's functional today). But I find it rather confusing. If I were to rewrite this, I would consider making a command type as a union of all command type to be pushed, that way alignment is lnt really something that anyone needs to consider. Every command would be the same size.
That, or perhaps I would try a linked list setup similar to how the Amiga RTOS handled its tasks.
@RobLoach
I'm just genuinely curious about the design decision here. And wondering what the teams thoughts on playing around with that structure are.