Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (2 posts)

XNA 3.1 + NVPerfhud 6.5 = forced software vertex processing

Last post 6/15/2009 7:54 AM by jwatte. 1 replies.
  • 6/15/2009 4:05 AM

    XNA 3.1 + NVPerfhud 6.5 = forced software vertex processing

    I've noticed that when you run an XNA app under NVPerfHUD my Model index and vertex buffers get created with D3DUSAGE_SOFTWAREPROCESSING. This is not the case when running normally, and native C++ apps do not exhibit this behavior under NVPerfHud, so I believe it is an XNA issue.

    I'm using the PreparingDeviceSettings hook to select the PerfHUD adaptor, and you are required to set it to DeviceType.Reference for PerfHUD to work (which is consistent with the Nvidia documentation).

    I wonder if this is XNA assuming that a reference device does not support hardware vertex processing -- even though the caps say it does. 

    This really diminishes the usefulness of perfhud since the timings are all off -- I will see draw calls taking 5 or 6 ms of CPU time which would not happen if the vertex processing was done on the GPU. 

    Anyone know a workaround or a way to force XNA to use hardware vertex processing under perfhud?

  • 6/15/2009 7:54 AM In reply to

    Re: XNA 3.1 + NVPerfhud 6.5 = forced software vertex processing

    Put a breakpoint where it's created, trace into the code, change the stack when it makes the call into D3D. Yes, it's not pretty, but you only do it once per program start...

    Or use PIX for Windows, plus various little changes you can make yourself (like drawing everything with 1-pixel textures, etc). It's not perfect, and certainly not as convenient as PerfHUD, but it will get you pretty good numbers.

Page 1 of 1 (2 posts) Previous Discussion Next Discussion