Sign in to follow this  
Messremb

[.net] NVPerfHUD 5 and mdx/xna?

Recommended Posts

I've tried to get NVIDIA PerfHUD 5 running on MDX and XNA, but i've failed. Every time i start nvperfhud with my mdx or xna application i get the following message: "ERROR: The developer of this application has not enabled NVIDIA PerfHUD analysis...". The user guide says, that the device must be created using the reference mode and the "NVIDIA PerfHUD" adapter. In mdx i create the device with the following code:
D3D.DeviceType devType = D3D.DeviceType.Hardware;
int adapter = D3D.Manager.Adapters.Default.Adapter;
System.Collections.IEnumerator adapters = D3D.Manager.Adapters.GetEnumerator();
while (adapters.MoveNext())
{
    D3D.AdapterInformation currentAdapter = (D3D.AdapterInformation)adapters.Current;
    if ("NVIDIA PerfHUD".Equals(currentAdapter.Information.Description))
    {
        adapter = currentAdapter.Adapter;
        devType = D3D.DeviceType.Reference;
        break;
    }
}
device = new D3D.Device(adapter, devType, handle, 
         D3D.CreateFlags.HardwareVertexProcessing, pp);



Any ideas? Thanks!

Share this post


Link to post
Share on other sites
I'm not sure if I used this code for NVPerfHud 4 or 5, but this worked for me:


if (enabledNVidiaPerfHud)
{
if (Manager.Adapters[Manager.Adapters.Count - 1].Information.Description == "NVIDIA NVPerfHUD")
{
settings.AdapterOrdinal = (uint)Manager.Adapters.Count - 1;
settings.DeviceType = DeviceType.Reference;
}
}


As I recall, the guide says the instrumental adapter used with PerfHud will always be exposed as the last adapter in the enumeration, so by just checking the last one for the proper description, you'll know. You might want to recheck the guide to see what the proper description should be, but since this came from working code I'm pretty sure it should be "NVIDIA NVPerfHUD".

Share this post


Link to post
Share on other sites
Quote:
Original post by remigiusYou might want to recheck the guide to see what the proper description should be, but since this came from working code I'm pretty sure it should be "NVIDIA NVPerfHUD".

They changed the description in version 5 to "NVIDIA PerfHUD" (without the NV).

However, I found a thread in the public nvidia development forum that says there is a bug with managed directx and will be fixed ASAP [rolleyes]



Share this post


Link to post
Share on other sites
Sorry for the misinformation then. Quite puzzling that NVPerfHud worked when MDX was pretty much unknown and that they've managed to break it now managed code is becoming more popular. [rolleyes] indeed

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this