Changeset 91507 in vbox for trunk/src/VBox
- Timestamp:
- Oct 1, 2021 10:27:12 AM (3 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-cmd.cpp
r91441 r91507 37 37 #include "DevVGA-SVGA-internal.h" 38 38 39 #ifdef DUMP_BITMAPS 40 # include <iprt/formats/bmp.h> 41 # include <stdio.h> 42 #endif 39 #include <iprt/formats/bmp.h> 40 #include <stdio.h> 43 41 44 42 #if defined(LOG_ENABLED) || defined(VBOX_STRICT) … … 1405 1403 1406 1404 1407 #ifdef DUMP_BITMAPS1408 1405 static int vmsvga3dBmpWrite(const char *pszFilename, VMSVGA3D_MAPPED_SURFACE const *pMap) 1409 1406 { … … 1465 1462 RTStrFree(pszFilename); 1466 1463 } 1467 #endif /* DUMP_BITMAPS */1468 1464 1469 1465 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx.cpp
r91441 r91507 350 350 351 351 rc = pSvgaR3State->pFuncsDX->pfnDXDrawIndexed(pThisCC, pDXContext, pCmd->indexCount, pCmd->startIndexLocation, pCmd->baseVertexLocation); 352 #ifdef DUMP_BITMAPS 353 SVGACOTableDXRTViewEntry *pRTViewEntry = &pDXContext->cot.paRTView[pDXContext->svgaDXContext.renderState.renderTargetViewIds[0]]; 354 SVGA3dSurfaceImageId image; 355 image.sid = pRTViewEntry->sid; 356 image.face = 0; 357 image.mipmap = 0; 358 VMSVGA3D_MAPPED_SURFACE map; 359 int rc2 = vmsvga3dSurfaceMap(pThisCC, &image, NULL, VMSVGA3D_SURFACE_MAP_READ, &map); 360 if (RT_SUCCESS(rc2)) 361 { 362 vmsvga3dMapWriteBmpFile(&map, "rt-"); 363 vmsvga3dSurfaceUnmap(pThisCC, &image, &map, /* fWritten = */ false); 364 } 365 #endif 352 366 return rc; 353 367 } … … 368 382 rc = pSvgaR3State->pFuncsDX->pfnDXDrawInstanced(pThisCC, pDXContext, 369 383 pCmd->vertexCountPerInstance, pCmd->instanceCount, pCmd->startVertexLocation, pCmd->startInstanceLocation); 384 #ifdef DUMP_BITMAPS 385 SVGACOTableDXRTViewEntry *pRTViewEntry = &pDXContext->cot.paRTView[pDXContext->svgaDXContext.renderState.renderTargetViewIds[0]]; 386 SVGA3dSurfaceImageId image; 387 image.sid = pRTViewEntry->sid; 388 image.face = 0; 389 image.mipmap = 0; 390 VMSVGA3D_MAPPED_SURFACE map; 391 int rc2 = vmsvga3dSurfaceMap(pThisCC, &image, NULL, VMSVGA3D_SURFACE_MAP_READ, &map); 392 if (RT_SUCCESS(rc2)) 393 { 394 vmsvga3dMapWriteBmpFile(&map, "rt-"); 395 vmsvga3dSurfaceUnmap(pThisCC, &image, &map, /* fWritten = */ false); 396 } 397 #endif 370 398 return rc; 371 399 } … … 386 414 rc = pSvgaR3State->pFuncsDX->pfnDXDrawIndexedInstanced(pThisCC, pDXContext, 387 415 pCmd->indexCountPerInstance, pCmd->instanceCount, pCmd->startIndexLocation, pCmd->baseVertexLocation, pCmd->startInstanceLocation); 416 #ifdef DUMP_BITMAPS 417 SVGACOTableDXRTViewEntry *pRTViewEntry = &pDXContext->cot.paRTView[pDXContext->svgaDXContext.renderState.renderTargetViewIds[0]]; 418 SVGA3dSurfaceImageId image; 419 image.sid = pRTViewEntry->sid; 420 image.face = 0; 421 image.mipmap = 0; 422 VMSVGA3D_MAPPED_SURFACE map; 423 int rc2 = vmsvga3dSurfaceMap(pThisCC, &image, NULL, VMSVGA3D_SURFACE_MAP_READ, &map); 424 if (RT_SUCCESS(rc2)) 425 { 426 vmsvga3dMapWriteBmpFile(&map, "rt-"); 427 vmsvga3dSurfaceUnmap(pThisCC, &image, &map, /* fWritten = */ false); 428 } 429 #endif 388 430 return rc; 389 431 } … … 403 445 404 446 rc = pSvgaR3State->pFuncsDX->pfnDXDrawAuto(pThisCC, pDXContext); 447 #ifdef DUMP_BITMAPS 448 SVGACOTableDXRTViewEntry *pRTViewEntry = &pDXContext->cot.paRTView[pDXContext->svgaDXContext.renderState.renderTargetViewIds[0]]; 449 SVGA3dSurfaceImageId image; 450 image.sid = pRTViewEntry->sid; 451 image.face = 0; 452 image.mipmap = 0; 453 VMSVGA3D_MAPPED_SURFACE map; 454 int rc2 = vmsvga3dSurfaceMap(pThisCC, &image, NULL, VMSVGA3D_SURFACE_MAP_READ, &map); 455 if (RT_SUCCESS(rc2)) 456 { 457 vmsvga3dMapWriteBmpFile(&map, "rt-"); 458 vmsvga3dSurfaceUnmap(pThisCC, &image, &map, /* fWritten = */ false); 459 } 460 #endif 405 461 return rc; 406 462 } -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h
r91441 r91507 62 62 /* Write render targets to bitmaps. */ 63 63 //#define DUMP_BITMAPS 64 #ifdef DUMP_BITMAPS65 64 void vmsvga3dMapWriteBmpFile(VMSVGA3D_MAPPED_SURFACE const *pMap, char const *pszPrefix); 66 #endif67 65 68 66 /* DevVGA-SVGA.cpp: */
Note:
See TracChangeset
for help on using the changeset viewer.