Sign in to follow this  
Followers 0

Vsync = 100% CPU usage

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

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

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

Does lack of vertical synchronization get noticed by the human eyes?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0