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
hardcoredaniel
Guest

I found that the change also bumps the frame rate from 30 to 60 fps when rendering with vsync enabled on the Lumia 550. If there are no downsides, shoudn't the change be applied in general?



---------- Původní zpráva ----------
Od: Sylvain Becker
Komu: SDL Development List
Datum: 28. 1. 2016 8:48:23
Předmět: Re: [SDL] SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
Quote:
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 mailing list

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

I found that the change also bumps the frame rate from 30 to 60 fps when rendering with vsync enabled on the Lumia 550. If there are no downsides, shoudn't the change be applied in general?



---------- Původní zpráva ----------
Od: Sylvain Becker
Komu: SDL Development List
Datum: 28. 1. 2016 8:48:23
Předmět: Re: [SDL] SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
Quote:
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 mailing list

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


Joined: 09 Feb 2012
Posts: 179
hardcoredaniel wrote:
I found that the change also bumps the frame rate from 30 to 60 fps when rendering with vsync enabled on the Lumia 550. If there are no downsides, shoudn't the change be applied in general?


I'll look into applying it later this week. I've got a few devices I want to test it on first, before submitting it though.

-- David L.
Re: SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
DLudwig


Joined: 09 Feb 2012
Posts: 179
hardcoredaniel wrote:
I found that the change also bumps the frame rate from 30 to 60 fps when rendering with vsync enabled on the Lumia 550. If there are no downsides, shoudn't the change be applied in general?


I've been giving this a bit more thought. I like the idea of being able to use triple-buffering, but am not entirely sold on enabling it in all cases, for all apps, as it would use up more memory.

What about an SDL_HINT (set via a call to SDL_SetHint()) to adjust the D3D11 renderer's buffer-count?

-- David L.
SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
slvn


Joined: 06 Oct 2012
Posts: 88
Hello,


Just wanted to remind my investigations when using the triple buffering:


I saw improvements with the test I sent you before, that draw full-speed a square moving in one direction.


With double-buffering, line was like "interrupted", and the squares were scattered as packet.

Like if a function was sometimes a little bit more blocking ? or like a vsync missed ? (but the gap between two packages seems to be more than a vsync).

Maybe it could also be some GC, or some thread underneath ...



With triple-buffering, line was smooth and homogeneous.

Please give a try to this test-case if you haven't tested yet.


I remind also what I tested:

My old WP8 (2-buffering) app that was running smoothly on WP phone, still ran smoothly after the phone upgraded to Win10.

As soon as, I re-compiled the app for Win10 (with some new SDL2 code), and tested it on win10 phone, it started to be non-smooth.

After adding 3-buffering, it became smooth again.



Could the V-Sync be not enable before ?

Could the app be automatically promoted to 3-buffering before ? (Maybe there is  a way to query buffering/vsync ?)


Cheers,

Sylvain





On 12 June 2016 at 23:57, DLudwig wrote:
Quote:



hardcoredaniel wrote:

I found that the change also bumps the frame rate from 30 to 60 fps when rendering with vsync enabled on the Lumia 550. If there are no downsides, shoudn't the change be applied in general?




I've been giving this a bit more thought. I like the idea of being able to use triple-buffering, but am not entirely sold on enabling it in all cases, for all apps, as it would use up more memory.

What about an SDL_HINT (set via a call to SDL_SetHint()) to adjust the D3D11 renderer's buffer-count?

-- David L.


_______________________________________________
SDL mailing list

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




--
Sylvain Becker
SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
hardcoredaniel
Guest

I like the idea of a hint, so that people can make a choice and trade memory for FPS. Although some years from now we probably won't mind the additional memory anymore.


---------- Původní zpráva ----------
Od: DLudwig
Komu:
Datum: 12. 6. 2016 23:58:12
Předmět: Re: [SDL] SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
Quote:







hardcoredaniel wrote: I found that the change also bumps the frame rate from 30 to 60 fps when rendering with vsync enabled on the Lumia 550. If there are no downsides, shoudn't the change be applied in general?


I've been giving this a bit more thought. I like the idea of being able to use triple-buffering, but am not entirely sold on enabling it in all cases, for all apps, as it would use up more memory.

What about an SDL_HINT (set via a call to SDL_SetHint()) to adjust the D3D11 renderer's buffer-count?

-- David L.

_______________________________________________
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
We are already some years, from some years, from caring about additional memory Smile

I agree the hint is the fastest way to please anyone and to be more flexible.

But that's one more legacy hint ...


Maybe, a little bit more investigation before choosing the hint solution ...

btw, there is a VC2015 RC 3, could this have some positive effect ?













On 13 June 2016 at 09:40, hardcoredaniel wrote:
Quote:
I like the idea of a hint, so that people can make a choice and trade memory for FPS. Although some years from now we probably won't mind the additional memory anymore.


---------- Původní zpráva ----------
Od: DLudwig
Komu:
Datum: 12. 6. 2016 23:58:12
Předmět: Re: [SDL] SDL_RenderCopy very slow on Lumia 520 Windows Phone 8.1
Quote:







hardcoredaniel wrote: I found that the change also bumps the frame rate from 30 to 60 fps when rendering with vsync enabled on the Lumia 550. If there are no downsides, shoudn't the change be applied in general?




I've been giving this a bit more thought. I like the idea of being able to use triple-buffering, but am not entirely sold on enabling it in all cases, for all apps, as it would use up more memory.

What about an SDL_HINT (set via a call to SDL_SetHint()) to adjust the D3D11 renderer's buffer-count?

-- David L.



_______________________________________________
SDL mailing list

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


_______________________________________________
SDL mailing list

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




--
Sylvain Becker