Archived

This topic is now archived and is closed to further replies.

Help: IDirect3D8::CreateDevice and D3DCREATE_PUREDEVICE

This topic is 6114 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

It looks like I am unable to read the viewport because the D3D Framework hs determined that my Video card is CAP of using the D3DCREATE_PUREDEVICE behavior as part of CreateDevice. As you can see from the docs D3DCREATE_PUREDEVICE does not support any Get*. From the docs here is a behavior option for CreateDevice:
  D3DCREATE_PUREDEVICE Specifies that Direct3D does not support Get* calls for anything that can be stored in state blocks. It also tells Direct3D not to provide any emulation services for vertex processing. This means that if the device does not support vertex processing, then the application can use only post- transformed vertices. 
What is the recomended behavior for CreateDevice? Is pure bad or good? Can someone with a Radeon tell me if the CAPS have a "yes" specified for D3DCREATE_PUREDEVICE under:
  Radeon 7200 / Radeon DDR ---- D3D Device Types --------- HAL -------------- CAPS -------------------DEVCAPS 
Thanks Edited by - sdoherty55 on December 29, 2001 11:37:28 AM

Share on other sites
Setting the PUREDEVICE flag on CreateDevice() is an *optional* thing *YOU* do when calling CreateDevice() to tell D3D not to cache any device state, and not to emulate anything.

The PUREDEVICE cap in the caps bits indicates whether you have this *option* available. Drivers for T&L hardware expose this option when they can handle the input from D3D directly without any D3D interference. It actually dosen''t have much to do with the hardware itself.

If you don''t set the PUREDEVICE flag when you call CreateDevice(), then you''ll be able to use all the Get* calls just fine.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share on other sites
just curious - why are you using a pure device? You may have some decent reasons for using it, but most of the time, you don''t need to worry about this.

Share on other sites
S1CA, CrazedGenius,

It is being set by default because the D3D Framework is determined that my VideoCard is CAP of setting the flag. Here is the section of code from D3DAPP.CPP:

  // Confirm the device/format for HW vertex processing if( pDevice->d3dCaps.DevCaps&D3DDEVCAPS_HWTRANSFORMANDLIGHT ) { if( pDevice->d3dCaps.DevCaps&D3DDEVCAPS_PUREDEVICE ) { dwBehavior[f] = D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE; if( SUCCEEDED( ConfirmDevice( &pDevice->d3dCaps, dwBehavior[f], formats[f] ) ) ) bFormatConfirmed[f] = TRUE; } if ( FALSE == bFormatConfirmed[f] ) { dwBehavior[f] = D3DCREATE_HARDWARE_VERTEXPROCESSING; if( SUCCEEDED( ConfirmDevice( &pDevice->d3dCaps, dwBehavior[f], formats[f] ) ) ) bFormatConfirmed[f] = TRUE; }

As you can see, the first if block sets the pure flag. Clearly, I can modify the code so that it is not turned on, but why does Microsoft turn it on first if it is not a best practice. Is it bad to use the GET* functionality from the pd3dDevice? Is this CAP turned on for other Video cards such as G-FORCE?

Thanks

Edited by - sdoherty55 on December 29, 2001 3:09:55 PM

Share on other sites
It is available for DX8 level GeForce drivers.

The framework code is mainly for the SDK samples. It doesn''t necessarily represent "best practice", more like "most understandable code".

The Get* methods aren''t too slow, but generally aren''t too necessary - if you''ve Set* a state, then you should know what its value is anyway!. That''s what the SDK samples do, so because they never need to do any Get*, they set the PURE flag.

A PURE device can be faster than a non-pure one if used with care. If used incorrectly it''ll actually be slower!.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5

• 10
• 11
• 14
• 10
• 25
• Forum Statistics

• Total Topics
632649
• Total Posts
3007644
• Who's Online (See full list)

There are no registered users currently online

×