VirtualBox

Ignore:
Timestamp:
Dec 13, 2019 9:29:51 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
135463
Message:

Devices/Graphics: fixes for the CLEAR command; BLIT_SURFACE_TO_SCREEN must ignore the face and mipmap parameters.

File:
1 edited

Legend:

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

    r82431 r82583  
    39043904    /* Save for vm state save/restore. */
    39053905    pContext->state.aRenderTargets[type] = target.sid;
     3906    /** @todo Also save target.face and target.mipmap */
    39063907
    39073908    if (target.sid == SVGA3D_INVALID_ID)
     
    48004801                         uint32_t stencil, uint32_t cRects, SVGA3dRect *pRect)
    48014802{
     4803    /* From SVGA3D_BeginClear comments:
     4804     *
     4805     *      Clear is not affected by clipping, depth test, or other
     4806     *      render state which affects the fragment pipeline.
     4807     *
     4808     * Therefore this code must ignore the current scissor rect.
     4809     */
     4810
    48024811    DWORD                 clearFlagD3D = 0;
    48034812    D3DRECT              *pRectD3D = NULL;
     
    48124821    AssertRCReturn(rc, rc);
    48134822
     4823    PVMSVGA3DSURFACE pRT;
     4824    rc = vmsvga3dSurfaceFromSid(pState, pContext->state.aRenderTargets[SVGA3D_RT_COLOR0], &pRT);
     4825    AssertRCReturn(rc, rc);
     4826
    48144827    if (clearFlag & SVGA3D_CLEAR_COLOR)
    48154828        clearFlagD3D |= D3DCLEAR_TARGET;
     
    48344847    }
    48354848
     4849    RECT currentScissorRect;
     4850    pContext->pDevice->GetScissorRect(&currentScissorRect);
     4851
     4852    RECT clearScissorRect;
     4853    clearScissorRect.left   = 0;
     4854    clearScissorRect.top    = 0;
     4855    clearScissorRect.right  = pRT->paMipmapLevels[0].mipmapSize.width;
     4856    clearScissorRect.bottom = pRT->paMipmapLevels[0].mipmapSize.height;
     4857    pContext->pDevice->SetScissorRect(&clearScissorRect);
     4858
    48364859    hr = pContext->pDevice->Clear(cRects, pRectD3D, clearFlagD3D, (D3DCOLOR)color, depth, stencil);
     4860
    48374861    if (pRectD3D)
    48384862        RTMemFree(pRectD3D);
     4863
     4864    pContext->pDevice->SetScissorRect(&currentScissorRect);
    48394865
    48404866    AssertMsgReturn(hr == D3D_OK, ("Clear failed with %x\n", hr), VERR_INTERNAL_ERROR);
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