VirtualBox

Changeset 95017 in vbox


Ignore:
Timestamp:
May 15, 2022 8:45:06 PM (3 years ago)
Author:
vboxsync
Message:

Devices/Graphics: copy resource: bugref:9830

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

Legend:

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

    r95016 r95017  
    26392639{
    26402640#ifdef VMSVGA3D_DX
    2641     DEBUG_BREAKPOINT_TEST();
    2642     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    2643     RT_NOREF(pSvgaR3State, pCmd, cbCmd);
    2644     return vmsvga3dDXPredCopy(pThisCC, idDXContext);
     2641    //DEBUG_BREAKPOINT_TEST();
     2642    RT_NOREF(cbCmd);
     2643    return vmsvga3dDXPredCopy(pThisCC, idDXContext, pCmd);
    26452644#else
    26462645    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx.cpp

    r95016 r95017  
    13691369
    13701370
    1371 int vmsvga3dDXPredCopy(PVGASTATECC pThisCC, uint32_t idDXContext)
     1371int vmsvga3dDXPredCopy(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXPredCopy const *pCmd)
    13721372{
    13731373    int rc;
     
    13811381    AssertRCReturn(rc, rc);
    13821382
    1383     rc = pSvgaR3State->pFuncsDX->pfnDXPredCopy(pThisCC, pDXContext);
     1383    rc = pSvgaR3State->pFuncsDX->pfnDXPredCopy(pThisCC, pDXContext, pCmd->dstSid, pCmd->srcSid);
    13841384    return rc;
    13851385}
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win-dx.cpp

    r95016 r95017  
    68766876
    68776877
    6878 static DECLCALLBACK(int) vmsvga3dBackDXPredCopy(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    6879 {
    6880     PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
    6881 
    6882     RT_NOREF(pBackend, pDXContext);
    6883     AssertFailed(); /** @todo Implement */
    6884     return VERR_NOT_IMPLEMENTED;
     6878static DECLCALLBACK(int) vmsvga3dBackDXPredCopy(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dSurfaceId dstSid, SVGA3dSurfaceId srcSid)
     6879{
     6880    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     6881    RT_NOREF(pBackend);
     6882
     6883    DXDEVICE *pDevice = dxDeviceFromContext(pThisCC->svga.p3dState, pDXContext);
     6884    AssertReturn(pDevice->pDevice, VERR_INVALID_STATE);
     6885
     6886    PVMSVGA3DSURFACE pSrcSurface;
     6887    int rc = vmsvga3dSurfaceFromSid(pThisCC->svga.p3dState, srcSid, &pSrcSurface);
     6888    AssertRCReturn(rc, rc);
     6889
     6890    PVMSVGA3DSURFACE pDstSurface;
     6891    rc = vmsvga3dSurfaceFromSid(pThisCC->svga.p3dState, dstSid, &pDstSurface);
     6892    AssertRCReturn(rc, rc);
     6893
     6894    if (pSrcSurface->pBackendSurface == NULL)
     6895    {
     6896        /* Create the resource. */
     6897        if (pSrcSurface->format != SVGA3D_BUFFER)
     6898            rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pDXContext, pSrcSurface);
     6899        else
     6900            rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pDXContext, pSrcSurface);
     6901        AssertRCReturn(rc, rc);
     6902    }
     6903
     6904    if (pDstSurface->pBackendSurface == NULL)
     6905    {
     6906        /* Create the resource. */
     6907        if (pSrcSurface->format != SVGA3D_BUFFER)
     6908            rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pDXContext, pDstSurface);
     6909        else
     6910            rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pDXContext, pDstSurface);
     6911        AssertRCReturn(rc, rc);
     6912    }
     6913
     6914    LogFunc(("cid %d: src cid %d%s -> dst cid %d%s\n",
     6915             pDXContext->cid, pSrcSurface->idAssociatedContext,
     6916             (pSrcSurface->f.surfaceFlags & SVGA3D_SURFACE_SCREENTARGET) ? " st" : "",
     6917             pDstSurface->idAssociatedContext,
     6918             (pDstSurface->f.surfaceFlags & SVGA3D_SURFACE_SCREENTARGET) ? " st" : ""));
     6919
     6920    ID3D11Resource *pDstResource = dxResource(pThisCC->svga.p3dState, pDstSurface, pDXContext);
     6921    ID3D11Resource *pSrcResource = dxResource(pThisCC->svga.p3dState, pSrcSurface, pDXContext);
     6922
     6923    pDevice->pImmediateContext->CopyResource(pDstResource, pSrcResource);
     6924
     6925    pDstSurface->pBackendSurface->cidDrawing = pDXContext->cid;
     6926    return VINF_SUCCESS;
    68856927}
    68866928
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h

    r95012 r95017  
    456456    DECLCALLBACKMEMBER(int, pfnDXClearDepthStencilView,     (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t flags, SVGA3dDepthStencilViewId depthStencilViewId, float depth, uint8_t stencil));
    457457    DECLCALLBACKMEMBER(int, pfnDXPredCopyRegion,            (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dSurfaceId dstSid, uint32_t dstSubResource, SVGA3dSurfaceId srcSid, uint32_t srcSubResource, SVGA3dCopyBox const *pBox));
    458     DECLCALLBACKMEMBER(int, pfnDXPredCopy,                  (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
     458    DECLCALLBACKMEMBER(int, pfnDXPredCopy,                  (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dSurfaceId dstSid, SVGA3dSurfaceId srcSid));
    459459    DECLCALLBACKMEMBER(int, pfnDXPresentBlt,                (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    460460    DECLCALLBACKMEMBER(int, pfnDXGenMips,                   (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderResourceViewId shaderResourceViewId));
     
    580580int vmsvga3dDXClearDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXClearDepthStencilView const *pCmd);
    581581int vmsvga3dDXPredCopyRegion(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXPredCopyRegion const *pCmd);
    582 int vmsvga3dDXPredCopy(PVGASTATECC pThisCC, uint32_t idDXContext);
     582int vmsvga3dDXPredCopy(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXPredCopy const *pCmd);
    583583int vmsvga3dDXPresentBlt(PVGASTATECC pThisCC, uint32_t idDXContext);
    584584int vmsvga3dDXGenMips(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXGenMips const *pCmd);
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