Jump to content

Vsync = 100% CPU usage


entryway

Recommended Posts

VSync = 100% CPU core usage even on MAP01. Why does it happen?

On 2 cores system:
PrBoom-Plus without VSync -> 1500fps -> 50% CPU usage
PrBoom-Plus + VSync -> also 50% CPU usage :(
PrBoom-Plus + VSync + forcing one core with SetProcessAffinityMask -> 5% CPU, lol

GZDoom with VSync -> 50% CPU

Forcing one core 'fixes' high CPU usage. WTF?

Simple test application also works as intended when VSync is enabled - about 5% loading

Share this post


Link to post
Graf Zahl said:

My guess is it's a driver issue. Maybe it actively waits inside the driver if it runs on multiple cores.

But it does not affect my simple application. Only 1-2% CPU usage there.

This code also does not help.

D_Display()
{
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  SDL_GL_SwapBuffers();
}

Share this post


Link to post
entryway said:

But it does not affect my simple application. Only 1-2% CPU usage there.

By some reasons now it also takes 50%, heh.

Share this post


Link to post

AFAIK, unless your application does nothing but passive OS event dispatching/handling, it WILL use all the power of a core unless you include a command explicitly yielding thread control back to the OS.

Now, VSYNC waiting might or might not do just that depending on the implementation at the driver or even at the SDL-driver interaction level.

Share this post


Link to post

I actually like the horizontal banding effect (from lack of Vsynch) that goes on during a sustained earthquake.

As an aside, the lack of Vsynch is very noticeable in the ZDoom map I'm presently working on for the monochrome project, where I've made a damage sector that flashes between 255 and 32 light level in 1 tic (!). I'd take a screenshot, but well, screenshots don't work that way. :P

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...