Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Some problems make FPS too high #48

Open
Hatsusakura6487 opened this issue May 15, 2017 · 4 comments
Open

Some problems make FPS too high #48

Hatsusakura6487 opened this issue May 15, 2017 · 4 comments
Labels

Comments

@Hatsusakura6487
Copy link

I tried Direct3D11DemoApp and found a problem.
Normal operation FPS will exceed 8000 or even close to 10000.
But Direct2D1WinFormDemoApp is running normally, FPS is very stable at 60.
I tried to render some objects, the result is rendering is normal, but FPS is still too high, close to 4000.
So...Where is the problem?

@xoofx
Copy link
Member

xoofx commented May 15, 2017

FPS is stable only if you are using for example a DXGI swapchain with a Present that explicitly says that you want to wait a frame (the old "VTBL"). Otherwise can't make any diagnostics from your issues, it could be also either that you are calculating FPS in a wrong way...

Bottom line, unlikely an issue in SharpDX.

@xoofx xoofx added the question label May 15, 2017
@Hatsusakura6487
Copy link
Author

I'm using Fraps to view the fps...
new ModeDescription(demoConfiguration.Width, demoConfiguration.Height, new Rational(60, 1), Format.R8G8B8A8_UNorm)
I checked this place but the frame rate was set correctly...
Is it possible that this code doesn't work? Or is there a problem with my hardware or software settings?
I feel that there is no successful initialization ...

@Hatsusakura6487
Copy link
Author

I think I found the problem.
I set a breakpoint after the initialization function, and found in the variable factory(SharpDX.DXGI.Factory) and variable _swapChain(SharpDX.DXGI.SwapChain) there are some error messages.

factory.Adapters[0].Description correctly shows my graphic card, and factory.Adapters[0].Outputs[0].Description also correctly shows my monitor. But factory.Adapters[0].Outputs[0].FrameStatistics threw an exception of type 'SharpDX.SharpDXException': HRESULT: [0x887A0001], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_INVALID_CALL/InvalidCall]

_swapChain.FrameStatistics threw an exception of type 'SharpDX.SharpDXException': HRESULT: [0x887A0004], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_UNSUPPORTED/Unsupported]

I think that this error has led to a problem with FPS... But I do not know how to fix this error... So how do we fix the error?

@xoofx
Copy link
Member

xoofx commented May 18, 2017

debugging objects via the debugger can throws error when inspecting properties. That's unrelated.

But in your code, if you have try/catch, and your code while running is throwing errors, it will modify the FPS... but usually it will slow it down.

Again, your problem is elsewhere, an invalid setup of the rendering, usage of present, and without any details about your code, I can't make any diagnostics.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants