Open LauPhi opened 1 year ago
Indeed ...
d3d11 (nor d3d12) isn't really batching: https://github.com/libsdl-org/SDL/blob/main/src/render/direct3d11/SDL_render_d3d11.c#L2100 gles2 (and gl) does: https://github.com/libsdl-org/SDL/blob/main/src/render/opengles2/SDL_render_gles2.c#L1299
There are 3 levels of batching in sdl:
Though you can submit a PR to improve d3d11 ..
OS: Windows 10 SDL: 2.26.4 GCC: 12.2.0 (x86_64-posix-seh-rev2, Built by MinGW-W64 project)
I was using RenderDoc to confirm that the batch rendering was working but it is actually not.
I am specifying a direct3d11 renderer because RenderDoc can not capture OpenGL 2 frames.
I am setting the hints like this:
Then creating the renderer with:
The texture is rendered using 8 times:
So no flush should happen until
SDL_RenderPresent(renderer);
at the end of the frame.Here is the frame capture from RenderDoc:![RenderDoc](https://user-images.githubusercontent.com/14290756/227731169-1d06ffdb-5ac3-4bf1-bb28-ec57899aa5a4.png)
As you can see, there is 8 separate draw calls for essentially the same texture.
I tried spacing the drawn rectangles and it did not enable batching either.
Here is the minimal reproduction project: SDLBatchingNotWorking.zip