[NO SQUASH] Enforce batching all render requests in SDL2_Renderer #3139
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For all SDL2 Render requests, we (presumably) may not be batching it. This is noticed in the SDL Painter for functions like
SDLPainter::draw_texture
as well as other classes. This means that for ourRenderCopyEx
calls (technically,SDL_RenderCopyExF
) as well as any shape functions, SDL was immediately passing each RenderCopy call to the GPU. Note: I believe this could be the case, though the documentation is somewhat unreliable in SDL's defense on it. It calls one case "efficient" and the other "compatible"...With this PR, by settings a single SDL2 Renderer hint, this should result in a possible major performance boost!
They also mention on the docs that it is disabled by default due to some potential issues with usage of rendering, but after some pretty general testing, I did not spot any in particular. I would appreciate some testers that want to boot a build up and see if it at least draws stuff.
SDL3 mentioned in a PR that this is default now, but since we use SDL2 still, let's just pass this.