I recently upgraded my PC which included a new SSD, CPU, graphics card (Nvidia GTX570). I also did a fresh install of Windows7 and Visual Studio 2010.

After i upgraded my PC, i continued working on a SlimDX based application i'm working on in VS2010. I've noticed that the FPS of my rendered scences is horrific now (around 10FPS), whereas the exact same code prior to upgrade was running my application at around 90FPS.

Hi Sneezy,Drivers are already up to date. I should mention that the same code works fine on my work PC, which runs a NVIDIA Quadro FX 1800. It is only my home PC (the one i upgraded) where i am experiencing this issue.

I had noticed that i was getting a lot of warnings from Direct3D9. This is the warning i am getting "Direct3D9: (Warn): Ignoring redundant SetSamplerState Sampler: 0, State:##". This is occuring numerours times per frame. I did notice this before, so i set directX to retail mode, which helped a lot on my work PC, but has no effect on my home PC.I'm curious about this warning. Is it referring to shader variables that are being set? I dont understand why it would have such a dramatic effect on my home PC, but no effect on my work PC, if this is the problem at all.

The redundant state warning can be safely ignored - it's just the debug runtime telling you that it's filtering out a redundant state change, but it won't have any impact (not measurable anyway, unless you're doing 10s of 1000s of these per frame).

Have you checked your power saving settings? If you're going into a power-saving mode all the time, or you're forced into one through control panel settings, this kind of perf drop off can happen. You need to check both your Windows control panel and your gfx card control panel here.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.

Switching D3D between debug and retail modes usually has a noticeable performance change. Double check the debug output in Visual Studio to see if you actually load D3D9.dll or D3D9d.dll (the extra 'd' means debug).

Make sure your motherboard drivers are up to date.

If that doesn't help, you could also try some experiments to identify the issue:

1. Make sure you aren't doing something weird with the settings you pick, for example if you always pick the best quality antialiasing that might be both better looking and slower on newer hardware. Also make sure you're not using a debug build!
2. Swap the graphics card back to the 470. Does that make any difference?
3. Get hold of PerfHUD and try to find out where the bottleneck is. Is it the CPU or GPU for example?

I don't think either the debug runtimes or a debug build will have that level of performance impact. I'm suspecting that the info about hardware instancing is not really too relevant here either; it's symptomatic for sure but the cause is not directly connected.

A thought - also check that you're definitely getting D3DCREATE_HARDWARE_VERTEXPROCESSING.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.

Thanks for the suggestions guys. Will have to wait a few more hours before im home to try some of these solutions, but i can answer a few questions now.

@mhagain - I'll check power saving settings when im home. I only get this problem specifically when im using hardware instancing, otherwise framerate is fine, or perhaps what im drawing outside of the intancing cases isnt intensive enough for me to notice an issue. I have already tried specifically creating the device with HARDWARE_VERTEXPROCESSING as i thought that might be an issue as well. I can confirm that the device is successfully created with these flags, so i can only assume this isnt the problem.

@Adam_42 :
1. I've tried completely disabling antialiasing to no effect. When you say "Make sure you are not using a debug build", what do you mean exactly? Do you mean make sure i have set the DirectX Control Panel settings to use the retail version rather than debug? If so i can confirm i have set this to the retail version.
2. I can't swap the graphics card back as the reason i upgraded my hardware is the GTX470 died and needed to be replaced. I shouldnt need to do this anyway because, as i mentioned, my application runs fine on my work PC with the exact same code.
3. I'll download PerfHUD when im home and see what that tells me.

The only things i can think of that may be causing problems are:
1. Something to do with Windows or VS2010 settings (i performed a fresh install of both so any previous settings i had would have been wiped).
2. DirectX9 or Graphics card settings.
2. Graphics card struggling with DirectX9 / Shader Model 3.0 for some reason?

When I said debug build I thought the compiler settings could be making you CPU bound, but that seems highly unlikely if you can toggle instancing on and off and see a speed difference.

The reason I suggested trying the 470 out, was as a quick way to find out it it was the new graphics card causing the issues, or something else going on with the new PC.

I'd also suggest considering a fourth option - there's a bug in the code that's only showing up on the new PC. If the instancing code and vertex shader isn't too huge it might be worth posting it here.