vbox的更動 98138 路徑 trunk/src/VBox/Additions/WINNT
- 時間撮記:
- 2023-1-19 下午01:43:33 (22 月 以前)
- 位置:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/test
- 檔案:
-
- 修改 3 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/test/Makefile.kmk
r98103 r98138 30 30 31 31 PROGRAMS += VBoxGaD3DTest 32 VBoxGaD3DTest_TEMPLATE = VB OXR3STATIC32 VBoxGaD3DTest_TEMPLATE = VBoxR3Static 33 33 VBoxGaD3DTest_DEFS = D3DTEST_STANDALONE 34 34 VBoxGaD3DTest_LIBS = d3d9.lib … … 47 47 48 48 PROGRAMS += VBoxD3D11 49 VBoxD3D11_TEMPLATE = VB OXR3STATIC49 VBoxD3D11_TEMPLATE = VBoxR3Static 50 50 VBoxD3D11_CXXFLAGS += -wd4458 -wd4668 -wd4838 -wd5029 -wd5039 51 51 VBoxD3D11_INCS += $(PATH_ROOT)/src/VBox/Devices/Graphics/shaders -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/test/d3d11main.cpp
r98103 r98138 28 28 #include "d3d11render.h" 29 29 30 #include < stdio.h>30 #include <iprt/string.h> 31 31 32 32 class D3D11Test : public D3D11DeviceProvider … … 36 36 ~D3D11Test(); 37 37 38 HRESULT Init(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow);38 HRESULT Init(HINSTANCE hInstance, int argc, char **argv, int nCmdShow); 39 39 int Run(); 40 40 … … 47 47 HRESULT initWindow(HINSTANCE hInstance, int nCmdShow); 48 48 HRESULT initDirect3D11(); 49 void parseCmdLine( LPSTR lpCmdLine);49 void parseCmdLine(int argc, char **argv); 50 50 static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 51 51 … … 249 249 if (FeatureLevel != D3D_FEATURE_LEVEL_11_1) 250 250 { 251 char s [128];252 sprintf(s, "Feature level %x", FeatureLevel);253 D3DTestShowError(hr, s );251 char sz[128]; 252 RTStrPrintf(sz, sizeof(sz), "Feature level %x", FeatureLevel); 253 D3DTestShowError(hr, sz); 254 254 } 255 255 … … 379 379 } 380 380 381 void D3D11Test::parseCmdLine( LPSTR lpCmdLine)381 void D3D11Test::parseCmdLine(int argc, char **argv) 382 382 { 383 383 /* Very simple: a test identifier followed by the render mode. */ 384 if (!lpCmdLine)385 return;386 387 char *p = lpCmdLine;388 389 while (*p == ' ')390 ++p;391 392 if (!*p)393 return;394 384 395 385 /* First number is the render id. */ 396 miRenderId = atoi(p); 397 398 while ('0' <= *p && *p <= '9') 399 ++p; 400 401 while (*p == ' ') 402 ++p; 403 404 if (!*p) 405 return; 386 if (argc >= 2) 387 miRenderId = RTStrToInt32(argv[1]); 406 388 407 389 /* Second number is the render/step mode. */ 408 int i = atoi(p); 409 switch (i) 410 { 411 default: 412 case 0: miRenderMode = RenderModeStep; break; 413 case 1: miRenderMode = RenderModeContinuous; break; 414 case 2: miRenderMode = RenderModeFPS; break; 415 } 416 } 417 418 HRESULT D3D11Test::Init(HINSTANCE hInstance, 419 LPSTR lpCmdLine, 420 int nCmdShow) 421 { 422 parseCmdLine(lpCmdLine); 390 if (argc >= 3) 391 { 392 int i = RTStrToInt32(argv[2]); 393 switch (i) 394 { 395 default: 396 case 0: miRenderMode = RenderModeStep; break; 397 case 1: miRenderMode = RenderModeContinuous; break; 398 case 2: miRenderMode = RenderModeFPS; break; 399 } 400 } 401 } 402 403 HRESULT D3D11Test::Init(HINSTANCE hInstance, int argc, char **argv, int nCmdShow) 404 { 405 parseCmdLine(argc, argv); 423 406 424 407 HRESULT hr = initWindow(hInstance, nCmdShow); … … 823 806 float msPerFrame = elapsed * 1000.0f / (float)cFrames; 824 807 char sz[256]; 825 _snprintf(sz, sizeof(sz), "D3D11 Test FPS %d Frame Time %fms", cFrames, msPerFrame); 808 RTStrPrintf(sz, sizeof(sz), "D3D11 Test FPS %d Frame Time %u.%03ums", 809 cFrames, (unsigned)msPerFrame, (unsigned)(msPerFrame * 1000) % 1000); 826 810 SetWindowTextA(mHwnd, sz); 827 811 … … 859 843 } 860 844 861 int WINAPI WinMain(HINSTANCE hInstance, 862 HINSTANCE hPrevInstance, 863 LPSTR lpCmdLine, 864 int nCmdShow) 865 { 866 (void)hPrevInstance; 867 868 int result = 0; 845 int main(int argc, char **argv) 846 { 847 int rcExit = RTEXITCODE_FAILURE; 848 869 849 D3D11Test test; 870 871 HRESULT hr = test.Init(hInstance, lpCmdLine, nCmdShow); 850 HRESULT hr = test.Init(GetModuleHandleW(NULL), argc, argv, SW_SHOWDEFAULT); 872 851 if (SUCCEEDED(hr)) 873 { 874 result = test.Run(); 875 } 876 877 return result; 878 } 852 rcExit = test.Run(); 853 854 return rcExit; 855 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/test/d3d9main.cpp
r98103 r98138 28 28 #include "d3d9render.h" 29 29 30 #include < stdio.h>30 #include <iprt/string.h> 31 31 32 32 #define D3D9TEST_MAX_DEVICES 2 … … 38 38 ~D3D9Test(); 39 39 40 HRESULT Init(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow);40 HRESULT Init(HINSTANCE hInstance, int argc, char **argv, int nCmdShow); 41 41 int Run(); 42 42 … … 47 47 HRESULT initWindow(HINSTANCE hInstance, int nCmdShow); 48 48 HRESULT initDirect3D9(int cDevices); 49 void parseCmdLine( LPSTR lpCmdLine);49 void parseCmdLine(int argc, char **argv); 50 50 static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 51 51 … … 232 232 } 233 233 234 void D3D9Test::parseCmdLine( LPSTR lpCmdLine)234 void D3D9Test::parseCmdLine(int argc, char **argv) 235 235 { 236 236 /* Very simple: test number followed by step flag. 237 237 * Default is test 0, step mode: 0 1 238 238 */ 239 if (!lpCmdLine)240 return;241 242 char *p = lpCmdLine;243 244 while (*p == ' ')245 ++p;246 247 if (!*p)248 return;249 239 250 240 /* First number is the render id. */ 251 miRenderId = atoi(p); 252 253 while ('0' <= *p && *p <= '9') 254 ++p; 255 256 while (*p == ' ') 257 ++p; 258 259 if (!*p) 260 return; 241 if (argc >= 2) 242 miRenderId = RTStrToInt32(argv[1]); 261 243 262 244 /* Second number is the render/step mode. */ 263 int i = atoi(p); 264 switch (i) 265 { 266 default: 267 case 0: miRenderMode = RenderModeStep; break; 268 case 1: miRenderMode = RenderModeContinuous; break; 269 case 2: miRenderMode = RenderModeFPS; break; 270 } 271 } 272 273 HRESULT D3D9Test::Init(HINSTANCE hInstance, 274 LPSTR lpCmdLine, 275 int nCmdShow) 276 { 277 parseCmdLine(lpCmdLine); 245 if (argc >= 3) 246 { 247 int i = RTStrToInt32(argv[2]); 248 switch (i) 249 { 250 default: 251 case 0: miRenderMode = RenderModeStep; break; 252 case 1: miRenderMode = RenderModeContinuous; break; 253 case 2: miRenderMode = RenderModeFPS; break; 254 } 255 } 256 } 257 258 HRESULT D3D9Test::Init(HINSTANCE hInstance, int argc, char **argv, int nCmdShow) 259 { 260 parseCmdLine(argc, argv); 278 261 279 262 HRESULT hr = initWindow(hInstance, nCmdShow); … … 376 359 float msPerFrame = elapsed * 1000.0f / (float)cFrames; 377 360 char sz[256]; 378 _snprintf(sz, sizeof(sz), "D3D9 Test FPS %d Frame Time %fms", cFrames, msPerFrame); 361 RTStrPrintf(sz, sizeof(sz), "D3D9 Test FPS %d Frame Time %u.%03ums", 362 cFrames, (unsigned)msPerFrame, (unsigned)(msPerFrame * 1000) % 1000); 379 363 SetWindowTextA(mHwnd, sz); 380 364 … … 403 387 } 404 388 405 int WINAPI WinMain(HINSTANCE hInstance, 406 HINSTANCE hPrevInstance, 407 LPSTR lpCmdLine, 408 int nCmdShow) 409 { 410 (void)hPrevInstance; 411 412 int result = 0; 389 int main(int argc, char **argv) 390 { 391 int rcExit = RTEXITCODE_FAILURE; 392 413 393 D3D9Test test; 414 415 HRESULT hr = test.Init(hInstance, lpCmdLine, nCmdShow); 394 HRESULT hr = test.Init(GetModuleHandleW(NULL), argc, argv, SW_SHOWDEFAULT); 416 395 if (SUCCEEDED(hr)) 417 { 418 result = test.Run(); 419 } 420 421 return result; 422 } 396 rcExit = test.Run(); 397 398 return rcExit; 399 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器