Jump to content
  • Advertisement
Sign in to follow this  
Burnhard

Quick question about reference rasterizer.

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

Hi, How can I tell when d3d has chosen the reference rasterizer? My code is running very slowly when using 32 bit indices over 16 bit indices. The difference is very marked. So I'm assuming for some reason its choosing software vertex processing over hardware but I'm not using D3DCREATE_SOFTWARE_VERTEXPROCESSING. How can I tell what d3d is actually up to here? // Discover whether this card supports hardware vertex processing. D3DCAPS9 caps; HRESULT hr = m_pD3D->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps); if (SUCCEEDED(hr)) { // Hardware vertex processing supported? if (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) { devBehaviorFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING; // Pure device and HW T&L supported? if (caps.DevCaps & D3DDEVCAPS_PUREDEVICE) devBehaviorFlags |= D3DCREATE_PUREDEVICE; } }

Share this post


Link to post
Share on other sites
Advertisement
D3D can't/won't just swap to the RefRast and only under 'mixed' VP will it swap from hardware to software processing (even then I think you have to tell it to switch).

I don't have my documentation to hand, but you should be able to query the device for its creation parameters/flags which will give you back what you passed into ::CreateDevice() if you don't have control over that code yourself.

To be honest, you're probably just hitting some hardware performance problems - 32bit support isn't guaranteed and even then it's more a "more than 16bit" than a "32bit" flag - ISTR my GeForce 6800 only allowed upto 24bit indices for example.

hth
Jack

Share this post


Link to post
Share on other sites
The Reference Rasterizer, Software Vertex Processing, and Hardware Vertex Processing are 3 distinctly different things.

The Reference Rasterizer is a 100% software implementation designed for debug use only. It runs VERY slow (1-5fps) in most scenes. It is only available on machines that have the SDK installed, and should only be used for checking things that you think are implemented incorrectly in your GPU's driver. To create a REF device, the DEVTYPE_REF flag must be specified for the device type. You're using DEVTYPE_HAL, so it is not using the REF rast.

Software Vertex Processing is available on any machine, and simply means all Vertex Processing is done in software, instead of hardware. When this option is selected, ALL vertex processing is done in software, but rasterization is still done in hardware. Unlike the Ref rast, this is actually usable in some cases.

Since your app checks support for Hardware Vertex Processing when it starts up, it will create the device in HVP or SVP regardless of whether you're using 32bit indices or 16 bit indices. When using HVP, the device cannot switch to software mode if a feature is not available.

What all this means, in short, is that your application is either running in hardware mode every time, or in software mode every time, depending on the type of graphics hardware you're using (most likely, it's using hardware vertex processing).

There must be something else causing your performance decrease, either the overhead of using 32bit indices, or some other problem with your code.

If you post some of your rendering code, we might be able to help.

Share this post


Link to post
Share on other sites

Hi thanks for the above responses.

The code is not available for publication ;). However, it seems performance problems are probably limiting factors of the actual card, because even though it supports MaxVertexIndex 16,777,215 and we are passing in a mesh with around 1,143,618 triangles in, when we switch to 16 bit indices and batch multiple calls it is 10% quicker.

Strange but true.

Share this post


Link to post
Share on other sites
Just how are you measuring the performance, and what does PIX have to say on the matter?

It's quite possible that the performance decrease you mention is superficial. Give us some figures to work with. For example

20ms/frame up to 22ms/frame (50 to 45fps) in a complex scene is considerable.
3500fps down to 3150fps, while still arguably a 10% performance cut (under a different valuation) is not worth worrying about.

What I'm getting at is that the scene needs to be busy with a good balance of CPU/Vertex/Pixel load, running at a reasonably low frame-rate (say, < 100) before you can reliably gauge performance hits.

Admiral

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!