[vlc-commits] commit: Added nVidia PerfHud (a Direct3D performance analysis tool) capabilities to debug versions of VLC (Sasha Koruga )

git at videolan.org git at videolan.org
Sun Aug 15 10:29:14 CEST 2010


vlc | branch: master | Sasha Koruga <skoruga at gmail.com> | Sat Aug 14 17:16:01 2010 -0700| [f17cdd16bc795da3602e65750436b83f0c7b45b9] | committer: Jean-Baptiste Kempf 

Added nVidia PerfHud (a Direct3D performance analysis tool) capabilities to debug versions of VLC

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f17cdd16bc795da3602e65750436b83f0c7b45b9
---

 modules/video_output/msw/direct3d.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index eb81ebb..9237c30 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -552,8 +552,27 @@ static int Direct3DOpen(vout_display_t *vd, video_format_t *fmt)
 
     // Create the D3DDevice
     LPDIRECT3DDEVICE9 d3ddev;
-    HRESULT hr = IDirect3D9_CreateDevice(d3dobj, D3DADAPTER_DEFAULT,
-                                         D3DDEVTYPE_HAL, sys->hvideownd,
+
+    UINT AdapterToUse = D3DADAPTER_DEFAULT;
+    D3DDEVTYPE DeviceType = D3DDEVTYPE_HAL;
+
+#ifndef NDEBUG
+    // Look for 'NVIDIA PerfHUD' adapter
+    // If it is present, override default settings
+    for (UINT Adapter=0; Adapter< IDirect3D9_GetAdapterCount(d3dobj); ++Adapter) {
+        D3DADAPTER_IDENTIFIER9 Identifier;
+        HRESULT Res;
+        Res = IDirect3D9_GetAdapterIdentifier(d3dobj,Adapter,0,&Identifier);
+        if (strstr(Identifier.Description,"PerfHUD") != 0) {
+            AdapterToUse = Adapter;
+            DeviceType = D3DDEVTYPE_REF;
+            break;
+        }
+    }
+#endif
+
+    HRESULT hr = IDirect3D9_CreateDevice(d3dobj, AdapterToUse,
+                                         DeviceType, sys->hvideownd,
                                          D3DCREATE_SOFTWARE_VERTEXPROCESSING|
                                          D3DCREATE_MULTITHREADED,
                                          &sys->d3dpp, &d3ddev);



More information about the vlc-commits mailing list