Changeset 88803 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Apr 30, 2021 1:23:05 PM (4 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-cmd.cpp
r88788 r88803 1978 1978 { 1979 1979 #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); 1984 1984 #else 1985 1985 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 2010 2010 SVGA3dSamplerId const *paSamplerId = (SVGA3dSamplerId *)&pCmd[1]; 2011 2011 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); 2013 2013 #else 2014 2014 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 2036 2036 { 2037 2037 #ifdef VMSVGA3D_DX 2038 ASMBreakpoint();2038 //ASMBreakpoint(); 2039 2039 RT_NOREF(cbCmd); 2040 2040 return vmsvga3dDXDrawIndexed(pThisCC, idDXContext, pCmd); … … 2374 2374 { 2375 2375 #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); 2380 2379 #else 2381 2380 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 2389 2388 { 2390 2389 #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); 2395 2393 #else 2396 2394 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 2404 2402 { 2405 2403 #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); 2410 2407 #else 2411 2408 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 2449 2446 { 2450 2447 #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); 2455 2451 #else 2456 2452 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 2509 2505 { 2510 2506 #ifdef VMSVGA3D_DX 2511 ASMBreakpoint();2507 //ASMBreakpoint(); 2512 2508 RT_NOREF(cbCmd); 2513 2509 return vmsvga3dDXDefineShaderResourceView(pThisCC, idDXContext, pCmd); … … 2523 2519 { 2524 2520 #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); 2529 2524 #else 2530 2525 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 2552 2547 { 2553 2548 #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); 2558 2552 #else 2559 2553 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 2567 2561 { 2568 2562 #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); 2573 2575 #else 2574 2576 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 2582 2584 { 2583 2585 #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); 2588 2589 #else 2589 2590 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 3632 3633 { 3633 3634 #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); 3638 3638 #else 3639 3639 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-shader.cpp
r88786 r88803 1560 1560 ASSERT_GUEST_RETURN( pProgramToken->majorVersion >= 4 1561 1561 && pProgramToken->programType <= VGPU10_COMPUTE_SHADER, VERR_INVALID_PARAMETER); 1562 if (pInfo) 1563 pInfo->enmProgramType = (VGPU10_PROGRAM_TYPE)pProgramToken->programType; 1562 1564 1563 1565 uint32_t const cToken = paToken[1]; 1564 1566 Log6(("Shader version %d.%d type %s(%d) Length %d\n", 1565 1567 pProgramToken->majorVersion, pProgramToken->minorVersion, dxbcShaderTypeToString(pProgramToken->programType), pProgramToken->programType, cToken)); 1566 1567 1568 ASSERT_GUEST_RETURN(cbShaderCode / 4 == cToken, VERR_INVALID_PARAMETER); /* Declared length should be equal to the actual. */ 1568 1569 … … 1611 1612 } 1612 1613 } 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 1613 1635 1614 1636 return VINF_SUCCESS; … … 1695 1717 }; 1696 1718 1697 1698 static VGPUSemanticInfo const *dxbcSemanticInfo(SVGA3dDXSignatureSemanticName enmSemanticName) 1719 static VGPUSemanticInfo const g_SemanticPSOutput = 1720 { "SV_TARGET", 3 }; // SVGADX_SIGNATURE_SEMANTIC_NAME_UNDEFINED 0 1721 1722 1723 static VGPUSemanticInfo const *dxbcSemanticInfo(DXShaderInfo const *pInfo, SVGA3dDXSignatureSemanticName enmSemanticName, uint32_t u32BlobType) 1699 1724 { 1700 1725 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; 1701 1731 return &g_aSemanticInfo[enmSemanticName]; 1732 } 1702 1733 return &g_aSemanticInfo[0]; 1703 1734 } 1704 1735 1705 1736 1706 static int dxbcCreateIOSGNBlob(DX BCHeader *pHdr, uint32_t u32BlobType,1737 static int dxbcCreateIOSGNBlob(DXShaderInfo const *pInfo, DXBCHeader *pHdr, uint32_t u32BlobType, 1707 1738 uint32_t cSignature, SVGA3dDXSignatureEntry const *paSignature, DXBCByteWriter *w) 1708 1739 { … … 1746 1777 1747 1778 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); 1749 1780 1750 1781 dst->offElementName = cbBlob; /* Offset of the semantic's name relative to the start of the blob (without hdr). */ … … 1754 1785 dst->idxRegister = src->registerIndex; 1755 1786 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; 1757 1791 1758 1792 /* Figure out the semantic name for this element. */ … … 1828 1862 1829 1863 pHdr->aBlobOffset[iBlob++] = dxbcByteWriterSize(w); 1830 rc = dxbcCreateIOSGNBlob(p Hdr, 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); 1831 1865 AssertRCReturn(rc, rc); 1832 1866 1833 1867 pHdr->aBlobOffset[iBlob++] = dxbcByteWriterSize(w); 1834 rc = dxbcCreateIOSGNBlob(p Hdr, 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); 1835 1869 AssertRCReturn(rc, rc); 1836 1870 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-shader.h
r88786 r88803 44 44 typedef struct DXShaderInfo 45 45 { 46 VGPU10_PROGRAM_TYPE enmProgramType; 46 47 uint32_t cInputSignature; 47 48 uint32_t cOutputSignature; -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx.cpp
r88786 r88803 206 206 207 207 208 int vmsvga3dDXSetShaderResources(PVGASTATECC pThisCC, uint32_t idDXContext )208 int vmsvga3dDXSetShaderResources(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXSetShaderResources const *pCmd, uint32_t cShaderResourceViewId, SVGA3dShaderResourceViewId const *paShaderResourceViewId) 209 209 { 210 210 int rc; … … 218 218 AssertRCReturn(rc, rc); 219 219 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); 221 230 return rc; 222 231 } … … 248 257 249 258 250 int vmsvga3dDXSetSamplers(PVGASTATECC pThisCC, uint32_t idDXContext, uint32_t startSampler, SVGA3dShaderType type, uint32_t cSamplerId, SVGA3dSamplerId const *paSamplerId)259 int vmsvga3dDXSetSamplers(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXSetSamplers const *pCmd, uint32_t cSamplerId, SVGA3dSamplerId const *paSamplerId) 251 260 { 252 261 int rc; … … 260 269 AssertRCReturn(rc, rc); 261 270 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); 268 280 return rc; 269 281 } … … 448 460 ASSERT_GUEST_RETURN(depthStencilViewId < pDXContext->cot.cDSView || depthStencilViewId == SVGA_ID_INVALID, VERR_INVALID_PARAMETER); 449 461 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); 451 464 RT_UNTRUSTED_VALIDATED_FENCE(); 452 465 453 466 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 //} 454 472 return rc; 455 473 } … … 709 727 710 728 711 int vmsvga3dDXClearRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext )729 int vmsvga3dDXClearRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXClearRenderTargetView const *pCmd) 712 730 { 713 731 int rc; … … 721 739 AssertRCReturn(rc, rc); 722 740 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 752 int vmsvga3dDXClearDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXClearDepthStencilView const *pCmd) 729 753 { 730 754 int rc; … … 738 762 AssertRCReturn(rc, rc); 739 763 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 775 int vmsvga3dDXPredCopyRegion(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXPredCopyRegion const *pCmd) 746 776 { 747 777 int rc; … … 755 785 AssertRCReturn(rc, rc); 756 786 757 rc = pSvgaR3State->pFuncsDX->pfnDXPredCopyRegion(pThisCC, pDXContext );787 rc = pSvgaR3State->pFuncsDX->pfnDXPredCopyRegion(pThisCC, pDXContext, pCmd->dstSid, pCmd->dstSubResource, pCmd->srcSid, pCmd->srcSubResource, &pCmd->box); 758 788 return rc; 759 789 } … … 794 824 795 825 796 int vmsvga3dDXGenMips(PVGASTATECC pThisCC, uint32_t idDXContext )826 int vmsvga3dDXGenMips(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXGenMips const *pCmd) 797 827 { 798 828 int rc; … … 806 836 AssertRCReturn(rc, rc); 807 837 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); 809 845 return rc; 810 846 } … … 891 927 892 928 893 int vmsvga3dDXDestroyShaderResourceView(PVGASTATECC pThisCC, uint32_t idDXContext )929 int vmsvga3dDXDestroyShaderResourceView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyShaderResourceView const *pCmd) 894 930 { 895 931 int rc; … … 903 939 AssertRCReturn(rc, rc); 904 940 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); 906 951 return rc; 907 952 } … … 937 982 938 983 939 int vmsvga3dDXDestroyRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext )984 int vmsvga3dDXDestroyRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyRenderTargetView const *pCmd) 940 985 { 941 986 int rc; … … 949 994 AssertRCReturn(rc, rc); 950 995 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 1015 int vmsvga3dDXDefineDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDefineDepthStencilView_v2 const *pCmd) 957 1016 { 958 1017 int rc; … … 966 1025 AssertRCReturn(rc, rc); 967 1026 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 1047 int vmsvga3dDXDestroyDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyDepthStencilView const *pCmd) 974 1048 { 975 1049 int rc; … … 983 1057 AssertRCReturn(rc, rc); 984 1058 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); 986 1069 return rc; 987 1070 } … … 2505 2588 2506 2589 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 2524 2590 int vmsvga3dDXDefineStreamOutputWithMob(PVGASTATECC pThisCC, uint32_t idDXContext) 2525 2591 { -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win-dx.cpp
r88787 r88803 154 154 } VMSVGA3DBACKENDDXCONTEXT; 155 155 156 typedef HRESULT FN_D3D_DISASSEMBLE(LPCVOID pSrcData, SIZE_T SrcDataSize, UINT Flags, LPCSTR szComments, ID3D10Blob **ppDisassembly); 157 typedef FN_D3D_DISASSEMBLE *PFN_D3D_DISASSEMBLE; 158 156 159 typedef struct VMSVGA3DBACKEND 157 160 { 158 161 RTLDRMOD hD3D11; 159 162 PFN_D3D11_CREATE_DEVICE pfnD3D11CreateDevice; 163 164 RTLDRMOD hD3DCompiler; 165 PFN_D3D_DISASSEMBLE pfnD3DDisassemble; 160 166 161 167 ID3D11Device *pDevice; /* Device for the VMSVGA3D context independent operation. */ … … 949 955 950 956 957 static 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 951 1006 static HRESULT dxShaderCreate(DXDEVICE *pDevice, PVMSVGA3DSHADER pShader, DXSHADER *pDXShader) 952 1007 { … … 1033 1088 } 1034 1089 } 1090 1091 1092 static 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 1035 1111 1036 1112 … … 1203 1279 } 1204 1280 1205 /** @todo Various texture types. */1206 1207 1281 PVMSVGA3DBACKENDSURFACE pBackendSurface = (PVMSVGA3DBACKENDSURFACE)RTMemAllocZ(sizeof(VMSVGA3DBACKENDSURFACE)); 1208 1282 AssertPtrReturn(pBackendSurface, VERR_NO_MEMORY); 1209 1283 1284 /** @todo Various texture types. */ 1285 ASMBreakpoint(); 1286 1210 1287 RTMemFree(pBackendSurface); 1211 1288 return VERR_NOT_IMPLEMENTED; 1289 } 1290 1291 1292 static 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; 1212 1343 } 1213 1344 … … 1334 1465 { 1335 1466 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); 1336 1475 AssertRC(rc); 1337 1476 } … … 1668 1807 if (!pBackendSurface) 1669 1808 return VERR_INVALID_PARAMETER; 1809 // AssertFailedReturn(VERR_INVALID_PARAMETER); /** @todo The caller must directly use the surface memory. */ 1670 1810 1671 1811 PVMSVGA3DDXCONTEXT pDXContext; … … 1746 1886 { 1747 1887 AssertReturn(pDevice && pDevice->pDevice, VERR_INTERNAL_ERROR); 1748 ASMBreakpoint(); 1888 1749 1889 ID3D11Texture2D *pMappedTexture; 1750 1890 if (enmMapType == VMSVGA3D_SURFACE_MAP_READ) … … 1872 2012 { 1873 2013 AssertReturn(pDevice && pDevice->pDevice, VERR_INTERNAL_ERROR); 1874 ASMBreakpoint(); 2014 1875 2015 ID3D11Texture2D *pMappedTexture; 1876 2016 if (pMap->enmMapType == VMSVGA3D_SURFACE_MAP_READ) … … 3259 3399 3260 3400 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; 3401 static 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; 3268 3427 } 3269 3428 … … 3295 3454 3296 3455 uint32_t const idxShaderState = type - SVGA3D_SHADERTYPE_MIN; 3297 ID3D11SamplerState * aSamplerState[SVGA3D_DX_MAX_SAMPLERS];3456 ID3D11SamplerState *papSamplerState[SVGA3D_DX_MAX_SAMPLERS]; 3298 3457 for (uint32_t i = 0; i < cSamplerId; ++i) 3299 3458 { … … 3302 3461 { 3303 3462 ASSERT_GUEST_RETURN(samplerId < pDXContext->pBackendDXContext->cSamplerState, VERR_INVALID_PARAMETER); 3304 aSamplerState[i] = pDXContext->pBackendDXContext->papSamplerState[samplerId];3463 papSamplerState[i] = pDXContext->pBackendDXContext->papSamplerState[samplerId]; 3305 3464 } 3306 3465 else 3307 aSamplerState[i] = NULL;3466 papSamplerState[i] = NULL; 3308 3467 3309 3468 pDXContext->svgaDXContext.shaderState[idxShaderState].samplers[startSampler + i] = samplerId; 3310 3469 } 3311 3470 3312 dxSamplerSet(pDevice, type, startSampler, cSamplerId, aSamplerState);3471 dxSamplerSet(pDevice, type, startSampler, cSamplerId, papSamplerState); 3313 3472 return VINF_SUCCESS; 3314 3473 } … … 3622 3781 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 3623 3782 3624 ID3D11RenderTargetView * aRenderTargetViews[SVGA3D_MAX_RENDER_TARGETS];3783 ID3D11RenderTargetView *papRenderTargetViews[SVGA3D_MAX_RENDER_TARGETS]; 3625 3784 for (uint32_t i = 0; i < cRenderTargetViewId; ++i) 3626 3785 { … … 3629 3788 { 3630 3789 ASSERT_GUEST_RETURN(renderTargetViewId < pDXContext->pBackendDXContext->cRenderTargetView, VERR_INVALID_PARAMETER); 3631 aRenderTargetViews[i] = pDXContext->pBackendDXContext->papRenderTargetView[renderTargetViewId];3790 papRenderTargetViews[i] = pDXContext->pBackendDXContext->papRenderTargetView[renderTargetViewId]; 3632 3791 } 3633 3792 else 3634 aRenderTargetViews[i] = NULL;3793 papRenderTargetViews[i] = NULL; 3635 3794 } 3636 3795 … … 3641 3800 pDepthStencilView = NULL; 3642 3801 3643 pDevice->pImmediateContext->OMSetRenderTargets(cRenderTargetViewId, aRenderTargetViews, pDepthStencilView);3802 pDevice->pImmediateContext->OMSetRenderTargets(cRenderTargetViewId, papRenderTargetViews, pDepthStencilView); 3644 3803 return VINF_SUCCESS; 3645 3804 } … … 3805 3964 { 3806 3965 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 3966 RT_NOREF(pBackend); 3967 3807 3968 DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device; 3808 3969 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 3809 3970 3810 RT_NOREF(pBackend);3811 3812 3971 /* D3D11_RECT is identical to SVGASignedRect. */ 3813 3972 D3D11_RECT *pRects = (D3D11_RECT *)paRect; … … 3818 3977 3819 3978 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; 3979 static 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 3994 static 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 4009 static 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; 3847 4057 } 3848 4058 … … 3868 4078 3869 4079 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; 4080 static 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; 3877 4092 } 3878 4093 … … 3935 4150 3936 4151 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 V ERR_NOT_IMPLEMENTED;4152 static 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; 3944 4159 } 3945 4160 … … 3972 4187 3973 4188 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; 4189 static 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 4199 static 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 4226 static 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; 4001 4233 } 4002 4234 … … 4225 4457 if (RT_SUCCESS(rc)) 4226 4458 { 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 4227 4475 HRESULT hr = dxShaderCreate(pDevice, pShader, pDXShader); 4228 4476 if (FAILED(hr)) … … 4963 5211 4964 5212 static 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)4975 5213 { 4976 5214 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; … … 5168 5406 p->pfnDXSetCSUAViews = vmsvga3dBackDXSetCSUAViews; 5169 5407 p->pfnDXSetMinLOD = vmsvga3dBackDXSetMinLOD; 5170 p->pfnDXDefineDepthStencilView_v2 = vmsvga3dBackDXDefineDepthStencilView_v2;5171 5408 p->pfnDXDefineStreamOutputWithMob = vmsvga3dBackDXDefineStreamOutputWithMob; 5172 5409 p->pfnDXSetShaderIface = vmsvga3dBackDXSetShaderIface; -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h
r88787 r88803 294 294 DECLCALLBACKMEMBER(int, pfnDXInvalidateContext, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 295 295 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)); 297 297 DECLCALLBACKMEMBER(int, pfnDXSetShader, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, PVMSVGA3DSHADER pShader)); 298 298 DECLCALLBACKMEMBER(int, pfnDXSetSamplers, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t startSampler, SVGA3dShaderType type, uint32_t cSamplerId, SVGA3dSamplerId const *paSamplerId)); … … 321 321 DECLCALLBACKMEMBER(int, pfnDXSetViewports, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t cViewport, SVGA3dViewport const *paViewport)); 322 322 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)); 326 326 DECLCALLBACKMEMBER(int, pfnDXPredCopy, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 327 327 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)); 329 329 DECLCALLBACKMEMBER(int, pfnDXUpdateSubResource, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 330 330 DECLCALLBACKMEMBER(int, pfnDXReadbackSubResource, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 331 331 DECLCALLBACKMEMBER(int, pfnDXInvalidateSubResource, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 332 332 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)); 334 334 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)); 338 338 DECLCALLBACKMEMBER(int, pfnDXDefineElementLayout, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dElementLayoutId elementLayoutId, SVGACOTableDXElementLayoutEntry const *pEntry)); 339 339 DECLCALLBACKMEMBER(int, pfnDXDestroyElementLayout, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); … … 405 405 DECLCALLBACKMEMBER(int, pfnDXSetCSUAViews, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 406 406 DECLCALLBACKMEMBER(int, pfnDXSetMinLOD, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 407 DECLCALLBACKMEMBER(int, pfnDXDefineDepthStencilView_v2, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext));408 407 DECLCALLBACKMEMBER(int, pfnDXDefineStreamOutputWithMob, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 409 408 DECLCALLBACKMEMBER(int, pfnDXSetShaderIface, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); … … 426 425 int vmsvga3dDXInvalidateContext(PVGASTATECC pThisCC, uint32_t idDXContext); 427 426 int vmsvga3dDXSetSingleConstantBuffer(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXSetSingleConstantBuffer const *pCmd); 428 int vmsvga3dDXSetShaderResources(PVGASTATECC pThisCC, uint32_t idDXContext );427 int vmsvga3dDXSetShaderResources(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXSetShaderResources const *pCmd, uint32_t cShaderResourceViewId, SVGA3dShaderResourceViewId const *paShaderResourceViewId); 429 428 int 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);429 int vmsvga3dDXSetSamplers(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXSetSamplers const *pCmd, uint32_t cSamplerId, SVGA3dSamplerId const *paSamplerId); 431 430 int vmsvga3dDXDraw(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDraw const *pCmd); 432 431 int vmsvga3dDXDrawIndexed(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDrawIndexed const *pCmd); … … 453 452 int vmsvga3dDXSetViewports(PVGASTATECC pThisCC, uint32_t idDXContext, uint32_t cViewport, SVGA3dViewport const *paViewport); 454 453 int 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 );454 int vmsvga3dDXClearRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXClearRenderTargetView const *pCmd); 455 int vmsvga3dDXClearDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXClearDepthStencilView const *pCmd); 456 int vmsvga3dDXPredCopyRegion(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXPredCopyRegion const *pCmd); 458 457 int vmsvga3dDXPredCopy(PVGASTATECC pThisCC, uint32_t idDXContext); 459 458 int vmsvga3dDXPresentBlt(PVGASTATECC pThisCC, uint32_t idDXContext); 460 int vmsvga3dDXGenMips(PVGASTATECC pThisCC, uint32_t idDXContext );459 int vmsvga3dDXGenMips(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXGenMips const *pCmd); 461 460 int vmsvga3dDXUpdateSubResource(PVGASTATECC pThisCC, uint32_t idDXContext); 462 461 int vmsvga3dDXReadbackSubResource(PVGASTATECC pThisCC, uint32_t idDXContext); 463 462 int vmsvga3dDXInvalidateSubResource(PVGASTATECC pThisCC, uint32_t idDXContext); 464 463 int vmsvga3dDXDefineShaderResourceView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDefineShaderResourceView const *pCmd); 465 int vmsvga3dDXDestroyShaderResourceView(PVGASTATECC pThisCC, uint32_t idDXContext );464 int vmsvga3dDXDestroyShaderResourceView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyShaderResourceView const *pCmd); 466 465 int 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 );466 int vmsvga3dDXDestroyRenderTargetView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyRenderTargetView const *pCmd); 467 int vmsvga3dDXDefineDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDefineDepthStencilView_v2 const *pCmd); 468 int vmsvga3dDXDestroyDepthStencilView(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyDepthStencilView const *pCmd); 470 469 int vmsvga3dDXDefineElementLayout(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dElementLayoutId elementLayoutId, uint32_t cDesc, SVGA3dInputElementDesc const *paDesc); 471 470 int vmsvga3dDXDestroyElementLayout(PVGASTATECC pThisCC, uint32_t idDXContext); … … 537 536 int vmsvga3dDXSetCSUAViews(PVGASTATECC pThisCC, uint32_t idDXContext); 538 537 int vmsvga3dDXSetMinLOD(PVGASTATECC pThisCC, uint32_t idDXContext); 539 int vmsvga3dDXDefineDepthStencilView_v2(PVGASTATECC pThisCC, uint32_t idDXContext);540 538 int vmsvga3dDXDefineStreamOutputWithMob(PVGASTATECC pThisCC, uint32_t idDXContext); 541 539 int vmsvga3dDXSetShaderIface(PVGASTATECC pThisCC, uint32_t idDXContext);
Note:
See TracChangeset
for help on using the changeset viewer.