Really weird performance problem with Direct3D

Started by
14 comments, last by Marc aka Foddex 20 years ago
FYI,
When I had this problem (see previous post of mine) I was using ther _REF device! As a stab in the dark, try using the _REF device but I''m willing to bet your problem won''t go away.

I was also using DirectX 8.



"Good code will come and go, but bad code sticks around."
"Good code will come and go, but bad code sticks around."
Advertisement
quote:Original post by TreborZehn
FYI,
When I had this problem (see previous post of mine) I was using ther _REF device! As a stab in the dark, try using the _REF device but I''m willing to bet your problem won''t go away.

I was also using DirectX 8.



"Good code will come and go, but bad code sticks around."


Hi! How do I know whether or not I use the _REF device? I assume that with "_REF device" you mean some identifier that has the text _REF in it, right?
My code, where devices are concerned, looks like this:

m_device = (struct _GUID *)&IID_IDirect3DHALDevice;....m_d3d->EnumZBufferFormats( *m_device, EnumZBufferCallback, (VOID*)&ddpfZBuffer );....if( IsEqualIID( *m_device, IID_IDirect3DHALDevice ) )		ddsd.ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;	else		ddsd.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;....if( FAILED( m_d3d->CreateDevice( *m_device, m_ddbbuff, &m_d3ddevice)))


Does look alright, doesn''t it? Please take a look at my source code (URL mentioned earlier), maybe you spot something unusual....

Marc
I'm a little confused. I'm talking about C++ here but it looks like you might be using a managed version of DirectX? Anyway, D3D code usually contains a statement something like this...

g_pD3D->CreateDevice( D3DADAPTER_DEFAULT,     D3DDEVTYPE_HAL, hWnd,    D3DCREATE_SOFTWARE_VERTEXPROCESSING,    &d3dpp, &g_pd3dDevice )  


To ensure that your problem isn't a hardware problem you can use a "reference" device that's part of the SDK that does everything in software. To use it you specify D3DDEVTYPE_REF instead of D3DDEVTYPE_HAL. You'd have to look in your documentation of your "CreateDevice" call to see how to use it.

"Good code will come and go, but bad code sticks around."

[edited by - TreborZehn on March 24, 2004 5:13:19 PM]
"Good code will come and go, but bad code sticks around."
quote:Original post by TreborZehn
I'm a little confused. I'm talking about C++ here but it looks like you might be using a managed version of DirectX? Anyway, D3D code usually contains a statement something like this...

g_pD3D->CreateDevice( D3DADAPTER_DEFAULT,     D3DDEVTYPE_HAL, hWnd,    D3DCREATE_SOFTWARE_VERTEXPROCESSING,    &d3dpp, &g_pd3dDevice )    


To ensure that your problem isn't a hardware problem you can use a "reference" device that's part of the SDK that does everything in software. To use it you specify D3DDEVTYPE_REF instead of D3DDEVTYPE_HAL. You'd have to look in your documentation of your "CreateDevice" call to see how to use it.

"Good code will come and go, but bad code sticks around."

Hi! Thanks for taking the time to think of a solution for my problem, but I'm afraid you didn't notice that I'm using DirectX 7.0. The D3DADAPTER_xxxx identifiers do not appear in any of DirectX 7.0's header files :-/

[edited by - Marc aka Foddex on March 24, 2004 5:21:34 PM]
There are two kinds of devices you can use with Direct3D (nominally): HAL and REF. HAL is the hardware layer--the normal one that you''ll generally use. REF is software-only. It''s used to test for correctness. If your code is doing wrong things, and you suspect a driver issue, you can run as a REF device and see what the proper behavior is, since the driver isn''t involved.

HAL is fast. REF is slooooow. It''s only ever used for debug purposes, and in demos to show off features even when cool hardware isn''t present. For game code, you''ll want to make sure your device is HAL, maybe with a command line for REF if you want to.

Oh, and my goodness, use DirectX9. So much tastier.

I like pie.
[sub]My spoon is too big.[/sub]
quote:Original post by RenderTarget
There are two kinds of devices you can use with Direct3D (nominally): HAL and REF. HAL is the hardware layer--the normal one that you''ll generally use. REF is software-only. It''s used to test for correctness. If your code is doing wrong things, and you suspect a driver issue, you can run as a REF device and see what the proper behavior is, since the driver isn''t involved.

HAL is fast. REF is slooooow. It''s only ever used for debug purposes, and in demos to show off features even when cool hardware isn''t present. For game code, you''ll want to make sure your device is HAL, maybe with a command line for REF if you want to.

Oh, and my goodness, use DirectX9. So much tastier.

I like pie.


Yeah I know DX9 is cooler than DX7 But I''m coding for a company who''s customers have outdated hardware and software. So I''m kinda stuck with DX7

But the good news is:
I SOLVED IT! :)

I updated my MSVC++6 version by installing Service Pack 5 and voila: all the problems are gone. I was linking against some old outdated lib''s I guess w00t!

This topic is closed to new replies.

Advertisement