CPU hit when using D3DCREATE_MIXED_VERTEXPROCESSING

Started by
3 comments, last by reltham 18 years, 7 months ago
I've created my d3d device using D3DCREATE_MIXED_VERTEXPROCESSING so that indexed vertex blending skinning works (it isn't supported by the hardware on my gpu card). The problem is, it slows down my rendering big time compare to using D3DCREATE_HARDWARE_VERTEXPROCESSING, even when I'm not drawing any skinned objects. I'm also calling "g_pd3dDevice->SetSoftwareVertexProcessing( FALSE )" on all geometry that doesn't use skinning, but this makes no difference. Has anyone else seen this problem? Am I missing a flag/call somewhere when creating vertex buffers or drawing primitives? What do I need to do, to force hardware T&L for non-skinned objects? thanks Steve
Steve Broumley
Advertisement
I've not used mixed-mode before so I don't know why your performance was affected, but all vertex buffers that were created without the D3DUSAGE_SOFTWAREPROCESSING usage will be hardware processed.

Do you get any interesting debug output?

How often are you calling SetSoftwareVertexProcessing() per frame ?

It's an expensive call, you should only be calling it 1-2 times per frame...


As Coder says, the other thing to check is that all buffers used with a particular type of vertex processing are created for that type of vertex processing (even if it requires duplicating buffers which are used by both types).

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

I tracked down the problem. When I was creating the device it was failing because I was also using the "D3DCREATE_PUREDEVICE" flag. My creation logic was then falling back to sofware vertex processing("D3DCREATE_SOFTWARE_VERTEXPROCESSING"). Can you explain why I have to do this?

The solution was to just remove the pure device flag. It all works as expected now (fast). I still have to turn on "SetSoftwareVertexProcessing( TRUE )" before rendering my skinned object, and I set it to FALSE when rendering other objects.

thanks for your help
-Steve.
Steve Broumley
The pure device does not support software vertex processing. Therefore, mixed mode is not an option when using the pure device.

This topic is closed to new replies.

Advertisement