Jump to content
  • Advertisement
Sign in to follow this  
xfxsworld

help!!! Strange question about D3D on 780G hd3200...

This topic is 3572 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

hello everyone..i do not speak english and my english is weak... so hope somebody can understand what i said.. i have a simple d3d program, when i run it i found the FPS was only 2~3F/S, so i think maybe i need to update my ATI driver. before do update, i am try to running the D3D SDK sample Application, and i found every one it's ok.. the average of FPS was 90~~100F/S. oh...i don't know why... =====my code:========================================================================= // // Init D3D: // HRESULT hr = 0; // Step 1: Create the IDirect3D9 object. IDirect3D9* d3d9 = 0; d3d9 = Direct3DCreate9(D3D_SDK_VERSION); if( !d3d9 ) { ::MessageBox(0, "Direct3DCreate9() - FAILED", 0, 0); return false; } // Step 2: Check for hardware vp. D3DCAPS9 caps; d3d9->GetDeviceCaps(D3DADAPTER_DEFAULT, deviceType, &caps); int vp = 0; if( caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ) vp = D3DCREATE_HARDWARE_VERTEXPROCESSING; else vp = D3DCREATE_SOFTWARE_VERTEXPROCESSING; // Step 3: Fill out the D3DPRESENT_PARAMETERS structure. D3DPRESENT_PARAMETERS d3dpp; d3dpp.BackBufferWidth = width; d3dpp.BackBufferHeight = height; d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8; d3dpp.BackBufferCount = 1; d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; d3dpp.MultiSampleQuality = 0; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.hDeviceWindow = hwnd; d3dpp.Windowed = windowed; d3dpp.EnableAutoDepthStencil = true; d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8; d3dpp.Flags = 0; d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; // Step 4: Create the device. hr = d3d9->CreateDevice( D3DADAPTER_DEFAULT, // primary adapter deviceType, // device type hwnd, // window associated with device vp, // vertex processing &d3dpp, // present parameters device); // return created device if( FAILED(hr) ) { // try again using a 16-bit depth buffer d3dpp.AutoDepthStencilFormat = D3DFMT_D16; hr = d3d9->CreateDevice( D3DADAPTER_DEFAULT, deviceType, hwnd, vp, &d3dpp, device); if( FAILED(hr) ) { d3d9->Release(); // done with d3d9 object ::MessageBox(0, "CreateDevice() - FAILED", 0, 0); return false; } } d3d9->Release(); // done with d3d9 object === draw function=============================================================== Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000, 1.0f, 0); Device->BeginScene(); Device->EndScene(); Device->Present(0, 0, 0, 0); u see, i do nothing in the draw function... but the FPS was still only 2~3F/S.. Development Environment: AMD Athlon 64*2 5000+, memory: 2G integrated graphics card hd3200, Microsoft DirectX SDK (November 2008) vs2005, Hope someone can help me, thanks for all reply.

Share this post


Link to post
Share on other sites
Advertisement
How are you measuring your fps and how do you know it is accurate?
Especailly, since yopu aren't actually rendering any f per s

Share this post


Link to post
Share on other sites
Only thing I can think of is that your deviceType may be set to REF. You don't show this code here.

Share this post


Link to post
Share on other sites
to brekehan:

I do not list the code about FPS because I use it many times so I think it is no problem. I do nothing in render function because I just want to test if the problem is caused by render.

Actually I calculate FPS in a Update function.

thanks for reply!

Share this post


Link to post
Share on other sites
To ET3D:

I am sorry I miss the DeviceType. The DeviceType is D3DDEVTYPE_HAL.

Actuality I try to D3DDEVTYPE_HAL and D3DDEVTYPE_REF, but the result made me disappoint. when I run my program it is so slow......just like the top what I have said...

oh... :(

thanks for reply!

Share this post


Link to post
Share on other sites
You should really try drawing something. Like a rotating triangle.
Also, check the debug version of D3D's output.

Share this post


Link to post
Share on other sites
definitely something strange going on here. IGP's tend to have poor performance but 2-3fps is silly, especially if you can get higher from the SDK samples.

One thing to try:

Load up one of the latter tutorials from the SDK. Run it and ensure you get the results you expect - performance, correctness and so on. Now put a breakpoint on the CreateDevice() call and inspect all the parameters in your debugger. Do the same with your application and note down any differences.

If you have two sets of near-identical code but one works and the other doesn't you've got the near perfect situation for debugging and it should be plain sailing [grin]

I suspect you've not created the device you think you have, or are missing some parameter/option somewhere. Maybe you're forcing software vertex processing or the RefRast without realising it.

Quote:
Also, check the debug version of D3D's output.
Yes, especially if you're running in the IDE. Huge amounts of debug text tend to slow Visual Studio down, and if you're in an incredibly tight loop with a simple warning/error you could simply be timing how fast D3D can write to the console [lol]


hth
Jack

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!