| Summary: | opengles: Reduce drawcalls and improve the performance of SDL_RenderCopy and SDL_RenderCopyEx | ||
|---|---|---|---|
| Product: | SDL | Reporter: | sowfelicity |
| Component: | render | Assignee: | Ryan C. Gordon <icculus> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | sowfelicity |
| Version: | 2.0.15 | ||
| Hardware: | x86_64 | ||
| OS: | iOS (All) | ||
| Attachments: | Reduce drawcalls of SDL_RenderCopy and SDL_RenderCopyEx. | ||
Ryan, is this something that's generally useful for all the renderers? (In reply to Sam Lantinga from comment #1) > Ryan, is this something that's generally useful for all the renderers? Yes, many of them can benefit from this at a higher level. A good practical use case is particle systems that will draw maybe hundreds of the same sprite with different vertex colors and rotations. Some of the renderers have the vertex color put in a uniform, which would need to be replaced to work with this approach, and could probably do the merging on the fly at a higher level, but yeah, something like sowfelicity's patch is worth aiming for. --ryan. |
Created attachment 4627 [details] Reduce drawcalls of SDL_RenderCopy and SDL_RenderCopyEx. This patch roughly merges multiple glDrawArrays calls into a single glDrawArrays call to improve performance of SDL_RenderCopy and SDL_RenderCopyEx for rendering a large number of small sprites sharing the same texture. 8192 "icon.bmps" were created with random color and angular velocity on iphone 6. The original SDL2 render these sprites at about 24 Frames Per Second while the patched SDL2 do the same thing at more than 39 Frames Per Second. The patch makes it possible to render more small particles fast with SDL2.