Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Get rid of the state cache inside RenderTarget  (Read 13912 times)

0 Members and 4 Guests are viewing this topic.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Get rid of the state cache inside RenderTarget
« Reply #15 on: December 17, 2015, 07:58:17 pm »
SFML master: ~1100 FPS
useVertexCache = false: ~450 FPS

Anything else to test?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: Get rid of the state cache inside RenderTarget
« Reply #16 on: December 18, 2015, 08:59:45 am »
With caching: ~57 FPS
Without caching: ~59 FPS

I have *no* idea why it's so damn slow in both cases, but at least there's a slight effect.

02:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 660 Ti] (rev a1)

SpeCter

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Get rid of the state cache inside RenderTarget
« Reply #17 on: December 18, 2015, 11:07:27 am »
With caching: ~57 FPS
Without caching: ~59 FPS

I have *no* idea why it's so damn slow in both cases, but at least there's a slight effect.

02:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 660 Ti] (rev a1)

Driver enabled vsync maybe?
I think in this case the 2 fps difference is more likely just noise and not something which comes from caching/non-caching.

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: Get rid of the state cache inside RenderTarget
« Reply #18 on: December 18, 2015, 01:40:52 pm »
Quote
Driver enabled vsync maybe?
Nope, it's not vsync. With 1024 sprites I get ~147.

Quote
I think in this case the 2 fps difference is more likely just noise and not something which comes from caching/non-caching.
I don't think so, as I've watched the numbers for like a minute. It's reproducible as well.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Get rid of the state cache inside RenderTarget
« Reply #19 on: December 20, 2015, 03:31:34 pm »
SFML master: ~186 FPS
Disabled vertex cache: ~75 FPS

Intel HD Graphics 3000
(I had to use a small image or the framerate was abysmal)

By the way, the code needs a #include <numeric> for std::accumulate(). It should allocate the sprites dynamically; I got a stack overflow.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Get rid of the state cache inside RenderTarget
« Reply #20 on: December 21, 2015, 05:44:26 pm »
Which texture are you guys using? These values don't sound right to me. I've used the OpenGL example's "texture.png":

Unmodified master branch: ~81 FPS
Vertex cache disabled: ~92 FPS

Geforce GTX 680 in a x64 release build of SFML.

Updated code:
(click to show/hide)

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: Get rid of the state cache inside RenderTarget
« Reply #21 on: December 21, 2015, 09:12:44 pm »
Mario: Used the same.

hobby

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Get rid of the state cache inside RenderTarget
« Reply #22 on: December 24, 2015, 07:21:48 pm »
Updated code:
...

GeForce GT610 2GB.
Using above code on master of 3 weeks ago, OpenGL example texture.jpg, x32 Release:
- With & without vertex cache ~ 4.6 FPS

I suspected that there's no difference due to fillrate limitation vs. low # of OpenGL calls, so I reduced texture size to 64x64:
sprites[i].setTextureRect(sf::IntRect(0, 0, 256/4, 256/4));

Results:
- With vertex cache - 140 FPS
- Without vertex cache - 83.5

Those of you that got negligible difference, could you re-run your tests with smaller texture sizes?