VirtualBox

Changeset 98907 in vbox for trunk/src


Ignore:
Timestamp:
Mar 10, 2023 4:23:42 PM (22 months ago)
Author:
vboxsync
Message:

WDDM: make sure that textures are always updated in D3D9 driver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/GaDdi.cpp

    r98103 r98907  
    295295    PVBOXWDDMDISP_RESOURCE pSrcRc = (PVBOXWDDMDISP_RESOURCE)pData->hSrcResource;
    296296
    297     Assert(    pDstRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE
    298             || pDstRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_CUBE_TEXTURE);
    299     Assert(    pSrcRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE
    300             || pSrcRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_CUBE_TEXTURE);
     297    AssertReturn(    pDstRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE
     298                 || pDstRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_CUBE_TEXTURE, E_INVALIDARG);
     299    AssertReturn(    pSrcRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE
     300                 || pSrcRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_CUBE_TEXTURE, E_INVALIDARG);
    301301    Assert(pSrcRc->aAllocations[0].enmD3DIfType == pDstRc->aAllocations[0].enmD3DIfType);
    302302    Assert(pSrcRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM);
     
    321321        Assert(pD3DIfSrcTex);
    322322        Assert(pD3DIfDstTex);
     323
     324        /* Make sure that the blit is always performed. In particular this is important for
     325         * SYSTEMMEM textures created for an application memory buffer (*pSharedHandle == pBuffer)
     326         * and updated by application without Lock/Unlock, which means that dirty rect is not
     327         * updated automatically.
     328         */
     329        if (pSrcRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE)
     330        {
     331            IDirect3DTexture9 *p = (IDirect3DTexture9 *)pD3DIfSrcTex;
     332            p->AddDirtyRect(&pData->SrcRect);
     333        }
     334        else if (pSrcRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_CUBE_TEXTURE)
     335        {
     336            IDirect3DCubeTexture9 *p = (IDirect3DCubeTexture9 *)pD3DIfSrcTex;
     337            p->AddDirtyRect((D3DCUBEMAP_FACES)pData->CubeMapFace, &pData->SrcRect);
     338        }
     339
    323340        VBOXVDBG_CHECK_TEXBLT(
    324341                hr = pDevice9If->UpdateTexture(pD3DIfSrcTex, pD3DIfDstTex); Assert(hr == S_OK),
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