Advertisement Jump to content
Sign in to follow this  
soloman

DX11 a refresh rate problem in directx11

This topic is 1761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

 

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?).

Share this post


Link to post
Share on other sites

 

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.

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

 

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!