Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've been working on D3D 10 for about 6 months and I have accumulated a basic framework. The thing is I get frame rate spikes.

Even when I have a simple cube on the screen each side with its own texture, every now and the the frame rate drops suddenly.

Any tips to try and find out what is causing it?

share|improve this question
add comment

1 Answer

First of all, you need to establish whether the spikes are occurring on the CPU or the GPU (or both). I'd recommend implementing basic (high-level) CPU/GPU profiling frameworks in your application, so you can measure and display the amounts of time that various operations are taking.

For the CPU, you can use QueryPerformanceCounter to measure timing of high-level operations in your frame, such as updating objects, physics (if any), frustum/occlusion culling, and rendering. For the GPU, you can use queries to get similar timing values out of the GPU. I wrote an article about that; it's written against the D3D11 API, but the same thing works in D3D10 with minor code modifications. Consult the ID3D10Query documentation for further details. Once you do this, you should be able to see the performance spikes in the data, and where in the frame the spikes are taking place. This will help focus further profiling efforts.

There are a few tools that can help drill down for more detailed information. AMD CodeAnalyst is a good free CPU profiling tool, and PIX is a free tool that works with D3D and your app to do GPU performance analysis and debugging.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.