Protofall / Crayon-Game-Framework

My own library for making games on the Dreamcast
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Crayon: Sprite arrays aren't efficient as they could be? #103

Open Protofall opened 5 years ago

Protofall commented 5 years ago

When listening to Kazade and some others talking about draw arrays, the way they mentioned it sounded like my implementation isn't super efficient. I have a pvr_prim call per sprite (But recycle the header for each sprite in an array). The way they described it was as if they submitted a whole array with one pvr_prim, which obviously sounds more efficient.

Confirm this is correct and if so implement this change into Crayon. One thing to note is if I'm sending an array then I could run out of memory when drawing something since I'd be allocating memory. Possibly modify the draw_array structure to store the sprite info as the vertexes to save on space?

Protofall commented 5 years ago

As seen in the main poly draw example, we can submit multiple verts at once easily. Not sure how to use this to make it super efficient yet

Protofall commented 5 years ago

In poly mode I submit an array of 4 verts at once (So one submit per poly/sprite). This is probably what they did, but I'm not sure how to easily improve on this without mallocing and using more space.