VirtualBox

Changeset 88803 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Apr 30, 2021 1:23:05 PM (4 years ago)
Author:
vboxsync
Message:

Devices/Graphics: more DX commands; disassemble shaders for debug log. bugref:9830

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

Legend:

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

    r88788 r88803  
    19781978{
    19791979#ifdef VMSVGA3D_DX
    1980 ASMBreakpoint();
    1981     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    1982     RT_NOREF(pSvgaR3State, pCmd, cbCmd);
    1983     return vmsvga3dDXSetShaderResources(pThisCC, idDXContext);
     1980//ASMBreakpoint();
     1981    SVGA3dShaderResourceViewId const *paShaderResourceViewId = (SVGA3dShaderResourceViewId *)&pCmd[1];
     1982    uint32_t const cShaderResourceViewId = (cbCmd - sizeof(*pCmd)) / sizeof(SVGA3dShaderResourceViewId);
     1983    return vmsvga3dDXSetShaderResources(pThisCC, idDXContext, pCmd, cShaderResourceViewId, paShaderResourceViewId);
    19841984#else
    19851985    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
     
    20102010    SVGA3dSamplerId const *paSamplerId = (SVGA3dSamplerId *)&pCmd[1];
    20112011    uint32_t const cSamplerId = (cbCmd - sizeof(*pCmd)) / sizeof(SVGA3dSamplerId);
    2012     return vmsvga3dDXSetSamplers(pThisCC, idDXContext, pCmd->startSampler, pCmd->type, cSamplerId, paSamplerId);
     2012    return vmsvga3dDXSetSamplers(pThisCC, idDXContext, pCmd, cSamplerId, paSamplerId);
    20132013#else
    20142014    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
     
    20362036{
    20372037#ifdef VMSVGA3D_DX
    2038 ASMBreakpoint();
     2038//ASMBreakpoint();
    20392039    RT_NOREF(cbCmd);
    20402040    return vmsvga3dDXDrawIndexed(pThisCC, idDXContext, pCmd);
     
    23742374{
    23752375#ifdef VMSVGA3D_DX
    2376 ASMBreakpoint();
    2377     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    2378     RT_NOREF(pSvgaR3State, pCmd, cbCmd);
    2379     return vmsvga3dDXClearRenderTargetView(pThisCC, idDXContext);
     2376//ASMBreakpoint();
     2377    RT_NOREF(cbCmd);
     2378    return vmsvga3dDXClearRenderTargetView(pThisCC, idDXContext, pCmd);
    23802379#else
    23812380    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
     
    23892388{
    23902389#ifdef VMSVGA3D_DX
    2391 ASMBreakpoint();
    2392     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    2393     RT_NOREF(pSvgaR3State, pCmd, cbCmd);
    2394     return vmsvga3dDXClearDepthStencilView(pThisCC, idDXContext);
     2390//ASMBreakpoint();
     2391    RT_NOREF(cbCmd);
     2392    return vmsvga3dDXClearDepthStencilView(pThisCC, idDXContext, pCmd);
    23952393#else
    23962394    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
     
    24042402{
    24052403#ifdef VMSVGA3D_DX
    2406 ASMBreakpoint();
    2407     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    2408     RT_NOREF(pSvgaR3State, pCmd, cbCmd);
    2409     return vmsvga3dDXPredCopyRegion(pThisCC, idDXContext);
     2404//ASMBreakpoint();
     2405    RT_NOREF(cbCmd);
     2406    return vmsvga3dDXPredCopyRegion(pThisCC, idDXContext, pCmd);
    24102407#else
    24112408    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
     
    24492446{
    24502447#ifdef VMSVGA3D_DX
    2451 ASMBreakpoint();
    2452     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    2453     RT_NOREF(pSvgaR3State, pCmd, cbCmd);
    2454     return vmsvga3dDXGenMips(pThisCC, idDXContext);
     2448//ASMBreakpoint();
     2449    RT_NOREF(cbCmd);
     2450    return vmsvga3dDXGenMips(pThisCC, idDXContext, pCmd);
    24552451#else
    24562452    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
     
    25092505{
    25102506#ifdef VMSVGA3D_DX
    2511 ASMBreakpoint();
     2507//ASMBreakpoint();
    25122508    RT_NOREF(cbCmd);
    25132509    return vmsvga3dDXDefineShaderResourceView(pThisCC, idDXContext, pCmd);
     
    25232519{
    25242520#ifdef VMSVGA3D_DX
    2525 ASMBreakpoint();
    2526     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    2527     RT_NOREF(pSvgaR3State, pCmd, cbCmd);
    2528     return vmsvga3dDXDestroyShaderResourceView(pThisCC, idDXContext);
     2521//ASMBreakpoint();
     2522    RT_NOREF(cbCmd);
     2523    return vmsvga3dDXDestroyShaderResourceView(pThisCC, idDXContext, pCmd);
    25292524#else
    25302525    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
     
    25522547{
    25532548#ifdef VMSVGA3D_DX
    2554 ASMBreakpoint();
    2555     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    2556     RT_NOREF(pSvgaR3State, pCmd, cbCmd);
    2557     return vmsvga3dDXDestroyRenderTargetView(pThisCC, idDXContext);
     2549//ASMBreakpoint();
     2550    RT_NOREF(cbCmd);
     2551    return vmsvga3dDXDestroyRenderTargetView(pThisCC, idDXContext, pCmd);
    25582552#else
    25592553    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
     
    25672561{
    25682562#ifdef VMSVGA3D_DX
    2569 ASMBreakpoint();
    2570     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    2571     RT_NOREF(pSvgaR3State, pCmd, cbCmd);
    2572     return vmsvga3dDXDefineDepthStencilView(pThisCC, idDXContext);
     2563//ASMBreakpoint();
     2564    RT_NOREF(cbCmd);
     2565    SVGA3dCmdDXDefineDepthStencilView_v2 cmd;
     2566    cmd.depthStencilViewId = pCmd->depthStencilViewId;
     2567    cmd.sid                = pCmd->sid;
     2568    cmd.format             = pCmd->format;
     2569    cmd.resourceDimension  = pCmd->resourceDimension;
     2570    cmd.mipSlice           = pCmd->mipSlice;
     2571    cmd.firstArraySlice    = pCmd->firstArraySlice;
     2572    cmd.arraySize          = pCmd->arraySize;
     2573    cmd.flags              = 0;
     2574    return vmsvga3dDXDefineDepthStencilView(pThisCC, idDXContext, &cmd);
    25732575#else
    25742576    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
     
    25822584{
    25832585#ifdef VMSVGA3D_DX
    2584 ASMBreakpoint();
    2585     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    2586     RT_NOREF(pSvgaR3State, pCmd, cbCmd);
    2587     return vmsvga3dDXDestroyDepthStencilView(pThisCC, idDXContext);
     2586//ASMBreakpoint();
     2587    RT_NOREF(cbCmd);
     2588    return vmsvga3dDXDestroyDepthStencilView(pThisCC, idDXContext, pCmd);
    25882589#else
    25892590    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
     
    36323633{
    36333634#ifdef VMSVGA3D_DX
    3634 ASMBreakpoint();
    3635     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    3636     RT_NOREF(pSvgaR3State, pCmd, cbCmd);
    3637     return vmsvga3dDXDefineDepthStencilView_v2(pThisCC, idDXContext);
     3635//ASMBreakpoint();
     3636    RT_NOREF(cbCmd);
     3637    return vmsvga3dDXDefineDepthStencilView(pThisCC, idDXContext, pCmd);
    36383638#else
    36393639    RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd);
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-shader.cpp

    r88786 r88803  
    15601560    ASSERT_GUEST_RETURN(   pProgramToken->majorVersion >= 4
    15611561                        && pProgramToken->programType <= VGPU10_COMPUTE_SHADER, VERR_INVALID_PARAMETER);
     1562    if (pInfo)
     1563        pInfo->enmProgramType = (VGPU10_PROGRAM_TYPE)pProgramToken->programType;
    15621564
    15631565    uint32_t const cToken = paToken[1];
    15641566    Log6(("Shader version %d.%d type %s(%d) Length %d\n",
    15651567          pProgramToken->majorVersion, pProgramToken->minorVersion, dxbcShaderTypeToString(pProgramToken->programType), pProgramToken->programType, cToken));
    1566 
    15671568    ASSERT_GUEST_RETURN(cbShaderCode / 4 == cToken, VERR_INVALID_PARAMETER); /* Declared length should be equal to the actual. */
    15681569
     
    16111612        }
    16121613    }
     1614
     1615#ifdef LOG_ENABLED
     1616    if (pInfo->cInputSignature)
     1617    {
     1618        Log6(("Input signatures:\n"));
     1619        for (uint32_t i = 0; i < pInfo->cInputSignature; ++i)
     1620            Log6(("  [%u]: %u %u 0x%X\n", i, pInfo->aInputSignature[i].registerIndex, pInfo->aInputSignature[i].semanticName, pInfo->aInputSignature[i].mask));
     1621    }
     1622    if (pInfo->cOutputSignature)
     1623    {
     1624        Log6(("Output signatures:\n"));
     1625        for (uint32_t i = 0; i < pInfo->cOutputSignature; ++i)
     1626            Log6(("  [%u]: %u %u 0x%X\n", i, pInfo->aOutputSignature[i].registerIndex, pInfo->aOutputSignature[i].semanticName, pInfo->aOutputSignature[i].mask));
     1627    }
     1628    if (pInfo->cPatchConstantSignature)
     1629    {
     1630        Log6(("Patch constant signatures:\n"));
     1631        for (uint32_t i = 0; i < pInfo->cPatchConstantSignature; ++i)
     1632            Log6(("  [%u]: %u %u 0x%X\n", i, pInfo->aPatchConstantSignature[i].registerIndex, pInfo->aPatchConstantSignature[i].semanticName, pInfo->aPatchConstantSignature[i].mask));
     1633    }
     1634#endif
    16131635
    16141636    return VINF_SUCCESS;
     
    16951717};
    16961718
    1697 
    1698 static VGPUSemanticInfo const *dxbcSemanticInfo(SVGA3dDXSignatureSemanticName enmSemanticName)
     1719static VGPUSemanticInfo const g_SemanticPSOutput =
     1720    { "SV_TARGET",                      3 }; // SVGADX_SIGNATURE_SEMANTIC_NAME_UNDEFINED                          0
     1721
     1722
     1723static VGPUSemanticInfo const *dxbcSemanticInfo(DXShaderInfo const *pInfo, SVGA3dDXSignatureSemanticName enmSemanticName, uint32_t u32BlobType)
    16991724{
    17001725    if (enmSemanticName < RT_ELEMENTS(g_aSemanticInfo))
     1726    {
     1727        if (   enmSemanticName == 0
     1728            && pInfo->enmProgramType == VGPU10_PIXEL_SHADER
     1729            && u32BlobType == DXBC_BLOB_TYPE_OSGN)
     1730            return &g_SemanticPSOutput;
    17011731        return &g_aSemanticInfo[enmSemanticName];
     1732    }
    17021733    return &g_aSemanticInfo[0];
    17031734}
    17041735
    17051736
    1706 static int dxbcCreateIOSGNBlob(DXBCHeader *pHdr, uint32_t u32BlobType,
     1737static int dxbcCreateIOSGNBlob(DXShaderInfo const *pInfo, DXBCHeader *pHdr, uint32_t u32BlobType,
    17071738                               uint32_t cSignature, SVGA3dDXSignatureEntry const *paSignature, DXBCByteWriter *w)
    17081739{
     
    17461777
    17471778        ASSERT_GUEST_RETURN(src->semanticName < SVGADX_SIGNATURE_SEMANTIC_NAME_MAX, VERR_INVALID_PARAMETER);
    1748         VGPUSemanticInfo const *pSemanticInfo = dxbcSemanticInfo(src->semanticName);
     1779        VGPUSemanticInfo const *pSemanticInfo = dxbcSemanticInfo(pInfo, src->semanticName, u32BlobType);
    17491780
    17501781        dst->offElementName   = cbBlob; /* Offset of the semantic's name relative to the start of the blob (without hdr). */
     
    17541785        dst->idxRegister      = src->registerIndex;
    17551786        dst->mask             = src->mask;
    1756         dst->mask2            = src->mask;
     1787        if (u32BlobType == DXBC_BLOB_TYPE_OSGN)
     1788            dst->mask2            = 0;
     1789        else
     1790            dst->mask2            = src->mask;
    17571791
    17581792        /* Figure out the semantic name for this element. */
     
    18281862
    18291863    pHdr->aBlobOffset[iBlob++] = dxbcByteWriterSize(w);
    1830     rc = dxbcCreateIOSGNBlob(pHdr, DXBC_BLOB_TYPE_ISGN, pInfo->cInputSignature, &pInfo->aInputSignature[0], w);
     1864    rc = dxbcCreateIOSGNBlob(pInfo, pHdr, DXBC_BLOB_TYPE_ISGN, pInfo->cInputSignature, &pInfo->aInputSignature[0], w);
    18311865    AssertRCReturn(rc, rc);
    18321866
    18331867    pHdr->aBlobOffset[iBlob++] = dxbcByteWriterSize(w);
    1834     rc = dxbcCreateIOSGNBlob(pHdr, DXBC_BLOB_TYPE_OSGN, pInfo->cOutputSignature, &pInfo->aOutputSignature[0], w);
     1868    rc = dxbcCreateIOSGNBlob(pInfo, pHdr, DXBC_BLOB_TYPE_OSGN, pInfo->cOutputSignature, &pInfo->aOutputSignature[0], w);
    18351869    AssertRCReturn(rc, rc);
    18361870
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-shader.h

    r88786 r88803  
    4444typedef struct DXShaderInfo
    4545{
     46    VGPU10_PROGRAM_TYPE enmProgramType;
    4647    uint32_t cInputSignature;
    4748    uint32_t cOutputSignature;
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx.cpp

    r88786 r88803  
    206206
    207207
    208 int vmsvga3dDXSetShaderResources(PVGASTATECC pThisCC, uint32_t idDXContext)
     208int vmsvga3dDXSetShaderResources(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXSetShaderResources const *pCmd, uint32_t cShaderResourceViewId, SVGA3dShaderResourceViewId const *paShaderResourceViewId)
    209209{
    210210    int rc;
     
    218218    AssertRCReturn(rc, rc);
    219219
    220     rc = pSvgaR3State->pFuncsDX->pfnDXSetShaderResources(pThisCC, pDXContext);
     220    ASSERT_GUEST_RETURN(pCmd->startView < SVGA3D_DX_MAX_SRVIEWS, VERR_INVALID_PARAMETER);
     221    ASSERT_GUEST_RETURN(cShaderResourceViewId <= SVGA3D_DX_MAX_SRVIEWS - pCmd->startView, VERR_INVALID_PARAMETER);
     222    ASSERT_GUEST_RETURN(pCmd->type >= SVGA3D_SHADERTYPE_MIN && pCmd->type < SVGA3D_SHADERTYPE_MAX, VERR_INVALID_PARAMETER);
     223    ASSERT_GUEST_RETURN(pDXContext->cot.paSRView, VERR_INVALID_STATE);
     224    for (uint32_t i = 0; i < cShaderResourceViewId; ++i)
     225        ASSERT_GUEST_RETURN(   paShaderResourceViewId[i] < pDXContext->cot.cSRView
     226                            || paShaderResourceViewId[i] == SVGA3D_INVALID_ID, VERR_INVALID_PARAMETER);
     227    RT_UNTRUSTED_VALIDATED_FENCE();
     228
     229    rc = pSvgaR3State->pFuncsDX->pfnDXSetShaderResources(pThisCC, pDXContext, pCmd->startView, pCmd->type, cShaderResourceViewId, paShaderResourceViewId);
    221230    return rc;
    222231}
     
    248257
    249258
    250 int vmsvga3dDXSetSamplers(PVGASTATECC pThisCC, uint32_t idDXContext, uint32_t startSampler, SVGA3dShaderType type, uint32_t cSamplerId, SVGA3dSamplerId const *paSamplerId)
     259int vmsvga3dDXSetSamplers(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXSetSamplers const *pCmd, uint32_t cSamplerId, SVGA3dSamplerId const *paSamplerId)
    251260{
    252261    int rc;
     
    260269    AssertRCReturn(rc, rc);
    261270
    262     ASSERT_GUEST_RETURN(startSampler < SVGA3D_DX_MAX_SAMPLERS, VERR_INVALID_PARAMETER);
    263     ASSERT_GUEST_RETURN(cSamplerId <= SVGA3D_DX_MAX_SAMPLERS - startSampler, VERR_INVALID_PARAMETER);
    264     ASSERT_GUEST_RETURN(type >= SVGA3D_SHADERTYPE_MIN && type < SVGA3D_SHADERTYPE_MAX, VERR_INVALID_PARAMETER);
    265     RT_UNTRUSTED_VALIDATED_FENCE();
    266 
    267     rc = pSvgaR3State->pFuncsDX->pfnDXSetSamplers(pThisCC, pDXContext, startSampler, type, cSamplerId, paSamplerId);
     271    ASSERT_GUEST_RETURN(pCmd->startSampler < SVGA3D_DX_MAX_SAMPLERS, VERR_INVALID_PARAMETER);
     272    ASSERT_GUEST_RETURN(cSamplerId <= SVGA3D_DX_MAX_SAMPLERS - pCmd->startSampler, VERR_INVALID_PARAMETER);
     273    ASSERT_GUEST_RETURN(pCmd->type >= SVGA3D_SHADERTYPE_MIN && pCmd->type < SVGA3D_SHADERTYPE_MAX, VERR_INVALID_PARAMETER);
     274    ASSERT_GUEST_RETURN(pDXContext->cot.paSampler, VERR_INVALID_STATE);
     275    for (uint32_t i = 0; i < cSamplerId; ++i)
     276        ASSERT_GUEST_RETURN(paSamplerId[i] < pDXContext->cot.cSampler, VERR_INVALID_PARAMETER);
     277    RT_UNTRUSTED_VALIDATED_FENCE();
     278
     279    rc = pSvgaR3State->pFuncsDX->pfnDXSetSamplers(pThisCC, pDXContext, pCmd->startSampler, pCmd->type, cSamplerId, paSamplerId);
    268280    return rc;
    269281}
     
    448460    ASSERT_GUEST_RETURN(depthStencilViewId < pDXContext->cot.cDSView || depthStencilViewId == SVGA_ID_INVALID, VERR_INVALID_PARAMETER);
    449461    for (uint32_t i = 0; i < cRenderTargetViewId; ++i)
    450         ASSERT_GUEST_RETURN(paRenderTargetViewId[i] < pDXContext->cot.cRTView || paRenderTargetViewId[i] == SVGA_ID_INVALID, VERR_INVALID_PARAMETER);
     462        ASSERT_GUEST_RETURN(   paRenderTargetViewId[i] < pDXContext->cot.cRTView
     463                            || paRenderTargetViewId[i] == SVGA_ID_INVALID, VERR_INVALID_PARAMETER);
    451464    RT_UNTRUSTED_VALIDATED_FENCE();
    452465
    453466    rc = pSvgaR3State->pFuncsDX->pfnDXSetRenderTargets(pThisCC, pDXContext, depthStencilViewId, cRenderTargetViewId, paRenderTargetViewId);
     467    /// @todo if (RT_SUCCESS(rc))
     468    //{
     469    //    for (uint32_t i = 0; i < cRenderTargetViewId; ++i)
     470    //        pDXContext->svgaDXContext.renderState.renderTargetViewIds[i] = paRenderTargetViewId[i];
     471    //}
    454472    return rc;
    455473}
     
    709727
    710728
    711 int vmsvga3dDXClearRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext)
     729int vmsvga3dDXClearRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXClearRenderTargetView const *pCmd)
    712730{
    713731    int rc;
     
    721739    AssertRCReturn(rc, rc);
    722740
    723     rc = pSvgaR3State->pFuncsDX->pfnDXClearRenderTargetView(pThisCC, pDXContext);
    724     return rc;
    725 }
    726 
    727 
    728 int vmsvga3dDXClearDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext)
     741    SVGA3dRenderTargetViewId const renderTargetViewId = pCmd->renderTargetViewId;
     742
     743    ASSERT_GUEST_RETURN(pDXContext->cot.paRTView, VERR_INVALID_STATE);
     744    ASSERT_GUEST_RETURN(renderTargetViewId < pDXContext->cot.cRTView, VERR_INVALID_PARAMETER);
     745    RT_UNTRUSTED_VALIDATED_FENCE();
     746
     747    rc = pSvgaR3State->pFuncsDX->pfnDXClearRenderTargetView(pThisCC, pDXContext, renderTargetViewId, &pCmd->rgba);
     748    return rc;
     749}
     750
     751
     752int vmsvga3dDXClearDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXClearDepthStencilView const *pCmd)
    729753{
    730754    int rc;
     
    738762    AssertRCReturn(rc, rc);
    739763
    740     rc = pSvgaR3State->pFuncsDX->pfnDXClearDepthStencilView(pThisCC, pDXContext);
    741     return rc;
    742 }
    743 
    744 
    745 int vmsvga3dDXPredCopyRegion(PVGASTATECC pThisCC, uint32_t idDXContext)
     764    SVGA3dDepthStencilViewId const depthStencilViewId = pCmd->depthStencilViewId;
     765
     766    ASSERT_GUEST_RETURN(pDXContext->cot.paDSView, VERR_INVALID_STATE);
     767    ASSERT_GUEST_RETURN(depthStencilViewId < pDXContext->cot.cDSView, VERR_INVALID_PARAMETER);
     768    RT_UNTRUSTED_VALIDATED_FENCE();
     769
     770    rc = pSvgaR3State->pFuncsDX->pfnDXClearDepthStencilView(pThisCC, pDXContext, pCmd->flags, depthStencilViewId, pCmd->depth, (uint8_t)pCmd->stencil);
     771    return rc;
     772}
     773
     774
     775int vmsvga3dDXPredCopyRegion(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXPredCopyRegion const *pCmd)
    746776{
    747777    int rc;
     
    755785    AssertRCReturn(rc, rc);
    756786
    757     rc = pSvgaR3State->pFuncsDX->pfnDXPredCopyRegion(pThisCC, pDXContext);
     787    rc = pSvgaR3State->pFuncsDX->pfnDXPredCopyRegion(pThisCC, pDXContext, pCmd->dstSid, pCmd->dstSubResource, pCmd->srcSid, pCmd->srcSubResource, &pCmd->box);
    758788    return rc;
    759789}
     
    794824
    795825
    796 int vmsvga3dDXGenMips(PVGASTATECC pThisCC, uint32_t idDXContext)
     826int vmsvga3dDXGenMips(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXGenMips const *pCmd)
    797827{
    798828    int rc;
     
    806836    AssertRCReturn(rc, rc);
    807837
    808     rc = pSvgaR3State->pFuncsDX->pfnDXGenMips(pThisCC, pDXContext);
     838    SVGA3dShaderResourceViewId const shaderResourceViewId = pCmd->shaderResourceViewId;
     839
     840    ASSERT_GUEST_RETURN(pDXContext->cot.paSRView, VERR_INVALID_STATE);
     841    ASSERT_GUEST_RETURN(shaderResourceViewId < pDXContext->cot.cSRView, VERR_INVALID_PARAMETER);
     842    RT_UNTRUSTED_VALIDATED_FENCE();
     843
     844    rc = pSvgaR3State->pFuncsDX->pfnDXGenMips(pThisCC, pDXContext, shaderResourceViewId);
    809845    return rc;
    810846}
     
    891927
    892928
    893 int vmsvga3dDXDestroyShaderResourceView(PVGASTATECC pThisCC, uint32_t idDXContext)
     929int vmsvga3dDXDestroyShaderResourceView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyShaderResourceView const *pCmd)
    894930{
    895931    int rc;
     
    903939    AssertRCReturn(rc, rc);
    904940
    905     rc = pSvgaR3State->pFuncsDX->pfnDXDestroyShaderResourceView(pThisCC, pDXContext);
     941    SVGA3dShaderResourceViewId const shaderResourceViewId = pCmd->shaderResourceViewId;
     942
     943    ASSERT_GUEST_RETURN(pDXContext->cot.paSRView, VERR_INVALID_STATE);
     944    ASSERT_GUEST_RETURN(shaderResourceViewId < pDXContext->cot.cSRView, VERR_INVALID_PARAMETER);
     945    RT_UNTRUSTED_VALIDATED_FENCE();
     946
     947    SVGACOTableDXSRViewEntry *pEntry = &pDXContext->cot.paSRView[shaderResourceViewId];
     948    RT_ZERO(*pEntry);
     949
     950    rc = pSvgaR3State->pFuncsDX->pfnDXDestroyShaderResourceView(pThisCC, pDXContext, shaderResourceViewId);
    906951    return rc;
    907952}
     
    937982
    938983
    939 int vmsvga3dDXDestroyRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext)
     984int vmsvga3dDXDestroyRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyRenderTargetView const *pCmd)
    940985{
    941986    int rc;
     
    949994    AssertRCReturn(rc, rc);
    950995
    951     rc = pSvgaR3State->pFuncsDX->pfnDXDestroyRenderTargetView(pThisCC, pDXContext);
    952     return rc;
    953 }
    954 
    955 
    956 int vmsvga3dDXDefineDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext)
     996    SVGA3dRenderTargetViewId const renderTargetViewId = pCmd->renderTargetViewId;
     997
     998    ASSERT_GUEST_RETURN(pDXContext->cot.paRTView, VERR_INVALID_STATE);
     999    ASSERT_GUEST_RETURN(renderTargetViewId < pDXContext->cot.cRTView, VERR_INVALID_PARAMETER);
     1000    RT_UNTRUSTED_VALIDATED_FENCE();
     1001
     1002    SVGACOTableDXRTViewEntry *pEntry = &pDXContext->cot.paRTView[renderTargetViewId];
     1003    RT_ZERO(*pEntry);
     1004
     1005    rc = pSvgaR3State->pFuncsDX->pfnDXDestroyRenderTargetView(pThisCC, pDXContext, renderTargetViewId);
     1006    /// @todo for (uint32_t i = 0; i < SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS; ++i)
     1007    //{
     1008    //    if (pDXContext->svgaDXContext.renderState.renderTargetViewIds[i] == renderTargetViewId)
     1009    //        pDXContext->svgaDXContext.renderState.renderTargetViewIds[i] = SVGA_ID_INVALID;
     1010    //}
     1011    return rc;
     1012}
     1013
     1014
     1015int vmsvga3dDXDefineDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDefineDepthStencilView_v2 const *pCmd)
    9571016{
    9581017    int rc;
     
    9661025    AssertRCReturn(rc, rc);
    9671026
    968     rc = pSvgaR3State->pFuncsDX->pfnDXDefineDepthStencilView(pThisCC, pDXContext);
    969     return rc;
    970 }
    971 
    972 
    973 int vmsvga3dDXDestroyDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext)
     1027    SVGA3dDepthStencilViewId const depthStencilViewId = pCmd->depthStencilViewId;
     1028
     1029    ASSERT_GUEST_RETURN(pDXContext->cot.paDSView, VERR_INVALID_STATE);
     1030    ASSERT_GUEST_RETURN(depthStencilViewId < pDXContext->cot.cDSView, VERR_INVALID_PARAMETER);
     1031    RT_UNTRUSTED_VALIDATED_FENCE();
     1032
     1033    SVGACOTableDXDSViewEntry *pEntry = &pDXContext->cot.paDSView[depthStencilViewId];
     1034    pEntry->sid               = pCmd->sid;
     1035    pEntry->format            = pCmd->format;
     1036    pEntry->resourceDimension = pCmd->resourceDimension;
     1037    pEntry->mipSlice          = pCmd->mipSlice;
     1038    pEntry->firstArraySlice   = pCmd->firstArraySlice;
     1039    pEntry->arraySize         = pCmd->arraySize;
     1040    pEntry->flags             = pCmd->flags;
     1041
     1042    rc = pSvgaR3State->pFuncsDX->pfnDXDefineDepthStencilView(pThisCC, pDXContext, depthStencilViewId, pEntry);
     1043    return rc;
     1044}
     1045
     1046
     1047int vmsvga3dDXDestroyDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyDepthStencilView const *pCmd)
    9741048{
    9751049    int rc;
     
    9831057    AssertRCReturn(rc, rc);
    9841058
    985     rc = pSvgaR3State->pFuncsDX->pfnDXDestroyDepthStencilView(pThisCC, pDXContext);
     1059    SVGA3dDepthStencilViewId const depthStencilViewId = pCmd->depthStencilViewId;
     1060
     1061    ASSERT_GUEST_RETURN(pDXContext->cot.paDSView, VERR_INVALID_STATE);
     1062    ASSERT_GUEST_RETURN(depthStencilViewId < pDXContext->cot.cDSView, VERR_INVALID_PARAMETER);
     1063    RT_UNTRUSTED_VALIDATED_FENCE();
     1064
     1065    SVGACOTableDXDSViewEntry *pEntry = &pDXContext->cot.paDSView[depthStencilViewId];
     1066    RT_ZERO(*pEntry);
     1067
     1068    rc = pSvgaR3State->pFuncsDX->pfnDXDestroyDepthStencilView(pThisCC, pDXContext, depthStencilViewId);
    9861069    return rc;
    9871070}
     
    25052588
    25062589
    2507 int vmsvga3dDXDefineDepthStencilView_v2(PVGASTATECC pThisCC, uint32_t idDXContext)
    2508 {
    2509     int rc;
    2510     PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;
    2511     AssertReturn(pSvgaR3State->pFuncsDX && pSvgaR3State->pFuncsDX->pfnDXDefineDepthStencilView_v2, VERR_INVALID_STATE);
    2512     PVMSVGA3DSTATE p3dState = pThisCC->svga.p3dState;
    2513     AssertReturn(p3dState, VERR_INVALID_STATE);
    2514 
    2515     PVMSVGA3DDXCONTEXT pDXContext;
    2516     rc = vmsvga3dDXContextFromCid(p3dState, idDXContext, &pDXContext);
    2517     AssertRCReturn(rc, rc);
    2518 
    2519     rc = pSvgaR3State->pFuncsDX->pfnDXDefineDepthStencilView_v2(pThisCC, pDXContext);
    2520     return rc;
    2521 }
    2522 
    2523 
    25242590int vmsvga3dDXDefineStreamOutputWithMob(PVGASTATECC pThisCC, uint32_t idDXContext)
    25252591{
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win-dx.cpp

    r88787 r88803  
    154154} VMSVGA3DBACKENDDXCONTEXT;
    155155
     156typedef HRESULT FN_D3D_DISASSEMBLE(LPCVOID pSrcData, SIZE_T SrcDataSize, UINT Flags, LPCSTR szComments, ID3D10Blob **ppDisassembly);
     157typedef FN_D3D_DISASSEMBLE *PFN_D3D_DISASSEMBLE;
     158
    156159typedef struct VMSVGA3DBACKEND
    157160{
    158161    RTLDRMOD                    hD3D11;
    159162    PFN_D3D11_CREATE_DEVICE     pfnD3D11CreateDevice;
     163
     164    RTLDRMOD                    hD3DCompiler;
     165    PFN_D3D_DISASSEMBLE         pfnD3DDisassemble;
    160166
    161167    ID3D11Device               *pDevice;               /* Device for the VMSVGA3D context independent operation. */
     
    949955
    950956
     957static HRESULT dxDepthStencilViewCreate(DXDEVICE *pDevice, SVGACOTableDXDSViewEntry const *pEntry, VMSVGA3DBACKENDSURFACE *pBackendSurface, ID3D11DepthStencilView **pp)
     958{
     959    ID3D11Resource *pResource = pBackendSurface->u.Texture.pTexture;
     960
     961    D3D11_DEPTH_STENCIL_VIEW_DESC desc;
     962    RT_ZERO(desc);
     963    desc.Format = vmsvgaDXSurfaceFormat2Dxgi(pEntry->format);
     964    AssertReturn(desc.Format != DXGI_FORMAT_UNKNOWN, E_FAIL);
     965    desc.Flags = pEntry->flags;
     966    switch (pEntry->resourceDimension)
     967    {
     968        case SVGA3D_RESOURCE_TEXTURE1D:
     969            if (pEntry->arraySize <= 1)
     970            {
     971                desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE1D;
     972                desc.Texture1D.MipSlice = pEntry->mipSlice;
     973            }
     974            else
     975            {
     976                desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE1DARRAY;
     977                desc.Texture1DArray.MipSlice = pEntry->mipSlice;
     978                desc.Texture1DArray.FirstArraySlice = pEntry->firstArraySlice;
     979                desc.Texture1DArray.ArraySize = pEntry->arraySize;
     980            }
     981            break;
     982        case SVGA3D_RESOURCE_TEXTURE2D:
     983            if (pEntry->arraySize <= 1)
     984            {
     985                desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
     986                desc.Texture2D.MipSlice = pEntry->mipSlice;
     987            }
     988            else
     989            {
     990                desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DARRAY;
     991                desc.Texture2DArray.MipSlice = pEntry->mipSlice;
     992                desc.Texture2DArray.FirstArraySlice = pEntry->firstArraySlice;
     993                desc.Texture2DArray.ArraySize = pEntry->arraySize;
     994            }
     995            break;
     996        default:
     997            ASSERT_GUEST_FAILED_RETURN(E_INVALIDARG);
     998    }
     999
     1000    HRESULT hr = pDevice->pDevice->CreateDepthStencilView(pResource, &desc, pp);
     1001    Assert(SUCCEEDED(hr));
     1002    return hr;
     1003}
     1004
     1005
    9511006static HRESULT dxShaderCreate(DXDEVICE *pDevice, PVMSVGA3DSHADER pShader, DXSHADER *pDXShader)
    9521007{
     
    10331088    }
    10341089}
     1090
     1091
     1092static void dxShaderResourceViewSet(DXDEVICE *pDevice, SVGA3dShaderType type, uint32_t startView, uint32_t cShaderResourceView, ID3D11ShaderResourceView * const *papShaderResourceView)
     1093{
     1094    switch (type)
     1095    {
     1096        case SVGA3D_SHADERTYPE_VS:
     1097            pDevice->pImmediateContext->VSSetShaderResources(startView, cShaderResourceView, papShaderResourceView);
     1098            break;
     1099        case SVGA3D_SHADERTYPE_PS:
     1100            pDevice->pImmediateContext->PSSetShaderResources(startView, cShaderResourceView, papShaderResourceView);
     1101            break;
     1102        case SVGA3D_SHADERTYPE_GS:
     1103        case SVGA3D_SHADERTYPE_HS:
     1104        case SVGA3D_SHADERTYPE_DS:
     1105        case SVGA3D_SHADERTYPE_CS:
     1106        default:
     1107            ASSERT_GUEST_FAILED_RETURN_VOID();
     1108    }
     1109}
     1110
    10351111
    10361112
     
    12031279    }
    12041280
    1205     /** @todo Various texture types. */
    1206 
    12071281    PVMSVGA3DBACKENDSURFACE pBackendSurface = (PVMSVGA3DBACKENDSURFACE)RTMemAllocZ(sizeof(VMSVGA3DBACKENDSURFACE));
    12081282    AssertPtrReturn(pBackendSurface, VERR_NO_MEMORY);
    12091283
     1284    /** @todo Various texture types. */
     1285    ASMBreakpoint();
     1286
    12101287    RTMemFree(pBackendSurface);
    12111288    return VERR_NOT_IMPLEMENTED;
     1289}
     1290
     1291
     1292static int vmsvga3dBackSurfaceCreateDepthStencilTexture(PVMSVGA3DSTATE p3dState, PVMSVGA3DDXCONTEXT pDXContext, PVMSVGA3DSURFACE pSurface)
     1293{
     1294    DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device;
     1295    AssertReturn(pDevice->pDevice, VERR_INVALID_STATE);
     1296
     1297    if (pSurface->pBackendSurface != NULL)
     1298    {
     1299        AssertFailed(); /** @todo Should the function not be used like that? */
     1300        vmsvga3dBackSurfaceDestroy(p3dState, pSurface);
     1301    }
     1302
     1303    PVMSVGA3DBACKENDSURFACE pBackendSurface = (PVMSVGA3DBACKENDSURFACE)RTMemAllocZ(sizeof(VMSVGA3DBACKENDSURFACE));
     1304    AssertPtrReturn(pBackendSurface, VERR_NO_MEMORY);
     1305
     1306    D3D11_TEXTURE2D_DESC td;
     1307    RT_ZERO(td);
     1308    td.Width              = pSurface->paMipmapLevels[0].mipmapSize.width;
     1309    td.Height             = pSurface->paMipmapLevels[0].mipmapSize.height;
     1310    Assert(pSurface->cLevels == 1);
     1311    td.MipLevels          = 1;
     1312    td.ArraySize          = 1;
     1313    td.Format             = vmsvgaDXSurfaceFormat2Dxgi(pSurface->format);
     1314    AssertReturn(td.Format != DXGI_FORMAT_UNKNOWN, E_FAIL);
     1315    td.SampleDesc.Count   = 1;
     1316    td.SampleDesc.Quality = 0;
     1317    td.Usage              = D3D11_USAGE_DEFAULT;
     1318    td.BindFlags          = D3D11_BIND_DEPTH_STENCIL;
     1319    td.CPUAccessFlags     = 0;
     1320    td.MiscFlags          = 0;
     1321
     1322    HRESULT hr = pDevice->pDevice->CreateTexture2D(&td, 0, &pBackendSurface->u.Texture.pTexture);
     1323    Assert(SUCCEEDED(hr));
     1324    if (SUCCEEDED(hr))
     1325    {
     1326        /*
     1327         * Success.
     1328         */
     1329        pBackendSurface->enmResType = VMSVGA3D_RESTYPE_TEXTURE;
     1330        pBackendSurface->enmDxgiFormat = td.Format;
     1331        pSurface->pBackendSurface = pBackendSurface;
     1332        pSurface->idAssociatedContext = pDXContext->cid;
     1333        pSurface->fDirty = true;
     1334        return VINF_SUCCESS;
     1335    }
     1336
     1337    /* Failure. */
     1338    D3D_RELEASE(pBackendSurface->u.Texture.pStagingTexture);
     1339    D3D_RELEASE(pBackendSurface->u.Texture.pDynamicTexture);
     1340    D3D_RELEASE(pBackendSurface->u.Texture.pTexture);
     1341    RTMemFree(pBackendSurface);
     1342    return VERR_NO_MEMORY;
    12121343}
    12131344
     
    13341465    {
    13351466        rc = RTLdrGetSymbol(pBackend->hD3D11, "D3D11CreateDevice", (void **)&pBackend->pfnD3D11CreateDevice);
     1467        AssertRC(rc);
     1468    }
     1469
     1470    rc = RTLdrLoadSystem("D3DCompiler_47", /* fNoUnload = */ true, &pBackend->hD3DCompiler);
     1471    AssertRC(rc);
     1472    if (RT_SUCCESS(rc))
     1473    {
     1474        rc = RTLdrGetSymbol(pBackend->hD3DCompiler, "D3DDisassemble", (void **)&pBackend->pfnD3DDisassemble);
    13361475        AssertRC(rc);
    13371476    }
     
    16681807    if (!pBackendSurface)
    16691808        return VERR_INVALID_PARAMETER;
     1809        // AssertFailedReturn(VERR_INVALID_PARAMETER); /** @todo The caller must directly use the surface memory. */
    16701810
    16711811    PVMSVGA3DDXCONTEXT pDXContext;
     
    17461886    {
    17471887        AssertReturn(pDevice && pDevice->pDevice, VERR_INTERNAL_ERROR);
    1748 ASMBreakpoint();
     1888
    17491889        ID3D11Texture2D *pMappedTexture;
    17501890        if (enmMapType == VMSVGA3D_SURFACE_MAP_READ)
     
    18722012    {
    18732013        AssertReturn(pDevice && pDevice->pDevice, VERR_INTERNAL_ERROR);
    1874 ASMBreakpoint();
     2014
    18752015        ID3D11Texture2D *pMappedTexture;
    18762016        if (pMap->enmMapType == VMSVGA3D_SURFACE_MAP_READ)
     
    32593399
    32603400
    3261 static DECLCALLBACK(int) vmsvga3dBackDXSetShaderResources(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    3262 {
    3263     PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
    3264 
    3265     RT_NOREF(pBackend, pDXContext);
    3266     AssertFailed(); /** @todo Implement */
    3267     return VERR_NOT_IMPLEMENTED;
     3401static DECLCALLBACK(int) vmsvga3dBackDXSetShaderResources(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t startView, SVGA3dShaderType type, uint32_t cShaderResourceViewId, SVGA3dShaderResourceViewId const *paShaderResourceViewId)
     3402{
     3403    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     3404    RT_NOREF(pBackend);
     3405
     3406    DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device;
     3407    AssertReturn(pDevice->pDevice, VERR_INVALID_STATE);
     3408
     3409    uint32_t const idxShaderState = type - SVGA3D_SHADERTYPE_MIN;
     3410    ID3D11ShaderResourceView *papShaderResourceView[SVGA3D_DX_MAX_SRVIEWS];
     3411    for (uint32_t i = 0; i < cShaderResourceViewId; ++i)
     3412    {
     3413        SVGA3dShaderResourceViewId shaderResourceViewId = paShaderResourceViewId[i];
     3414        if (shaderResourceViewId != SVGA3D_INVALID_ID)
     3415        {
     3416            ASSERT_GUEST_RETURN(shaderResourceViewId < pDXContext->pBackendDXContext->cShaderResourceView, VERR_INVALID_PARAMETER);
     3417            papShaderResourceView[i] = pDXContext->pBackendDXContext->papShaderResourceView[shaderResourceViewId];
     3418        }
     3419        else
     3420            papShaderResourceView[i] = NULL;
     3421
     3422        pDXContext->svgaDXContext.shaderState[idxShaderState].shaderResources[startView + i] = shaderResourceViewId;
     3423    }
     3424
     3425    dxShaderResourceViewSet(pDevice, type, startView, cShaderResourceViewId, papShaderResourceView);
     3426    return VINF_SUCCESS;
    32683427}
    32693428
     
    32953454
    32963455    uint32_t const idxShaderState = type - SVGA3D_SHADERTYPE_MIN;
    3297     ID3D11SamplerState *aSamplerState[SVGA3D_DX_MAX_SAMPLERS];
     3456    ID3D11SamplerState *papSamplerState[SVGA3D_DX_MAX_SAMPLERS];
    32983457    for (uint32_t i = 0; i < cSamplerId; ++i)
    32993458    {
     
    33023461        {
    33033462            ASSERT_GUEST_RETURN(samplerId < pDXContext->pBackendDXContext->cSamplerState, VERR_INVALID_PARAMETER);
    3304             aSamplerState[i] = pDXContext->pBackendDXContext->papSamplerState[samplerId];
     3463            papSamplerState[i] = pDXContext->pBackendDXContext->papSamplerState[samplerId];
    33053464        }
    33063465        else
    3307             aSamplerState[i] = NULL;
     3466            papSamplerState[i] = NULL;
    33083467
    33093468        pDXContext->svgaDXContext.shaderState[idxShaderState].samplers[startSampler + i] = samplerId;
    33103469    }
    33113470
    3312     dxSamplerSet(pDevice, type, startSampler, cSamplerId, aSamplerState);
     3471    dxSamplerSet(pDevice, type, startSampler, cSamplerId, papSamplerState);
    33133472    return VINF_SUCCESS;
    33143473}
     
    36223781    AssertReturn(pDevice->pDevice, VERR_INVALID_STATE);
    36233782
    3624     ID3D11RenderTargetView *aRenderTargetViews[SVGA3D_MAX_RENDER_TARGETS];
     3783    ID3D11RenderTargetView *papRenderTargetViews[SVGA3D_MAX_RENDER_TARGETS];
    36253784    for (uint32_t i = 0; i < cRenderTargetViewId; ++i)
    36263785    {
     
    36293788        {
    36303789            ASSERT_GUEST_RETURN(renderTargetViewId < pDXContext->pBackendDXContext->cRenderTargetView, VERR_INVALID_PARAMETER);
    3631             aRenderTargetViews[i] = pDXContext->pBackendDXContext->papRenderTargetView[renderTargetViewId];
     3790            papRenderTargetViews[i] = pDXContext->pBackendDXContext->papRenderTargetView[renderTargetViewId];
    36323791        }
    36333792        else
    3634             aRenderTargetViews[i] = NULL;
     3793            papRenderTargetViews[i] = NULL;
    36353794    }
    36363795
     
    36413800        pDepthStencilView = NULL;
    36423801
    3643     pDevice->pImmediateContext->OMSetRenderTargets(cRenderTargetViewId, aRenderTargetViews, pDepthStencilView);
     3802    pDevice->pImmediateContext->OMSetRenderTargets(cRenderTargetViewId, papRenderTargetViews, pDepthStencilView);
    36443803    return VINF_SUCCESS;
    36453804}
     
    38053964{
    38063965    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     3966    RT_NOREF(pBackend);
     3967
    38073968    DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device;
    38083969    AssertReturn(pDevice->pDevice, VERR_INVALID_STATE);
    38093970
    3810     RT_NOREF(pBackend);
    3811 
    38123971    /* D3D11_RECT is identical to SVGASignedRect. */
    38133972    D3D11_RECT *pRects = (D3D11_RECT *)paRect;
     
    38183977
    38193978
    3820 static DECLCALLBACK(int) vmsvga3dBackDXClearRenderTargetView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    3821 {
    3822     PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
    3823 
    3824     RT_NOREF(pBackend, pDXContext);
    3825     AssertFailed(); /** @todo Implement */
    3826     return VERR_NOT_IMPLEMENTED;
    3827 }
    3828 
    3829 
    3830 static DECLCALLBACK(int) vmsvga3dBackDXClearDepthStencilView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    3831 {
    3832     PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
    3833 
    3834     RT_NOREF(pBackend, pDXContext);
    3835     AssertFailed(); /** @todo Implement */
    3836     return VERR_NOT_IMPLEMENTED;
    3837 }
    3838 
    3839 
    3840 static DECLCALLBACK(int) vmsvga3dBackDXPredCopyRegion(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    3841 {
    3842     PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
    3843 
    3844     RT_NOREF(pBackend, pDXContext);
    3845     AssertFailed(); /** @todo Implement */
    3846     return VERR_NOT_IMPLEMENTED;
     3979static DECLCALLBACK(int) vmsvga3dBackDXClearRenderTargetView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dRenderTargetViewId renderTargetViewId, SVGA3dRGBAFloat const *pRGBA)
     3980{
     3981    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     3982    RT_NOREF(pBackend);
     3983
     3984    DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device;
     3985    AssertReturn(pDevice->pDevice, VERR_INVALID_STATE);
     3986
     3987    ID3D11RenderTargetView *pRenderTargetView = pDXContext->pBackendDXContext->papRenderTargetView[renderTargetViewId];
     3988    AssertReturn(pRenderTargetView, VERR_INVALID_STATE);
     3989    pDevice->pImmediateContext->ClearRenderTargetView(pRenderTargetView, pRGBA->value);
     3990    return VINF_SUCCESS;
     3991}
     3992
     3993
     3994static DECLCALLBACK(int) vmsvga3dBackDXClearDepthStencilView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t flags, SVGA3dDepthStencilViewId depthStencilViewId, float depth, uint8_t stencil)
     3995{
     3996    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     3997    RT_NOREF(pBackend);
     3998
     3999    DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device;
     4000    AssertReturn(pDevice->pDevice, VERR_INVALID_STATE);
     4001
     4002    ID3D11DepthStencilView *pDepthStencilView = pDXContext->pBackendDXContext->papDepthStencilView[depthStencilViewId];
     4003    AssertReturn(pDepthStencilView, VERR_INVALID_STATE);
     4004    pDevice->pImmediateContext->ClearDepthStencilView(pDepthStencilView, flags, depth, stencil);
     4005    return VINF_SUCCESS;
     4006}
     4007
     4008
     4009static DECLCALLBACK(int) vmsvga3dBackDXPredCopyRegion(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dSurfaceId dstSid, uint32_t dstSubResource, SVGA3dSurfaceId srcSid, uint32_t srcSubResource, SVGA3dCopyBox const *pBox)
     4010{
     4011    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     4012    RT_NOREF(pBackend);
     4013
     4014    DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device;
     4015    AssertReturn(pDevice->pDevice, VERR_INVALID_STATE);
     4016
     4017    PVMSVGA3DSURFACE pSrcSurface;
     4018    int rc = vmsvga3dSurfaceFromSid(pThisCC->svga.p3dState, srcSid, &pSrcSurface);
     4019    AssertRCReturn(rc, rc);
     4020
     4021    PVMSVGA3DSURFACE pDstSurface;
     4022    rc = vmsvga3dSurfaceFromSid(pThisCC->svga.p3dState, dstSid, &pDstSurface);
     4023    AssertRCReturn(rc, rc);
     4024
     4025    if (pSrcSurface->pBackendSurface == NULL)
     4026    {
     4027        /* Create the resource. */
     4028        rc = vmsvga3dBackSurfaceCreateTexture(pThisCC->svga.p3dState, pDXContext, pSrcSurface);
     4029        AssertRCReturn(rc, rc);
     4030    }
     4031
     4032    if (pDstSurface->pBackendSurface == NULL)
     4033    {
     4034        /* Create the resource. */
     4035        rc = vmsvga3dBackSurfaceCreateTexture(pThisCC->svga.p3dState, pDXContext, pDstSurface);
     4036        AssertRCReturn(rc, rc);
     4037    }
     4038
     4039    ID3D11Resource *pDstResource = pDstSurface->pBackendSurface->u.Texture.pTexture;
     4040    UINT DstSubresource = dstSubResource;
     4041    UINT DstX = pBox->x;
     4042    UINT DstY = pBox->y;
     4043    UINT DstZ = pBox->z;
     4044
     4045    ID3D11Resource *pSrcResource = pSrcSurface->pBackendSurface->u.Texture.pTexture;
     4046    UINT SrcSubresource = srcSubResource;
     4047    D3D11_BOX SrcBox;
     4048    SrcBox.left   = pBox->x;
     4049    SrcBox.top    = pBox->y;
     4050    SrcBox.front  = pBox->z;
     4051    SrcBox.right  = pBox->x + pBox->w;
     4052    SrcBox.bottom = pBox->y + pBox->h;
     4053    SrcBox.back   = pBox->z + pBox->d;
     4054    pDevice->pImmediateContext->CopySubresourceRegion(pDstResource, DstSubresource, DstX, DstY, DstZ,
     4055                                                      pSrcResource, SrcSubresource, &SrcBox);
     4056    return VINF_SUCCESS;
    38474057}
    38484058
     
    38684078
    38694079
    3870 static DECLCALLBACK(int) vmsvga3dBackDXGenMips(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    3871 {
    3872     PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
    3873 
    3874     RT_NOREF(pBackend, pDXContext);
    3875     AssertFailed(); /** @todo Implement */
    3876     return VERR_NOT_IMPLEMENTED;
     4080static DECLCALLBACK(int) vmsvga3dBackDXGenMips(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderResourceViewId shaderResourceViewId)
     4081{
     4082    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     4083    RT_NOREF(pBackend);
     4084
     4085    DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device;
     4086    AssertReturn(pDevice->pDevice, VERR_INVALID_STATE);
     4087
     4088    ID3D11ShaderResourceView *pShaderResourceView = pDXContext->pBackendDXContext->papShaderResourceView[shaderResourceViewId];
     4089    AssertReturn(pShaderResourceView, VERR_INVALID_STATE);
     4090    pDevice->pImmediateContext->GenerateMips(pShaderResourceView);
     4091    return VINF_SUCCESS;
    38774092}
    38784093
     
    39354150
    39364151
    3937 static DECLCALLBACK(int) vmsvga3dBackDXDestroyShaderResourceView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    3938 {
    3939     PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
    3940 
    3941     RT_NOREF(pBackend, pDXContext);
    3942     AssertFailed(); /** @todo Implement */
    3943     return VERR_NOT_IMPLEMENTED;
     4152static DECLCALLBACK(int) vmsvga3dBackDXDestroyShaderResourceView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderResourceViewId shaderResourceViewId)
     4153{
     4154    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     4155    RT_NOREF(pBackend);
     4156
     4157    D3D_RELEASE(pDXContext->pBackendDXContext->papShaderResourceView[shaderResourceViewId]);
     4158    return VINF_SUCCESS;
    39444159}
    39454160
     
    39724187
    39734188
    3974 static DECLCALLBACK(int) vmsvga3dBackDXDestroyRenderTargetView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    3975 {
    3976     PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
    3977 
    3978     RT_NOREF(pBackend, pDXContext);
    3979     AssertFailed(); /** @todo Implement */
    3980     return VERR_NOT_IMPLEMENTED;
    3981 }
    3982 
    3983 
    3984 static DECLCALLBACK(int) vmsvga3dBackDXDefineDepthStencilView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    3985 {
    3986     PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
    3987 
    3988     RT_NOREF(pBackend, pDXContext);
    3989     AssertFailed(); /** @todo Implement */
    3990     return VERR_NOT_IMPLEMENTED;
    3991 }
    3992 
    3993 
    3994 static DECLCALLBACK(int) vmsvga3dBackDXDestroyDepthStencilView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    3995 {
    3996     PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
    3997 
    3998     RT_NOREF(pBackend, pDXContext);
    3999     AssertFailed(); /** @todo Implement */
    4000     return VERR_NOT_IMPLEMENTED;
     4189static DECLCALLBACK(int) vmsvga3dBackDXDestroyRenderTargetView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dRenderTargetViewId renderTargetViewId)
     4190{
     4191    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     4192    RT_NOREF(pBackend);
     4193
     4194    D3D_RELEASE(pDXContext->pBackendDXContext->papRenderTargetView[renderTargetViewId]);
     4195    return VINF_SUCCESS;
     4196}
     4197
     4198
     4199static DECLCALLBACK(int) vmsvga3dBackDXDefineDepthStencilView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dDepthStencilViewId depthStencilViewId, SVGACOTableDXDSViewEntry const *pEntry)
     4200{
     4201    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     4202    RT_NOREF(pBackend);
     4203
     4204    DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device;
     4205    AssertReturn(pDevice->pDevice, VERR_INVALID_STATE);
     4206
     4207    /* Get corresponding resource for pEntry->sid. Create the surface if does not yet exist. */
     4208    PVMSVGA3DSURFACE pSurface;
     4209    int rc = vmsvga3dSurfaceFromSid(pThisCC->svga.p3dState, pEntry->sid, &pSurface);
     4210    AssertRCReturn(rc, rc);
     4211
     4212    if (pSurface->pBackendSurface == NULL)
     4213    {
     4214        /* Create the actual texture. */
     4215        rc = vmsvga3dBackSurfaceCreateDepthStencilTexture(pThisCC->svga.p3dState, pDXContext, pSurface);
     4216        AssertRCReturn(rc, rc);
     4217    }
     4218
     4219    HRESULT hr = dxDepthStencilViewCreate(pDevice, pEntry, pSurface->pBackendSurface, &pDXContext->pBackendDXContext->papDepthStencilView[depthStencilViewId]);
     4220    if (SUCCEEDED(hr))
     4221        return VINF_SUCCESS;
     4222    return VERR_INVALID_STATE;
     4223}
     4224
     4225
     4226static DECLCALLBACK(int) vmsvga3dBackDXDestroyDepthStencilView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dDepthStencilViewId depthStencilViewId)
     4227{
     4228    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     4229    RT_NOREF(pBackend);
     4230
     4231    D3D_RELEASE(pDXContext->pBackendDXContext->papDepthStencilView[depthStencilViewId]);
     4232    return VINF_SUCCESS;
    40014233}
    40024234
     
    42254457        if (RT_SUCCESS(rc))
    42264458        {
     4459#ifdef LOG_ENABLED
     4460            if (pBackend->pfnD3DDisassemble && LogIs6Enabled())
     4461            {
     4462                ID3D10Blob *pBlob = 0;
     4463                HRESULT hr2 = pBackend->pfnD3DDisassemble(pDXShader->pvDXBC, pDXShader->cbDXBC, 0, NULL, &pBlob);
     4464                if (SUCCEEDED(hr2) && pBlob && pBlob->GetBufferSize())
     4465                {
     4466                    Log6(("Shader: cid=%u shid=%u type=%d:\n%s\n",
     4467                          pDXContext->cid, pShader->id, pDXShader->enmShaderType, pBlob->GetBufferPointer()));
     4468                }
     4469                else
     4470                    AssertFailed();
     4471                D3D_RELEASE(pBlob);
     4472            }
     4473#endif
     4474
    42274475            HRESULT hr = dxShaderCreate(pDevice, pShader, pDXShader);
    42284476            if (FAILED(hr))
     
    49635211
    49645212static DECLCALLBACK(int) vmsvga3dBackDXSetMinLOD(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    4965 {
    4966     PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
    4967 
    4968     RT_NOREF(pBackend, pDXContext);
    4969     AssertFailed(); /** @todo Implement */
    4970     return VERR_NOT_IMPLEMENTED;
    4971 }
    4972 
    4973 
    4974 static DECLCALLBACK(int) vmsvga3dBackDXDefineDepthStencilView_v2(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)
    49755213{
    49765214    PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;
     
    51685406                p->pfnDXSetCSUAViews              = vmsvga3dBackDXSetCSUAViews;
    51695407                p->pfnDXSetMinLOD                 = vmsvga3dBackDXSetMinLOD;
    5170                 p->pfnDXDefineDepthStencilView_v2 = vmsvga3dBackDXDefineDepthStencilView_v2;
    51715408                p->pfnDXDefineStreamOutputWithMob = vmsvga3dBackDXDefineStreamOutputWithMob;
    51725409                p->pfnDXSetShaderIface            = vmsvga3dBackDXSetShaderIface;
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h

    r88787 r88803  
    294294    DECLCALLBACKMEMBER(int, pfnDXInvalidateContext,         (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    295295    DECLCALLBACKMEMBER(int, pfnDXSetSingleConstantBuffer,   (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t slot, SVGA3dShaderType type, SVGA3dSurfaceId sid, uint32_t offsetInBytes, uint32_t sizeInBytes));
    296     DECLCALLBACKMEMBER(int, pfnDXSetShaderResources,        (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
     296    DECLCALLBACKMEMBER(int, pfnDXSetShaderResources,        (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t startView, SVGA3dShaderType type, uint32_t cShaderResourceViewId, SVGA3dShaderResourceViewId const *paShaderResourceViewId));
    297297    DECLCALLBACKMEMBER(int, pfnDXSetShader,                 (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, PVMSVGA3DSHADER pShader));
    298298    DECLCALLBACKMEMBER(int, pfnDXSetSamplers,               (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t startSampler, SVGA3dShaderType type, uint32_t cSamplerId, SVGA3dSamplerId const *paSamplerId));
     
    321321    DECLCALLBACKMEMBER(int, pfnDXSetViewports,              (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t cViewport, SVGA3dViewport const *paViewport));
    322322    DECLCALLBACKMEMBER(int, pfnDXSetScissorRects,           (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t cRect, SVGASignedRect const *paRect));
    323     DECLCALLBACKMEMBER(int, pfnDXClearRenderTargetView,     (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    324     DECLCALLBACKMEMBER(int, pfnDXClearDepthStencilView,     (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    325     DECLCALLBACKMEMBER(int, pfnDXPredCopyRegion,            (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
     323    DECLCALLBACKMEMBER(int, pfnDXClearRenderTargetView,     (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dRenderTargetViewId renderTargetViewId, SVGA3dRGBAFloat const *pRGBA));
     324    DECLCALLBACKMEMBER(int, pfnDXClearDepthStencilView,     (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t flags, SVGA3dDepthStencilViewId depthStencilViewId, float depth, uint8_t stencil));
     325    DECLCALLBACKMEMBER(int, pfnDXPredCopyRegion,            (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dSurfaceId dstSid, uint32_t dstSubResource, SVGA3dSurfaceId srcSid, uint32_t srcSubResource, SVGA3dCopyBox const *pBox));
    326326    DECLCALLBACKMEMBER(int, pfnDXPredCopy,                  (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    327327    DECLCALLBACKMEMBER(int, pfnDXPresentBlt,                (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    328     DECLCALLBACKMEMBER(int, pfnDXGenMips,                   (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
     328    DECLCALLBACKMEMBER(int, pfnDXGenMips,                   (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderResourceViewId shaderResourceViewId));
    329329    DECLCALLBACKMEMBER(int, pfnDXUpdateSubResource,         (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    330330    DECLCALLBACKMEMBER(int, pfnDXReadbackSubResource,       (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    331331    DECLCALLBACKMEMBER(int, pfnDXInvalidateSubResource,     (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    332332    DECLCALLBACKMEMBER(int, pfnDXDefineShaderResourceView,  (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderResourceViewId shaderResourceViewId, SVGACOTableDXSRViewEntry const *pEntry));
    333     DECLCALLBACKMEMBER(int, pfnDXDestroyShaderResourceView, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
     333    DECLCALLBACKMEMBER(int, pfnDXDestroyShaderResourceView, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderResourceViewId shaderResourceViewId));
    334334    DECLCALLBACKMEMBER(int, pfnDXDefineRenderTargetView,    (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dRenderTargetViewId renderTargetViewId, SVGACOTableDXRTViewEntry const *pEntry));
    335     DECLCALLBACKMEMBER(int, pfnDXDestroyRenderTargetView,   (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    336     DECLCALLBACKMEMBER(int, pfnDXDefineDepthStencilView,    (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    337     DECLCALLBACKMEMBER(int, pfnDXDestroyDepthStencilView,   (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
     335    DECLCALLBACKMEMBER(int, pfnDXDestroyRenderTargetView,   (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dRenderTargetViewId renderTargetViewId));
     336    DECLCALLBACKMEMBER(int, pfnDXDefineDepthStencilView,    (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dDepthStencilViewId depthStencilViewId, SVGACOTableDXDSViewEntry const *pEntry));
     337    DECLCALLBACKMEMBER(int, pfnDXDestroyDepthStencilView,   (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dDepthStencilViewId depthStencilViewId));
    338338    DECLCALLBACKMEMBER(int, pfnDXDefineElementLayout,       (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dElementLayoutId elementLayoutId, SVGACOTableDXElementLayoutEntry const *pEntry));
    339339    DECLCALLBACKMEMBER(int, pfnDXDestroyElementLayout,      (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
     
    405405    DECLCALLBACKMEMBER(int, pfnDXSetCSUAViews,              (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    406406    DECLCALLBACKMEMBER(int, pfnDXSetMinLOD,                 (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    407     DECLCALLBACKMEMBER(int, pfnDXDefineDepthStencilView_v2, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    408407    DECLCALLBACKMEMBER(int, pfnDXDefineStreamOutputWithMob, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
    409408    DECLCALLBACKMEMBER(int, pfnDXSetShaderIface,            (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));
     
    426425int vmsvga3dDXInvalidateContext(PVGASTATECC pThisCC, uint32_t idDXContext);
    427426int vmsvga3dDXSetSingleConstantBuffer(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXSetSingleConstantBuffer const *pCmd);
    428 int vmsvga3dDXSetShaderResources(PVGASTATECC pThisCC, uint32_t idDXContext);
     427int vmsvga3dDXSetShaderResources(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXSetShaderResources const *pCmd, uint32_t cShaderResourceViewId, SVGA3dShaderResourceViewId const *paShaderResourceViewId);
    429428int vmsvga3dDXSetShader(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXSetShader const *pCmd);
    430 int vmsvga3dDXSetSamplers(PVGASTATECC pThisCC, uint32_t idDXContext, uint32_t startSampler, SVGA3dShaderType type, uint32_t cSamplerId, SVGA3dSamplerId const *paSamplerId);
     429int vmsvga3dDXSetSamplers(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXSetSamplers const *pCmd, uint32_t cSamplerId, SVGA3dSamplerId const *paSamplerId);
    431430int vmsvga3dDXDraw(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDraw const *pCmd);
    432431int vmsvga3dDXDrawIndexed(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDrawIndexed const *pCmd);
     
    453452int vmsvga3dDXSetViewports(PVGASTATECC pThisCC, uint32_t idDXContext, uint32_t cViewport, SVGA3dViewport const *paViewport);
    454453int vmsvga3dDXSetScissorRects(PVGASTATECC pThisCC, uint32_t idDXContext, uint32_t cRect, SVGASignedRect const *paRect);
    455 int vmsvga3dDXClearRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext);
    456 int vmsvga3dDXClearDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext);
    457 int vmsvga3dDXPredCopyRegion(PVGASTATECC pThisCC, uint32_t idDXContext);
     454int vmsvga3dDXClearRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXClearRenderTargetView const *pCmd);
     455int vmsvga3dDXClearDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXClearDepthStencilView const *pCmd);
     456int vmsvga3dDXPredCopyRegion(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXPredCopyRegion const *pCmd);
    458457int vmsvga3dDXPredCopy(PVGASTATECC pThisCC, uint32_t idDXContext);
    459458int vmsvga3dDXPresentBlt(PVGASTATECC pThisCC, uint32_t idDXContext);
    460 int vmsvga3dDXGenMips(PVGASTATECC pThisCC, uint32_t idDXContext);
     459int vmsvga3dDXGenMips(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXGenMips const *pCmd);
    461460int vmsvga3dDXUpdateSubResource(PVGASTATECC pThisCC, uint32_t idDXContext);
    462461int vmsvga3dDXReadbackSubResource(PVGASTATECC pThisCC, uint32_t idDXContext);
    463462int vmsvga3dDXInvalidateSubResource(PVGASTATECC pThisCC, uint32_t idDXContext);
    464463int vmsvga3dDXDefineShaderResourceView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDefineShaderResourceView const *pCmd);
    465 int vmsvga3dDXDestroyShaderResourceView(PVGASTATECC pThisCC, uint32_t idDXContext);
     464int vmsvga3dDXDestroyShaderResourceView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyShaderResourceView const *pCmd);
    466465int vmsvga3dDXDefineRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDefineRenderTargetView const *pCmd);
    467 int vmsvga3dDXDestroyRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext);
    468 int vmsvga3dDXDefineDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext);
    469 int vmsvga3dDXDestroyDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext);
     466int vmsvga3dDXDestroyRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyRenderTargetView const *pCmd);
     467int vmsvga3dDXDefineDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDefineDepthStencilView_v2 const *pCmd);
     468int vmsvga3dDXDestroyDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyDepthStencilView const *pCmd);
    470469int vmsvga3dDXDefineElementLayout(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dElementLayoutId elementLayoutId, uint32_t cDesc, SVGA3dInputElementDesc const *paDesc);
    471470int vmsvga3dDXDestroyElementLayout(PVGASTATECC pThisCC, uint32_t idDXContext);
     
    537536int vmsvga3dDXSetCSUAViews(PVGASTATECC pThisCC, uint32_t idDXContext);
    538537int vmsvga3dDXSetMinLOD(PVGASTATECC pThisCC, uint32_t idDXContext);
    539 int vmsvga3dDXDefineDepthStencilView_v2(PVGASTATECC pThisCC, uint32_t idDXContext);
    540538int vmsvga3dDXDefineStreamOutputWithMob(PVGASTATECC pThisCC, uint32_t idDXContext);
    541539int vmsvga3dDXSetShaderIface(PVGASTATECC pThisCC, uint32_t idDXContext);
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