VirtualBox

Changeset 102616 in vbox for trunk/src


Ignore:
Timestamp:
Dec 15, 2023 5:22:23 PM (17 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160771
Message:

Devices/Graphics: debug logging.

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

Legend:

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

    r102520 r102616  
    14861486static int vmsvga3dBmpWrite(const char *pszFilename, VMSVGA3D_MAPPED_SURFACE const *pMap)
    14871487{
    1488     if (   pMap->cbBlock != 4 && pMap->cbBlock != 1
     1488    if (   pMap->cbBlock != 4 && pMap->cbBlock != 2 && pMap->cbBlock != 1
    14891489        && pMap->format != SVGA3D_R16G16B16A16_FLOAT
    14901490        && pMap->format != SVGA3D_R32G32B32A32_FLOAT)
     
    16011601        {
    16021602            fwrite(s, 1, pMap->cbRow, f);
     1603
     1604            s += pMap->cbRowPitch;
     1605        }
     1606    }
     1607    else if (pMap->cbBlock == 2)
     1608    {
     1609        const uint8_t *s = (uint8_t *)pMap->pvData;
     1610        for (uint32_t iRow = 0; iRow < pMap->cRows; ++iRow)
     1611        {
     1612            for (int32_t x = 0; x < w; ++x)
     1613            {
     1614                uint16_t const *pPixel = (uint16_t *)(s + x * sizeof(uint16_t));
     1615                uint32_t u32Pixel = *pPixel;
     1616                fwrite(&u32Pixel, 1, 4, f);
     1617            }
    16031618
    16041619            s += pMap->cbRowPitch;
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp

    r102532 r102616  
    58855885            for (unsigned i = 0; i < sizeInBytes / sizeof(float) / 4; ++i)
    58865886            {
    5887                 Log(("ConstantF[%d]: " FLOAT_FMT_STR ", " FLOAT_FMT_STR ", " FLOAT_FMT_STR ", " FLOAT_FMT_STR ",\n",
    5888                      i, FLOAT_FMT_ARGS(pValuesF[i*4 + 0]), FLOAT_FMT_ARGS(pValuesF[i*4 + 1]), FLOAT_FMT_ARGS(pValuesF[i*4 + 2]), FLOAT_FMT_ARGS(pValuesF[i*4 + 3])));
     5887                Log8(("ConstF /*%d*/ " FLOAT_FMT_STR ", " FLOAT_FMT_STR ", " FLOAT_FMT_STR ", " FLOAT_FMT_STR ",\n",
     5888                      i, FLOAT_FMT_ARGS(pValuesF[i*4 + 0]), FLOAT_FMT_ARGS(pValuesF[i*4 + 1]), FLOAT_FMT_ARGS(pValuesF[i*4 + 2]), FLOAT_FMT_ARGS(pValuesF[i*4 + 3])));
    58895889            }
    58905890        }
     
    64196419        {
    64206420            uint16_t const *pValues = (uint16_t const *)pvElementData;
    6421             Log8(("{ f16 " FLOAT_FMT_STR ", " FLOAT_FMT_STR " },",
     6421            Log8(("{ /*f16*/ " FLOAT_FMT_STR ", " FLOAT_FMT_STR " },",
    64226422                 FLOAT_FMT_ARGS(float16ToFloat(pValues[0])), FLOAT_FMT_ARGS(float16ToFloat(pValues[1]))));
    64236423            break;
     
    64546454        {
    64556455            int16_t const *pValues = (int16_t const *)pvElementData;
    6456             Log8(("{ s %d, %d },",
     6456            Log8(("{ /*s16*/ %d, %d },",
    64576457                 pValues[0], pValues[1]));
    64586458            break;
     
    64616461        {
    64626462            uint16_t const *pValues = (uint16_t const *)pvElementData;
    6463             Log8(("{ u %u, %u },",
     6463            Log8(("{ /*u16*/ %u, %u },",
    64646464                 pValues[0], pValues[1]));
    64656465            break;
    64666466        }
     6467        case DXGI_FORMAT_R16G16_SNORM:
     6468        {
     6469            int16_t const *pValues = (int16_t const *)pvElementData;
     6470            Log8(("{ /*sn16*/ 0x%x, 0x%x },",
     6471                 pValues[0], pValues[1]));
     6472            break;
     6473        }
     6474        case DXGI_FORMAT_R16G16_UNORM:
     6475        {
     6476            uint16_t const *pValues = (uint16_t const *)pvElementData;
     6477            Log8(("{ /*un16*/ 0x%x, 0x%x },",
     6478                 pValues[0], pValues[1]));
     6479            break;
     6480        }
     6481        case DXGI_FORMAT_R16_UINT:
     6482        {
     6483            uint16_t const *pValues = (uint16_t const *)pvElementData;
     6484            Log8(("{ /*u16*/ %u },",
     6485                 pValues[0]));
     6486            break;
     6487        }
    64676488        case DXGI_FORMAT_R8G8B8A8_UNORM:
    64686489        {
    64696490            uint8_t const *pValues = (uint8_t const *)pvElementData;
    6470             Log8(("{ 8unorm  %u, %u, %u, %u },",
     6491            Log8(("{ /*8unorm*/  %u, %u, %u, %u },",
    64716492                 pValues[0], pValues[1], pValues[2], pValues[3]));
    64726493            break;
     
    64756496        {
    64766497            uint8_t const *pValues = (uint8_t const *)pvElementData;
    6477             Log8(("{ 8unorm  %u, %u },",
     6498            Log8(("{ /*8unorm*/  %u, %u },",
    64786499                 pValues[0], pValues[1]));
     6500            break;
     6501        }
     6502        case DXGI_FORMAT_R8_UINT:
     6503        {
     6504            uint8_t const *pValues = (uint8_t const *)pvElementData;
     6505            Log8(("{ /*8unorm*/  %u },",
     6506                 pValues[0]));
    64796507            break;
    64806508        }
     
    65266554            for (uint32_t v = 0; v < vertexCount; ++v)
    65276555            {
    6528                 Log8(("slot[%u] v%u { ", iSlot, startVertexLocation + v));
     6556                Log8(("slot[%u] /* v%u */ { ", iSlot, startVertexLocation + v));
    65296557
    65306558                for (uint32_t iElement = 0; iElement < pDXElementLayout->cElementDesc; ++iElement)
     
    66146642                        Index = ((uint32_t *)pu8IndexData)[i];
    66156643
    6616                     Log8(("slot[%u] v%u { ", iSlot, Index));
     6644                    Log8(("slot[%u] /* v%u */ { ", iSlot, Index));
    66176645
    66186646                    for (uint32_t iElement = 0; iElement < pDXElementLayout->cElementDesc; ++iElement)
     
    66866714                      sidVB, iInstance, startInstanceLocation, pVB->offset, pVB->stride));
    66876715
    6688                 Log8(("slot[%u] i%u { ", iSlot, iInstance));
     6716                Log8(("slot[%u] /* i%u */ { ", iSlot, iInstance));
    66896717                for (uint32_t iElement = 0; iElement < pDXElementLayout->cElementDesc; ++iElement)
    66906718                {
     
    68046832                }
    68056833
    6806                 LogFunc(("srv[%d][%d] sid = %u, srvid = %u, format = %s(%d)\n", idxShaderState, idxSR, sid, shaderResourceViewId, vmsvgaLookupEnum((int)pSRViewEntry->format, &g_SVGA3dSurfaceFormat2String), pSRViewEntry->format));
     6834                LogFunc(("srv[%d][%d] sid = %u, srvid = %u, format = %s(%d), %dx%d\n",
     6835                         idxShaderState, idxSR, sid, shaderResourceViewId, vmsvgaLookupEnum((int)pSRViewEntry->format, &g_SVGA3dSurfaceFormat2String), pSRViewEntry->format,
     6836                         pSurface->paMipmapLevels[0].cBlocksX * pSurface->cxBlock, pSurface->paMipmapLevels[0].cBlocksY * pSurface->cyBlock));
    68076837
    68086838#ifdef DUMP_BITMAPS
     
    71367166
    71377167    pDevice->pImmediateContext->IASetInputLayout(pInputLayout);
     7168
     7169    LogFunc(("Topology %u\n", pDXContext->svgaDXContext.inputAssembly.topology));
     7170    LogFunc(("Blend id %u\n", pDXContext->svgaDXContext.renderState.blendStateId));
    71387171}
    71397172
     
    77107743static D3D11_PRIMITIVE_TOPOLOGY dxTopology(SVGA3dPrimitiveType primitiveType)
    77117744{
     7745    ASSERT_GUEST_RETURN(primitiveType < SVGA3D_PRIMITIVE_MAX, D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED);
     7746
    77127747    static D3D11_PRIMITIVE_TOPOLOGY const aD3D11PrimitiveTopology[SVGA3D_PRIMITIVE_MAX] =
    77137748    {
Note: See TracChangeset for help on using the changeset viewer.

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