Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


a refresh rate problem in directx11


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 soloman   Members   -  Reputation: 126

Like
0Likes
Like

Posted 25 March 2014 - 06:40 PM

hi here. I  come across a interesting problem in d3dx11.

It's doesn't matter if i set the swapchain's refresh rate value(i set it to 60,the frame rate looks fine, and when i set it to 0,it's still run ok),so i just want to know that the refrence of refresh rate whether or not is useful in directx/>

Thanks any help



Sponsor:

#2 Jason Z   Crossbones+   -  Reputation: 5378

Like
0Likes
Like

Posted 25 March 2014 - 07:45 PM

Do you mean you want to control the framerate?  I assume you mean the settings in the swap chain creation parameters, right?  That will indicate the refresh rate of that display, but it won't throttle your actual framerate.  If you want to only render say 60 frames per second, then you need to manually throttle your rendering loop to sleep for a corresponding amount of time.



#3 soloman   Members   -  Reputation: 126

Like
0Likes
Like

Posted 25 March 2014 - 08:20 PM

Do you mean you want to control the framerate?  I assume you mean the settings in the swap chain creation parameters, right?  That will indicate the refresh rate of that display, but it won't throttle your actual framerate.  If you want to only render say 60 frames per second, then you need to manually throttle your rendering loop to sleep for a corresponding amount of time.

I know what exactly you meaning.But why my rotation entity still spinning when i set the swap chain's refresh rate to 0.According to your opinion,the swap frame motion should be shut down,and the scene should just pause.Why this not happend in dx's tutorials. thanks for your time.


Edited by soloman, 25 March 2014 - 08:23 PM.


#4 Matias Goldberg   Crossbones+   -  Reputation: 3710

Like
1Likes
Like

Posted 25 March 2014 - 11:04 PM

But why my rotation entity still spinning when i set the swap chain's refresh rate to 0

Because probably 0 is an invalid value and is being ignored or is just telling the driver to disable VSync.
Also, whatever number you provide, if VSync is off, the GPU will try to render as fast as it can. That could be 10hz, 40hz, 300hz or whatever number (but visible tearing on the monitor will happen)

Only a handful numbers of refresh rate values are valid and you have to ask DX11 to enumerate which ones are supported (depends on Monitor - GPU running the program)

#5 soloman   Members   -  Reputation: 126

Like
0Likes
Like

Posted 25 March 2014 - 11:45 PM

 

But why my rotation entity still spinning when i set the swap chain's refresh rate to 0

Because probably 0 is an invalid value and is being ignored or is just telling the driver to disable VSync.
Also, whatever number you provide, if VSync is off, the GPU will try to render as fast as it can. That could be 10hz, 40hz, 300hz or whatever number (but visible tearing on the monitor will happen)

Only a handful numbers of refresh rate values are valid and you have to ask DX11 to enumerate which ones are supported (depends on Monitor - GPU running the program)

 

thanks for your reply.I think i am kind of understand what are you saying.You mean that if i turn the VSync off,the rate in swapchain is nonsense.If i turn it on,there still just have a few values can be used(its dep on my output,right?).



#6 Jason Z   Crossbones+   -  Reputation: 5378

Like
0Likes
Like

Posted 26 March 2014 - 04:10 PM

 

Do you mean you want to control the framerate?  I assume you mean the settings in the swap chain creation parameters, right?  That will indicate the refresh rate of that display, but it won't throttle your actual framerate.  If you want to only render say 60 frames per second, then you need to manually throttle your rendering loop to sleep for a corresponding amount of time.

I know what exactly you meaning.But why my rotation entity still spinning when i set the swap chain's refresh rate to 0.According to your opinion,the swap frame motion should be shut down,and the scene should just pause.Why this not happend in dx's tutorials. thanks for your time.

 

Have you looked at the documentation for the parameter that you are setting to 0?  I assume you are talking about the DXGI_MODE_DESC is where you are setting the refresh rate to 0 - is that right?  Based on the comments in this page, you are probably entering an invalid refresh rate that isn't available on your display (0 Hz is obviously invalid).  Are you enumerating the refresh rates that your monitor supports, or are you just entering a hard coded value?

 

In any case, setting the refresh rate to 0 will not stop your rendering.  That depends completely on how your main loop is set up and how you are responding to the paint requests for your window.  It is perfectly valid to have two separate windows being rendered by the same process - if the refresh rate specified in the swap chain controlled the rendering of a frame, how would the two interact?  They couldn't exist together, which is why the rendering speed is controlled by your application instead.



#7 Mona2000   Members   -  Reputation: 629

Like
0Likes
Like

Posted 26 March 2014 - 05:45 PM

Based on the comments in this page, you are probably entering an invalid refresh rate that isn't available on your display (0 Hz is obviously invalid).

0 is not invalid, it lets DXGI decide (typically your desktop refresh rate).



#8 Jason Z   Crossbones+   -  Reputation: 5378

Like
0Likes
Like

Posted 26 March 2014 - 07:06 PM

 

Based on the comments in this page, you are probably entering an invalid refresh rate that isn't available on your display (0 Hz is obviously invalid).

0 is not invalid, it lets DXGI decide (typically your desktop refresh rate).

 

It is invalid in the sense that it isn't a correct refresh rate.  The OP said he was trying to set the refresh rate to 0 and expected that the rendering would stop - so if he doesn't get the refresh rate that he is asking for, then I would consider that to be an invalid input.



#9 Matias Goldberg   Crossbones+   -  Reputation: 3710

Like
0Likes
Like

Posted 26 March 2014 - 11:28 PM

You mean that if i turn the VSync off,the rate in swapchain is nonsense.If i turn it on,there still just have a few values can be used(its dep on my output,right?).

Yes. That's what I meant.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS