shithub: cstory

Download patch

ref: 88c30442c523e8b63f0eabdecd6f4c53d58d5469
parent: 2fec50ff4e99c56df10ffd1c3c2e8609ff214890
author: Clownacy <[email protected]>
date: Tue Jan 21 18:39:49 EST 2020

Force SDL2's render-batching

SDL2 will implicitly disable batching if we force a specific
rendering driver (apparently the user setting SDL_RENDER_DRIVER
counts too) for backwards-compatibility with older programs that use
their own rendering side-by-side with SDL2's. We don't do that,
though, so this commit forces SDL2 to use batching if it's available
(2.0.10 and onwards).

--- a/src/Backends/Rendering/SDLTexture.cpp
+++ b/src/Backends/Rendering/SDLTexture.cpp
@@ -72,6 +72,10 @@
 	}
 #endif
 
+#if SDL_VERSION_ATLEAST(2,0,10)
+	SDL_SetHint(SDL_HINT_RENDER_BATCHING, "1");	// We never interfere with the renderer, so don't let SDL implicitly disable batching
+#endif
+
 	renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
 
 	if (renderer == NULL)