Archived

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

CountOfMonteChristo

What is the Pure Device?

Recommended Posts

I''m not sure bout this but to what I know

D3DCREATE_HARDWARE_VERTEXPROCESSING is asking your graphic card to use its power to do all the processing for you instead of asking DX to handle it for you.

Well, todays grahpic cards are becoming more and more advance, but I still think that most of them still unable to use purely hardware processing.

Most of the time we need the help of DX, this is my opinion, do let me know if I''m wrong, thx

Share this post


Link to post
Share on other sites
Hello,

From my point of view, a "Pure device" may be just state some hardware that do not support any programming compatibility. For example, those devices only provide fix-lighting function or fix-vertex processing function. However, they may not provide and flexibility like vertex shader and pixel shader.

Let me know if I am worng!

Nachi

Share this post


Link to post
Share on other sites
Pure device is going to be faster because of the issues posted above and because it can cut time by not querying hw for states. Pure device is the fastest device that exposes your video card''s hardware capability. For example, my gf2 used as a pure device will only allow hw t&l not sw t&l, thus using fastest driver paths. You want to use pure device if you care about getting max speed out of your card and its drivers. It''s the preferred device to use for games if you can afford to keep local copies of dx state vars.

Share this post


Link to post
Share on other sites
Hmmm.... I still don't see any advantages, or why the pure device should be faster. After all, if the pure device takes care of vertex data in hardware, it's essentially the same as HARDWARE_VERTEXPROCESSING, which also takes care of all vertex processing in hardware.
It can't be that most cards still only handle part of their processing in hardware. After all, that would be MIXED_VERTEXPROCESSING.

<SPAN CLASS=smallfont>quote:
Original post by JD
For example, my gf2 used as a pure device will only allow hw t&l not sw t&l, thus using fastest driver paths.
</SPAN>


Isn't that the same as using it as D3DCREATE_HARDWARE_VERTEXPROCESSING?

Here's how I see it:
HARDWARE_VERTEXPROCESSING = hardware vertex processing + being able to get device states.
PUREDEVICE = hardware vertex processing + -not- being able to get device states.

Which of the two sounds better to you? Or is something wrong with my definition of the two methods?.

[Edited by - CountOfMonteChristo on January 5, 2010 3:14:26 PM]

Share this post


Link to post
Share on other sites
PUREDEVICE sounds better to me. WIth proper code planning there is no need to query the hardware for it''s state.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites
One thing I''ve noticed is that it is NOT impossible to get device states. You just have to do it via State Blocks. And since you can combine multiple SetRenderState calls in one state block it is more efficient. I had code that was broken when I ran it on my new ATI Radeon 8500LE (which incidentally I bought BEFORE they took the dark path and started running this flash ad) and I found that it wasn''t too much work to change to state blocks and I got a measurable increase in FPS.

Share this post


Link to post
Share on other sites
We''re really getting outside my area of knowledge here so I don''t want to speculate too much. But I don''t think the actual rendering is any faster. I think the fact that you are using state blocks does two things...

1. Combines multiple SetRenderState() calls into one faster call, thus improving your application''s performance.

and

2. I would bet that internally, since the card manufacturers know you cannot query certain device properties, they are able to optimise parts of the driver code.

These are mostly educated guesses on my part... a search on google returns almost no useful information on the topic of pure devices. If anyone else in the forum has some good info on what really is different behind the scenes I would love to hear it.

Share this post


Link to post
Share on other sites
quote:
Original post by Bas Paap
Hmmm... So, if I gather all this correctly... The pure device is actually -faster- than normal hardware rendering? How is that possible?


No, not faster at actual rendering. Using a PURE device simply means less stuff is done in D3D between your code and the driver.

D3D does a lot of things such as checking for redundant states, checking parameters, batching small draw calls together, caching the current values of all states (for Get* calls) etc.

As well as that, D3D provides software vertex processing and even emulation (such as point sprites) in places.

If your application 100% definately NEVER needs any of this help (or softare vertex processing etc) from D3D (most applications DO need that help), then you can save some CPU clock cycles by using a PURE device which turns off all that checking.

When you create a device as PURE, then you can only use features which are DEFINATELY supported in hardware. So if you want to use D3D transformation & lighting, the hardware MUST be at least T&L capable. If you want to use shaders, the hardware MUST be able to do shaders. If you want to use point sprites, the hardware MUST be able to support them natively (i.e. rather than D3D emulating them with billboards!)



Maybe it'll be helpful with a couple of diagrams (of sorts) showing what goes between your application and the graphics chip driver,

A normal NOT pure D3D device:

+----------------------------+
|Your application |
+----------------------------+
|D3D API (COM interface etc) |
+----------------------------+
|D3D Parameter checking |
+----------------------------+
|D3D Redundant State checking| ||
+----------------------------+ ||
|D3D State caching | _||_
+----------------------------+ \ /
|D3D Optimisations (batching)| \/
+----------------------------+
|D3D Software data processing|
+----------------------------+
|D3D DDI |
+----------------------------+
|Device Driver |
+----------------------------+


A PURE D3D device:

+----------------------------+
|Your application |
+----------------------------+ ||
|D3D API (COM interface etc) | ||
+----------------------------+ _||_
|D3D DDI | \ /
+----------------------------+ \/
|Device Driver |
+----------------------------+



In summary it can save some CPU cycles - but it'll be a lot less tolerant of mistakes and inefficient use and you have no software backup. If an app runs more slowly after changing to a pure device, it's a good sign that the extra D3D processing was helping that app so should be left alone.



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

[edited by - S1CA on November 1, 2002 10:02:21 AM]

[edited by - S1CA on November 1, 2002 12:21:17 PM]

Share this post


Link to post
Share on other sites
Excellent! Many thanks to all who replied to this thread. And thanks to S1CA for finally being able to provide a good definition of what the pure device actually is. Because, as l99057j said, a search on Google yields practically no good information on pure devices. Even the SDK help file only seems to spend about one paragraph on them.

So, summing up: The pure device can be used to speed up your application by getting rid of (among others) unnecessary D3D checking. This comes at a cost, however, since everything you need to do has to be supported by the hardware.

That''s about it, right? Excellent. Thanks to you all for the input! Somebody should really do an article on this... The Articles & Resources section could use an article on pure devices. *looks at S1CA*

Thanks again, everyone! Ah, don''t these helpful threads feel good?

Share this post


Link to post
Share on other sites