Skip to main content
GameDev.net gamedev.net
🔒 Locked

REF - SW difference

Started by GambitSnax Feb 18, 2007 at 7:30 AM 3 replies 1.2k views
Original Post
GambitSnax
GambitSnax
I've been trying to find some good information on the major differences between the device types of REF and SW. All i've managed to gather is that SW is a purely software device (running all the calculations on the CPU i imagine?) and REF is semi-software / semi-hardware. Does anyone have a better explanation? When the REF is set up, does it simply know what features are supported by your graphics cards, and calls the rest on the CPU? I've been to 3 different directx text books and they all seem to just gloss over it. Is it fair to say that if you aren't using a HAL device, that you will experience a severe loss in performance? Cheers.
IndyJones
IndyJones
REF and SW device types are the same - the only difference is that REF uses the Reference Rasterizer that comes with Direct3D and SW uses a custom-written Software Rasterizer (which has been registered with IDirect3D9::RegisterSoftwareDevice before). Check out the documentation of D3DDEVTYPE on MSDN for more information.

Quote:

Is it fair to say that if you aren't using a HAL device, that you will experience a severe loss in performance?

Yep - that's right. See also here.
sirob
sirob
A HAL device (one created with D3DDEVTYPE_HAL) is a device which performs Rasterization in hardware. There are no limitations on how it performs the other parts of the pipeline, only on Rasterization.

So, a HAL device does not have to be hardware-only. For example, the older laptop integrated graphics chips used to perform software-based vertex-processing, but were still HAL devices, since they perform rasterization in hardware.

A SW device is a device which performs Rasterization in software, and this usually means it performs all it's operations in software. There are no SW devices installed by default, so one has to be installed manually, and frankly, they are quite rare (The only one I know of is SwiftShade, and that was DX8 era).

A REF device is a special device used *for development purposes only*. It is not created in order to be quick, but rather is supposed to act as a reference (hence the REF) to how a hardware device should act. The REF device is not installed by default either, and in order to use it you need to have the DX SDK installed. You should only use the REF device if you suspect the hardware/driver is not acting as it should, and need to compare with a correctly-implemented device.

As an added feature, the REF device supports nearly all features available on any card, so it is a good way to test and develop support for features that are not available on your hardware.

Both SW and REF devices are *extremely* slow compared to any HAL device (even those doing software vertex processing). A normal 1024x768 scene has over 700k pixels per frame, and a computer's CPU simple isn't designed to perform that task on that scale.

For any production software, you would probably want to use HAL only devices.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
jollyjeffers
jollyjeffers
Quote:
Original post by sirob
A SW device is a device which performs Rasterization in software, and this usually means it performs all it's operations in software. There are no SW devices installed by default, so one has to be installed manually, and frankly, they are quite rare (The only one I know of is SwiftShade, and that was DX8 era).
Yup, with GPU's so easy to get hold of theres very little market for a software device. Pixomatic is another one and there was a D3D9 software rasterizer from Microsoft but its pretty hard to find on the MSDN archives.


I'm sure Demirug can fill in the details (if he sees this thread of course), but I'm pretty sure he was experimenting with a D3D10 software device at one point. Think he got part some of the D3D10 tutorials compiling and running on D3D9 hardware this way - also seem to remember him commenting on the possibilities of multi-core CPU's for software rasterization...

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
Demirug
Demirug
Quote:
Original post by jollyjeffers
Yup, with GPU's so easy to get hold of theres very little market for a software device. Pixomatic is another one and there was a D3D9 software rasterizer from Microsoft but its pretty hard to find on the MSDN archives.


SwiftShader and pixomatic doesn‘t provide Direct3D Software devices. This means they could not be registered with the D3D9 runtime. Therefore they replace the runtime, too.

The D3D9 software device from Microsoft is very limited. If you look at the feature set it looks like that it is the old DX7 RGB device.

Quote:
Original post by jollyjeffers
I'm sure Demirug can fill in the details (if he sees this thread of course), but I'm pretty sure he was experimenting with a D3D10 software device at one point. Think he got part some of the D3D10 tutorials compiling and running on D3D9 hardware this way - also seem to remember him commenting on the possibilities of multi-core CPU's for software rasterization...

hth
Jack


Some time ago I have prototyped two systems. One of them translates D3D10 calls to D3D9 calls when possible. This made it possible to use one API for all the (shader) GPUs out there. The second one was a pure software rendered. I wanted to make them compatible to the software adapter interface that D3D10 uses but the documentation is a mess. Maybe I will work on these things again even if the documentation does not improve.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.