The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
nivrig2


Joined: 27 Jan 2016
Posts: 6
Location: Northern Ireland
Quote:
Hi,

I made a simple "BunnyMark" style benchmark with SDL2.0.4 based on
SDL_RenderCopy-ing as many moving 32x32 sprites to the screen as
possible while maintaining 60fps. An iPod 4 can manage about 1100 such
sprites before slowing down, but when I tried the same code on a Lumia
520 it could barely manage 10% of that. The Lumia benchmarks a little
faster than an iPod 5 in general, so something seems off here.

The device was running the latest Windows Phone 8.1 and everything was
built from source in release mode.

I confirmed SDL was using the D3D11 render path, but I also got the same
ballpark result when using the OpenGLES renderer via ANGLE.

I ran a similar Cocos2DX benchmark that could animate 2200 sprites @
60fps on the same device, I believe with an OpenGLES render path.

This is a profiling run of the SDL code:
http://imgur.com/oRyc0Sm
D3D11_UpdateVertexBuffer is the major CPU hog. I don't know anything
about D3D programming so I stopped there.

Main File:
https://gist.github.com/johngirvin/fdf60a6e6a9d735b563c

Complete VS2015 Community Solution:
https://dl.dropboxusercontent.com/u/593090/BunnyMarkSDL.zip

Am I doing something stupid here (other than running contrived
benchmarks, obv) ?
Any suggestions?

John
--
@nivrig

SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
slvn


Joined: 06 Oct 2012
Posts: 88
Hello,


I got a similar issue on Windows 10, on a Lumia 1320 phone.

Rendering was jerky, compared to IOS, and compared to Android.

And also compared with the same phone running an old Windows 8 app build (with SDL2 code like it was 1.5 year ago).


I found out (and reported) this small modification :

in the file "SDL_render_d3d11.c" (line 1423), change the "BufferCount" from "2" to "3".


Cheers,

Sylvain







On 27 January 2016 at 23:28, John Girvin wrote:
Quote:
Quote:
Hi,

I made a simple "BunnyMark" style benchmark with SDL2.0.4 based on
SDL_RenderCopy-ing as many moving 32x32 sprites to the screen as
possible while maintaining 60fps. An iPod 4 can manage about 1100 such
sprites before slowing down, but when I tried the same code on a Lumia
520 it could barely manage 10% of that. The Lumia benchmarks a little
faster than an iPod 5 in general, so something seems off here.

The device was running the latest Windows Phone 8.1 and everything was
built from source in release mode.

I confirmed SDL was using the D3D11 render path, but I also got the same
ballpark result when using the OpenGLES renderer via ANGLE.

I ran a similar Cocos2DX benchmark that could animate 2200 sprites @
60fps on the same device, I believe with an OpenGLES render path.

This is a profiling run of the SDL code:
http://imgur.com/oRyc0Sm
D3D11_UpdateVertexBuffer is the major CPU hog. I don't know anything
about D3D programming so I stopped there.

Main File:
https://gist.github.com/johngirvin/fdf60a6e6a9d735b563c

Complete VS2015 Community Solution:
https://dl.dropboxusercontent.com/u/593090/BunnyMarkSDL.zip

Am I doing something stupid here (other than running contrived
benchmarks, obv) ?
Any suggestions?

John
--
@nivrig





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
nivrig2


Joined: 27 Jan 2016
Posts: 6
Location: Northern Ireland
Thanks, but I just tried that and it made no difference.

Sylvain Becker wrote:
Quote:
in the file "SDL_render_d3d11.c" (line 1423), change the "BufferCount"
from "2" to "3".

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
slvn


Joined: 06 Oct 2012
Posts: 88
Strange, because it definitively solves a very similar issue for me !

I will send you a test case.

On 28 January 2016 at 12:15, John Girvin wrote:
Quote:

Thanks, but I just tried that and it made no difference.

Sylvain Becker wrote:
Quote:
in the file "SDL_render_d3d11.c" (line 1423), change the "BufferCount"
from "2" to "3".

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


nivrig2


Joined: 27 Jan 2016
Posts: 6
Location: Northern Ireland
I don't think we're having the same problem. I'm CPU bound in SDL with ~100 sprites, which seems way out of line with the device's general performance and its performance with other rendering engines.

SDL_RenderCopy (mostly D3D11_RenderCopy) accounts for 85% of this CPU time: 60% in D3D11_UpdateVertexBuffer "external code", 25% in "external code" in other parts of D3D11_RenderCopy.
nivrig2


Joined: 27 Jan 2016
Posts: 6
Location: Northern Ireland
Should I report this as a bug?
SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
slvn


Joined: 06 Oct 2012
Posts: 88
I tried your test case and my Lumia 1320 + win10, it could reach almost 300 sprites, before going under 60 fps.


On android (htc m7), it was better with 700 sprites.


Don't know what performance should be expected though.
nivrig2


Joined: 27 Jan 2016
Posts: 6
Location: Northern Ireland
Lumia 1320 has a 1.7Ghz core speed compared to the Lumia 520's 1.0Ghz, so your result of 300 sprites is consistent with the Windows version being CPU bound at a very low number of sprites.
SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
slvn


Joined: 06 Oct 2012
Posts: 88
Maybe someone more experienced could help or suggest something to try ...
DLudwig


Joined: 09 Feb 2012
Posts: 179
nivrig2 wrote:
Should I report this as a bug?


Hi John,

This is David Ludwig. I wrote much of SDL's D3D11 renderer.

Admittedly, SDL's D3D11 renderer is a pretty naive implementation, and could -definitely- use some performance work. :-)

A bug report sounds fine. Tested patch(es) would be better. Wink

Cheers!
-- David L.
nivrig2


Joined: 27 Jan 2016
Posts: 6
Location: Northern Ireland
Bug 3254 posted. I'm afraid I can't help with the patches though...