VirtualBox

Changeset 85938 in vbox for trunk


Ignore:
Timestamp:
Aug 28, 2020 6:28:26 PM (4 years ago)
Author:
vboxsync
Message:

Devices/Graphics: fixed a couple of log statements and updated optional debug code to dump all active textures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp

    r85369 r85938  
    51535153    AssertReturn(!cVertexDivisor || cVertexDivisor == numVertexDecls, VERR_INVALID_PARAMETER);
    51545154
     5155#if 0
     5156    /* Dump render target to a bitmap. */
     5157    if (pContext->state.aRenderTargets[SVGA3D_RT_COLOR0] != SVGA3D_INVALID_ID)
     5158    {
     5159        vmsvga3dUpdateHeapBuffersForSurfaces(pThisCC, pContext->state.aRenderTargets[SVGA3D_RT_COLOR0]);
     5160        PVMSVGA3DSURFACE pSurface;
     5161        int rc2 = vmsvga3dSurfaceFromSid(pState, pContext->state.aRenderTargets[SVGA3D_RT_COLOR0], &pSurface);
     5162        if (RT_SUCCESS(rc2))
     5163            vmsvga3dInfoSurfaceToBitmap(NULL, pSurface, "bmpd3d", "rt", "-pre");
     5164    }
     5165    for (int iTex = 0; iTex < SVGA3D_MAX_SAMPLERS_PS; ++iTex)
     5166    {
     5167        IDirect3DBaseTexture9 *pBaseTexture = 0;
     5168        hr = pContext->pDevice->GetTexture(iTex, &pBaseTexture);
     5169        if (hr == S_OK && pBaseTexture)
     5170        {
     5171            D3DSURFACE_DESC surfDesc;
     5172            RT_ZERO(surfDesc);
     5173
     5174            IDirect3DTexture9 *pTexture = (IDirect3DTexture9 *)pBaseTexture;
     5175            pTexture->GetLevelDesc(0, &surfDesc);
     5176
     5177            Log(("Texture[%d]: %dx%d\n",
     5178                 iTex, surfDesc.Width, surfDesc.Height));
     5179            D3D_RELEASE(pBaseTexture);
     5180        }
     5181    }
     5182#endif
     5183
    51555184    /*
    51565185     * Process all vertex declarations. Each vertex buffer surface is represented by one stream source id.
     
    53485377
    53495378            /* Render with an index buffer */
    5350             Log(("DrawIndexedPrimitive %x startindex=%d numVertices=%d, primitivecount=%d index format=%s index bias=%d stride=%d\n",
    5351                  PrimitiveTypeD3D, pVertexDecl[0].rangeHint.first,  numVertices, pRange[iPrimitive].primitiveCount,
     5379            Log(("DrawIndexedPrimitive %x startindex=%d (indexArray.offset 0x%x) range [%d:%d) numVertices=%d, primitivecount=%d index format=%s index bias=%d stride=%d\n",
     5380                 PrimitiveTypeD3D, pRange[iPrimitive].indexArray.offset / pRange[iPrimitive].indexWidth, pRange[iPrimitive].indexArray.offset,
     5381                 pVertexDecl[0].rangeHint.first, pVertexDecl[0].rangeHint.last, numVertices, pRange[iPrimitive].primitiveCount,
    53525382                 (pRange[iPrimitive].indexWidth == sizeof(uint16_t)) ? "D3DFMT_INDEX16" : "D3DFMT_INDEX32",
    53535383                 pRange[iPrimitive].indexBias, strideVertex));
     
    54245454            vmsvga3dInfoSurfaceToBitmap(NULL, pSurface, "bmpd3d", "rt", "-post");
    54255455# if 0
    5426         /* Stage 0 texture. */
    5427         if (pContext->aSidActiveTextures[0] != SVGA3D_INVALID_ID)
    5428         {
    5429             vmsvga3dUpdateHeapBuffersForSurfaces(pThisCC, pContext->aSidActiveTextures[0]);
    5430             rc2 = vmsvga3dSurfaceFromSid(pState, pContext->aSidActiveTextures[0], &pSurface);
    5431             if (RT_SUCCESS(rc2))
    5432                 vmsvga3dInfoSurfaceToBitmap(NULL, pSurface, "bmpd3d", "rt", "-post-tx");
     5456        for (i = 0; i < SVGA3D_MAX_SAMPLERS_PS; ++i)
     5457        {
     5458            if (pContext->aSidActiveTextures[i] != SVGA3D_INVALID_ID)
     5459            {
     5460                char szSuffix[32];
     5461                RTStrPrintf2(szSuffix, sizeof(szSuffix), "-tx%d", i);
     5462                vmsvga3dUpdateHeapBuffersForSurfaces(pThisCC, pContext->aSidActiveTextures[i]);
     5463                rc2 = vmsvga3dSurfaceFromSid(pState, pContext->aSidActiveTextures[i], &pSurface);
     5464                if (RT_SUCCESS(rc2))
     5465                    vmsvga3dInfoSurfaceToBitmap(NULL, pSurface, "bmpd3d", "rt", szSuffix);
     5466            }
    54335467        }
    54345468# endif
     
    54785512    AssertReturn(pState, VERR_NO_MEMORY);
    54795513
    5480     Log(("vmsvga3dShaderDefine %x shid=%x type=%s cbData=%x\n", cid, shid, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL", cbData));
     5514    Log(("vmsvga3dShaderDefine %x shid=%d type=%s cbData=%d\n", cid, shid, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL", cbData));
    54815515
    54825516    PVMSVGA3DCONTEXT pContext;
     
    55855619    PVMSVGA3DSHADER       pShader = NULL;
    55865620
    5587     Log(("vmsvga3dShaderDestroy %x shid=%x type=%s\n", cid, shid, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL"));
     5621    Log(("vmsvga3dShaderDestroy %x shid=%d type=%s\n", cid, shid, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL"));
    55885622
    55895623    PVMSVGA3DCONTEXT pContext;
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