VirtualBox

Changeset 91507 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 1, 2021 10:27:12 AM (3 years ago)
Author:
vboxsync
Message:

Devices/Graphics: DUMP_BITMAPS update: bugref:9830

Location:
trunk/src/VBox/Devices/Graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-cmd.cpp

    r91441 r91507  
    3737#include "DevVGA-SVGA-internal.h"
    3838
    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>
    4341
    4442#if defined(LOG_ENABLED) || defined(VBOX_STRICT)
     
    14051403
    14061404
    1407 #ifdef DUMP_BITMAPS
    14081405static int vmsvga3dBmpWrite(const char *pszFilename, VMSVGA3D_MAPPED_SURFACE const *pMap)
    14091406{
     
    14651462    RTStrFree(pszFilename);
    14661463}
    1467 #endif /* DUMP_BITMAPS */
    14681464
    14691465
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx.cpp

    r91441 r91507  
    350350
    351351    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
    352366    return rc;
    353367}
     
    368382    rc = pSvgaR3State->pFuncsDX->pfnDXDrawInstanced(pThisCC, pDXContext,
    369383             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
    370398    return rc;
    371399}
     
    386414    rc = pSvgaR3State->pFuncsDX->pfnDXDrawIndexedInstanced(pThisCC, pDXContext,
    387415             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
    388430    return rc;
    389431}
     
    403445
    404446    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
    405461    return rc;
    406462}
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h

    r91441 r91507  
    6262/* Write render targets to bitmaps. */
    6363//#define DUMP_BITMAPS
    64 #ifdef DUMP_BITMAPS
    6564void vmsvga3dMapWriteBmpFile(VMSVGA3D_MAPPED_SURFACE const *pMap, char const *pszPrefix);
    66 #endif
    6765
    6866/* DevVGA-SVGA.cpp: */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette