SDL is too slow on uwp

On my lumia 930 the speed is 10fps, on a i7 it’s 300fps while on normal desktop at the same i7 the fps is higher than 1000fps D:

Example vídeo:

How can I increase the SDL speed?
What I’m doing, well, I’m simulating a terminal like app where I have a 80x25 chars grid and I render each grid all the time.

The render code is here :

I also heard I could speed up my app using sdl gpu, but Idk how to load it with visual studio, do you guys have some tips about how to make it work?

EDIT: Before I forget, using software render on my lumia 930 is faster than using hardware aceleration D: (by a margin of 20fps) but the same doesnt happyn on my i7

I remmeber patching SDL to use triple-buffering instead of dual-buffering
for rendering. This increased fps on the lumia 550 from 20fps to 60fps.
Maybe this would help you?

---------- Původní e-mail ----------

I recall people reporting that triple-buffering did improve performance on Windows Phone / Windows Mobile. Right now, this requires a small modification to SDL’s source code. A patch was submitted, however, there were concerns about increased memory use. An SDL_HINT to allow for triple-buffering was suggested, but support for additional platforms was requested (by Sam, IIRC).

An arguably-better fix would be to rework SDL’s D3D11 rendering backend, for better performance. The implementation is rather naive, and I suspect could be improved quite a bit.

hmm just wondering, doesn’t almost all Windows Phone smartphones only support up to D3D9 ? if I remember only the “new” high end lumia 95x and the elite x3 supports DirectX 11 ( while the others support Directx 9.3)
Maybe there’s some slowdown on the middle of the code to translate D3D11 to D3D9

But Idk well this área so I’ll leave this with the guys that know better about it.

About the triple-buffering, my app only uses up to 22MB of ram, is there a tip where could I enable this triple buffering?

if you guys want here’s the uwp app that I was testing:!AurELTq1jbljkcVskAvCn-zkSmM1_A
(for Windows 10 mobile/desktop), you don’t need to Interact with it, it’s only a path find demonstration where it shows some information (ehm in portuguese) and also the most important for me: the fps

Tried to change
swapChainDesc.BufferCount = 2; /* Use double-buffering to minimize latency. /
swapChainDesc.BufferCount = 3; /
Use double-buffering to minimize latency. */

But the fps were the same (11 - 10fps)

1 Like

One possible work-around might be to try using SDL2’s OpenGLES 2 rendering backend. There is an open-source library, ANGLE, which should work in conjunction with SDL2, or at least did at one point! I recall there being a copy available linked of one of MSVC’s 3rd-party NuGet repositories, but am not sure if it is still available.

Just doing an update:
I did alot of changes in the rendering part of my engine and I got alot of improvments in performance, below I’ll show two examples of it.
in the contra demo I could reach 208FPS (1500 on desktop)!!! while in the ProjectAsteroid I can stay with 50fps (vs 733 on uwp core i7)

I I could improve the performance a bit more by not rendering what hasn’t moved from the sprites part (the ASCII chars now does that)

Rewriting the core of SDL’s D3D11 renderer is something on my longish-term TODO list. If anyone wants to take a stab at it, though, please, by all means. :wink: (I doubt that it would have to be a full rewrite, either!)