Changeset 91375 in vbox
- Timestamp:
- Sep 27, 2021 6:46:37 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 147053
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-cmd.cpp
r91364 r91375 955 955 { 956 956 VMSVGA3D_MAPPED_SURFACE map; 957 rc = vmsvga3dSurfaceMap(pThisCC, pImageId, pBox, VMSVGA3D_SURFACE_MAP_WRITE _DISCARD, &map);957 rc = vmsvga3dSurfaceMap(pThisCC, pImageId, pBox, VMSVGA3D_SURFACE_MAP_WRITE, &map); 958 958 if (RT_SUCCESS(rc)) 959 959 { … … 1004 1004 { 1005 1005 VMSVGA3D_MAPPED_SURFACE map; 1006 rc = vmsvga3dSurfaceMap(pThisCC, pImageId, pBoxDst, VMSVGA3D_SURFACE_MAP_WRITE _DISCARD, &map);1006 rc = vmsvga3dSurfaceMap(pThisCC, pImageId, pBoxDst, VMSVGA3D_SURFACE_MAP_WRITE, &map); 1007 1007 if (RT_SUCCESS(rc)) 1008 1008 { … … 1478 1478 VMSVGA3D_SURFACE_MAP enmMapType; 1479 1479 if (enmTransfer == SVGA3D_WRITE_HOST_VRAM) 1480 enmMapType = VMSVGA3D_SURFACE_MAP_WRITE_DISCARD; 1480 enmMapType = pBox 1481 ? VMSVGA3D_SURFACE_MAP_WRITE 1482 : VMSVGA3D_SURFACE_MAP_WRITE_DISCARD; 1481 1483 else if (enmTransfer == SVGA3D_READ_HOST_VRAM) 1482 1484 enmMapType = VMSVGA3D_SURFACE_MAP_READ; … … 1936 1938 // entry.mobPitch = 0; 1937 1939 // ... 1940 Assert( pCmd->arraySize == 0 1941 || pCmd->arraySize == 1 1942 || (pCmd->arraySize == 6 && (pCmd->surfaceFlags & SVGA3D_SURFACE_CUBEMAP))); 1938 1943 int rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SURFACE], 1939 1944 pCmd->sid, SVGA3D_OTABLE_SURFACE_ENTRY_SIZE, &entry, sizeof(entry)); … … 2535 2540 { 2536 2541 #ifdef VMSVGA3D_DX 2537 DEBUG_BREAKPOINT_TEST();2538 PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State;2539 RT_NOREF(pSvgaR3State, pCmd, cbCmd);2540 return vmsvga3dDXSetSOTargets(pThisCC, idDXContext );2542 //DEBUG_BREAKPOINT_TEST(); 2543 SVGA3dSoTarget const *paSoTarget = (SVGA3dSoTarget *)&pCmd[1]; 2544 uint32_t const cSoTarget = (cbCmd - sizeof(*pCmd)) / sizeof(SVGA3dSoTarget); 2545 return vmsvga3dDXSetSOTargets(pThisCC, idDXContext, cSoTarget, paSoTarget); 2541 2546 #else 2542 2547 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 3039 3044 { 3040 3045 #ifdef VMSVGA3D_DX 3041 DEBUG_BREAKPOINT_TEST(); 3042 PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State; 3043 RT_NOREF(pSvgaR3State, pCmd, cbCmd); 3044 return vmsvga3dDXDestroyShader(pThisCC, idDXContext); 3046 //DEBUG_BREAKPOINT_TEST(); 3047 RT_NOREF(cbCmd); 3048 return vmsvga3dDXDestroyShader(pThisCC, idDXContext, pCmd); 3045 3049 #else 3046 3050 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 3072 3076 #ifdef VMSVGA3D_DX 3073 3077 DEBUG_BREAKPOINT_TEST(); 3074 PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State; 3075 RT_NOREF(pSvgaR3State, pCmd, cbCmd); 3076 return vmsvga3dDXDefineStreamOutput(pThisCC, idDXContext); 3078 RT_NOREF(cbCmd); 3079 return vmsvga3dDXDefineStreamOutput(pThisCC, idDXContext, pCmd); 3077 3080 #else 3078 3081 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 3087 3090 #ifdef VMSVGA3D_DX 3088 3091 DEBUG_BREAKPOINT_TEST(); 3089 PVMSVGAR3STATE const pSvgaR3State = pThisCC->svga.pSvgaR3State; 3090 RT_NOREF(pSvgaR3State, pCmd, cbCmd); 3091 return vmsvga3dDXDestroyStreamOutput(pThisCC, idDXContext); 3092 RT_NOREF(cbCmd); 3093 return vmsvga3dDXDestroyStreamOutput(pThisCC, idDXContext, pCmd); 3092 3094 #else 3093 3095 RT_NOREF(pThisCC, idDXContext, pCmd, cbCmd); … … 3194 3196 */ 3195 3197 VMSVGA3D_MAPPED_SURFACE mapSurface; 3196 rc = vmsvga3dSurfaceMap(pThisCC, &imageSurface, &pCmd->destBox, VMSVGA3D_SURFACE_MAP_WRITE _DISCARD, &mapSurface);3198 rc = vmsvga3dSurfaceMap(pThisCC, &imageSurface, &pCmd->destBox, VMSVGA3D_SURFACE_MAP_WRITE, &mapSurface); 3197 3199 if (RT_SUCCESS(rc)) 3198 3200 { … … 3207 3209 RT_UNTRUSTED_VALIDATED_FENCE(); 3208 3210 uint8_t const *pu8BufferBegin = pu8Buffer; 3209 uint8_t const *pu8BufferEnd = pu8Buffer + (cbBuffer - pCmd->srcOffset);3211 uint8_t const *pu8BufferEnd = pu8Buffer + cbBuffer; 3210 3212 3211 3213 pu8Buffer += pCmd->srcOffset; -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-shader.cpp
r90853 r91375 1629 1629 || opcode.aValOperand[0].aOperandIndex[0].indexRepresentation == VGPU10_OPERAND_INDEX_IMMEDIATE64, 1630 1630 VERR_NOT_SUPPORTED); 1631 pSignatureEntry->registerIndex = opcode.aValOperand[0].aOperandIndex[0].iOperandImmediate; 1632 pSignatureEntry->semanticName = opcode.semanticName; 1631 1632 uint32_t const indexDimension = opcode.aValOperand[0].indexDimension; 1633 if (indexDimension == VGPU10_OPERAND_INDEX_0D) 1634 { 1635 if (opcode.aValOperand[0].operandType == VGPU10_OPERAND_TYPE_INPUT_PRIMITIVEID) 1636 { 1637 pSignatureEntry->registerIndex = 0; 1638 pSignatureEntry->semanticName = SVGADX_SIGNATURE_SEMANTIC_NAME_PRIMITIVE_ID; 1639 } 1640 else 1641 ASSERT_GUEST_FAILED_RETURN(VERR_NOT_SUPPORTED); 1642 } 1643 else 1644 { 1645 ASSERT_GUEST_RETURN( indexDimension == VGPU10_OPERAND_INDEX_1D 1646 || indexDimension == VGPU10_OPERAND_INDEX_2D 1647 || indexDimension == VGPU10_OPERAND_INDEX_3D, 1648 VERR_NOT_SUPPORTED); 1649 /* The register index seems to be in the highest dimension. */ 1650 pSignatureEntry->registerIndex = opcode.aValOperand[0].aOperandIndex[indexDimension - VGPU10_OPERAND_INDEX_1D].iOperandImmediate; 1651 pSignatureEntry->semanticName = opcode.semanticName; 1652 } 1633 1653 pSignatureEntry->mask = opcode.aValOperand[0].mask; 1634 1654 pSignatureEntry->componentType = SVGADX_SIGNATURE_REGISTER_COMPONENT_UNKNOWN; /// @todo Proper value? Seems that it is not important. -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx.cpp
r91361 r91375 726 726 727 727 728 int vmsvga3dDXSetSOTargets(PVGASTATECC pThisCC, uint32_t idDXContext )728 int vmsvga3dDXSetSOTargets(PVGASTATECC pThisCC, uint32_t idDXContext, uint32_t cSoTarget, SVGA3dSoTarget const *paSoTarget) 729 729 { 730 730 int rc; … … 738 738 AssertRCReturn(rc, rc); 739 739 740 rc = pSvgaR3State->pFuncsDX->pfnDXSetSOTargets(pThisCC, pDXContext); 740 ASSERT_GUEST_RETURN(cSoTarget < SVGA3D_DX_MAX_SOTARGETS, VERR_INVALID_PARAMETER); 741 742 rc = pSvgaR3State->pFuncsDX->pfnDXSetSOTargets(pThisCC, pDXContext, cSoTarget, paSoTarget); 741 743 return rc; 742 744 } … … 1375 1377 pEntry->mobid = SVGA_ID_INVALID; 1376 1378 1377 /** @todo Remove from here. */1378 // if (!pDXContext->paShader)1379 // {1380 // /* Create host array for information about shaders. */1381 // pDXContext->paShader = (PVMSVGA3DSHADER)RTMemAllocZ(pDXContext->cot.cShader * sizeof(VMSVGA3DSHADER));1382 // AssertReturn(pDXContext->paShader, VERR_NO_MEMORY);1383 // for (uint32_t i = 0; i < pDXContext->cot.cShader; ++i)1384 // pDXContext->paShader[i].id = SVGA_ID_INVALID;1385 // }1386 1387 1379 PVMSVGA3DSHADER pShader = &pDXContext->paShader[shaderId]; 1388 1380 if (pShader->id != SVGA_ID_INVALID) 1389 1381 { 1390 /* * @todo Cleanupcurrent shader. */1391 pSvgaR3State->pFuncsDX->pfnDXDestroyShader(pThisCC, pDXContext );1382 /* Cleanup the current shader. */ 1383 pSvgaR3State->pFuncsDX->pfnDXDestroyShader(pThisCC, pDXContext, shaderId); 1392 1384 RTMemFree(pShader->pShaderProgram); 1393 1385 } … … 1405 1397 1406 1398 1407 int vmsvga3dDXDestroyShader(PVGASTATECC pThisCC, uint32_t idDXContext )1399 int vmsvga3dDXDestroyShader(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyShader const *pCmd) 1408 1400 { 1409 1401 int rc; … … 1417 1409 AssertRCReturn(rc, rc); 1418 1410 1419 rc = pSvgaR3State->pFuncsDX->pfnDXDestroyShader(pThisCC, pDXContext); 1411 AssertReturn(pDXContext->paShader, VERR_INVALID_STATE); 1412 1413 SVGA3dShaderId const shaderId = pCmd->shaderId; 1414 1415 ASSERT_GUEST_RETURN(pDXContext->cot.paShader, VERR_INVALID_STATE); 1416 ASSERT_GUEST_RETURN(shaderId < pDXContext->cot.cShader, VERR_INVALID_PARAMETER); 1417 RT_UNTRUSTED_VALIDATED_FENCE(); 1418 1419 rc = pSvgaR3State->pFuncsDX->pfnDXDestroyShader(pThisCC, pDXContext, shaderId); 1420 1421 /* Cleanup COTable entries.*/ 1422 SVGACOTableDXShaderEntry *pEntry = &pDXContext->cot.paShader[shaderId]; 1423 pEntry->type = SVGA3D_SHADERTYPE_INVALID; 1424 pEntry->sizeInBytes = 0; 1425 pEntry->offsetInBytes = 0; 1426 pEntry->mobid = SVGA_ID_INVALID; 1427 1428 PVMSVGA3DSHADER pShader = &pDXContext->paShader[shaderId]; 1429 pShader->id = SVGA_ID_INVALID; 1430 pShader->cid = SVGA_ID_INVALID; 1431 pShader->type = SVGA3D_SHADERTYPE_INVALID; 1432 pShader->cbData = 0; 1433 RTMemFree(pShader->pShaderProgram); 1434 pShader->pShaderProgram = NULL; 1435 pShader->u.pvBackendShader = NULL; 1436 1420 1437 return rc; 1421 1438 } … … 1449 1466 if (pSignatureHeader->headerVersion == SVGADX_SIGNATURE_HEADER_VERSION_0) 1450 1467 { 1468 DEBUG_BREAKPOINT_TEST(); 1451 1469 ASSERT_GUEST_RETURN( pSignatureHeader->numInputSignatures <= RT_ELEMENTS(pShader->shaderInfo.aInputSignature) 1452 1470 && pSignatureHeader->numOutputSignatures <= RT_ELEMENTS(pShader->shaderInfo.aOutputSignature) … … 1540 1558 1541 1559 1542 int vmsvga3dDXDefineStreamOutput(PVGASTATECC pThisCC, uint32_t idDXContext )1560 int vmsvga3dDXDefineStreamOutput(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDefineStreamOutput const *pCmd) 1543 1561 { 1544 1562 int rc; … … 1552 1570 AssertRCReturn(rc, rc); 1553 1571 1554 rc = pSvgaR3State->pFuncsDX->pfnDXDefineStreamOutput(pThisCC, pDXContext); 1555 return rc; 1556 } 1557 1558 1559 int vmsvga3dDXDestroyStreamOutput(PVGASTATECC pThisCC, uint32_t idDXContext) 1572 SVGA3dStreamOutputId const soid = pCmd->soid; 1573 1574 ASSERT_GUEST_RETURN(pDXContext->cot.paStreamOutput, VERR_INVALID_STATE); 1575 ASSERT_GUEST_RETURN(soid < pDXContext->cot.cStreamOutput, VERR_INVALID_PARAMETER); 1576 ASSERT_GUEST_RETURN(pCmd->numOutputStreamEntries < SVGA3D_MAX_DX10_STREAMOUT_DECLS, VERR_INVALID_PARAMETER); 1577 RT_UNTRUSTED_VALIDATED_FENCE(); 1578 1579 SVGACOTableDXStreamOutputEntry *pEntry = &pDXContext->cot.paStreamOutput[soid]; 1580 pEntry->numOutputStreamEntries = pCmd->numOutputStreamEntries; 1581 memcpy(pEntry->decl, pCmd->decl, sizeof(pEntry->decl)); 1582 memcpy(pEntry->streamOutputStrideInBytes, pCmd->streamOutputStrideInBytes, sizeof(pEntry->streamOutputStrideInBytes)); 1583 pEntry->rasterizedStream = pCmd->rasterizedStream; 1584 pEntry->numOutputStreamStrides; 1585 pEntry->mobid = SVGA_ID_INVALID; 1586 pEntry->offsetInBytes = 0; 1587 pEntry->usesMob = 0; 1588 pEntry->pad0 = 0; 1589 pEntry->pad1 = 0; 1590 RT_ZERO(pEntry->pad2); 1591 1592 rc = pSvgaR3State->pFuncsDX->pfnDXDefineStreamOutput(pThisCC, pDXContext, soid, pEntry); 1593 return rc; 1594 } 1595 1596 1597 int vmsvga3dDXDestroyStreamOutput(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyStreamOutput const *pCmd) 1560 1598 { 1561 1599 int rc; … … 1569 1607 AssertRCReturn(rc, rc); 1570 1608 1571 rc = pSvgaR3State->pFuncsDX->pfnDXDestroyStreamOutput(pThisCC, pDXContext); 1609 SVGA3dStreamOutputId const soid = pCmd->soid; 1610 1611 ASSERT_GUEST_RETURN(pDXContext->cot.paStreamOutput, VERR_INVALID_STATE); 1612 ASSERT_GUEST_RETURN(soid < pDXContext->cot.cStreamOutput, VERR_INVALID_PARAMETER); 1613 RT_UNTRUSTED_VALIDATED_FENCE(); 1614 1615 rc = pSvgaR3State->pFuncsDX->pfnDXDestroyStreamOutput(pThisCC, pDXContext, soid); 1616 1617 SVGACOTableDXStreamOutputEntry *pEntry = &pDXContext->cot.paStreamOutput[soid]; 1618 RT_ZERO(*pEntry); 1619 pEntry->mobid = SVGA_ID_INVALID; 1620 1572 1621 return rc; 1573 1622 } -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win-dx.cpp
r91364 r91375 147 147 } DXSHADER; 148 148 149 typedef struct DXSTREAMOUTPUT 150 { 151 ID3D11Buffer *pSOBuffer; 152 } DXSTREAMOUTPUT; 153 149 154 typedef struct VMSVGA3DBACKENDDXCONTEXT 150 155 { … … 162 167 uint32_t cQuery; /* papQuery */ 163 168 uint32_t cShader; /* papShader */ 169 uint32_t cStreamOutput; /* papStreamOutput */ 164 170 ID3D11BlendState **papBlendState; 165 171 ID3D11DepthStencilState **papDepthStencilState; … … 172 178 ID3D11Query **papQuery; 173 179 DXSHADER *paShader; 180 DXSTREAMOUTPUT *paStreamOutput; 174 181 } VMSVGA3DBACKENDDXCONTEXT; 175 182 … … 728 735 pInfoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_WARNING, true); 729 736 737 /* No breakpoints for the following messages. */ 730 738 D3D11_MESSAGE_ID saIgnoredMessageIds[] = 731 739 { 732 740 /* Message ID: Caused by: */ 733 741 D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH, /* Autogenerated input signatures. */ 742 D3D11_MESSAGE_ID_LIVE_DEVICE, /* Live object report. Does not seem to prevent a breakpoint. */ 743 (D3D11_MESSAGE_ID)3146081 /*DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET*/, /* U. */ 744 D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET, /* U. */ 745 D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH, /* U. */ 734 746 }; 735 747 … … 772 784 { 773 785 RT_NOREF(pBackend); 786 if (pDevice->pImmediateContext) 787 pDevice->pImmediateContext->ClearState(); 788 789 D3D_RELEASE(pDevice->pDxgiFactory); 790 D3D_RELEASE(pDevice->pImmediateContext); 791 792 #ifdef DEBUG 793 HRESULT hr2; 794 ID3D11Debug *pDebug = 0; 795 hr2 = pDevice->pDevice->QueryInterface(__uuidof(ID3D11Debug), (void**)&pDebug); 796 if (SUCCEEDED(hr2)) 797 { 798 //pDebug->ReportLiveDeviceObjects(D3D11_RLDO_DETAIL | (D3D11_RLDO_FLAGS)0x4 /*D3D11_RLDO_IGNORE_INTERNAL*/); 799 D3D_RELEASE(pDebug); 800 } 801 #endif 802 774 803 D3D_RELEASE(pDevice->pDevice); 775 D3D_RELEASE(pDevice->pImmediateContext);776 D3D_RELEASE(pDevice->pDxgiFactory);777 804 RT_ZERO(*pDevice); 778 805 } … … 925 952 } 926 953 954 static int dxDefineStreamOutput(PVMSVGA3DDXCONTEXT pDXContext, SVGA3dStreamOutputId soid, SVGACOTableDXStreamOutputEntry const *pEntry) 955 { 956 RT_NOREF(pDXContext, soid, pEntry); 957 return VINF_SUCCESS; 958 } 959 960 static void dxDestroyStreamOutput(DXSTREAMOUTPUT *pDXStreamOutput) 961 { 962 D3D_RELEASE(pDXStreamOutput->pSOBuffer); 963 } 964 927 965 static D3D11_BLEND dxBlendFactorAlpha(uint8_t svgaBlend) 928 966 { … … 942 980 } 943 981 982 944 983 static D3D11_BLEND dxBlendFactorColor(uint8_t svgaBlend) 945 984 { … … 947 986 } 948 987 988 949 989 static D3D11_BLEND_OP dxBlendOp(uint8_t svgaBlendEq) 950 990 { 951 991 return (D3D11_BLEND_OP)svgaBlendEq; 952 992 } 993 953 994 954 995 /** @todo AssertCompile for types like D3D11_COMPARISON_FUNC and SVGA3dComparisonFunc */ … … 1270 1311 break; 1271 1312 case SVGA3D_SHADERTYPE_GS: 1313 hr = pDevice->pDevice->CreateGeometryShader(pDXShader->pvDXBC, pDXShader->cbDXBC, NULL, &pDXShader->pGeometryShader); 1314 Assert(SUCCEEDED(hr)); 1315 break; 1272 1316 case SVGA3D_SHADERTYPE_HS: 1273 1317 case SVGA3D_SHADERTYPE_DS: … … 1292 1336 break; 1293 1337 case SVGA3D_SHADERTYPE_GS: 1338 pDevice->pImmediateContext->GSSetShader(pDXShader ? pDXShader->pGeometryShader : NULL, NULL, 0); 1339 break; 1294 1340 case SVGA3D_SHADERTYPE_HS: 1295 1341 case SVGA3D_SHADERTYPE_DS: … … 1312 1358 break; 1313 1359 case SVGA3D_SHADERTYPE_GS: 1360 pDevice->pImmediateContext->GSSetConstantBuffers(slot, 1, &pConstantBuffer); 1361 break; 1314 1362 case SVGA3D_SHADERTYPE_HS: 1315 1363 case SVGA3D_SHADERTYPE_DS: … … 1332 1380 break; 1333 1381 case SVGA3D_SHADERTYPE_GS: 1382 pDevice->pImmediateContext->GSSetSamplers(startSampler, cSampler, papSampler); 1383 break; 1334 1384 case SVGA3D_SHADERTYPE_HS: 1335 1385 case SVGA3D_SHADERTYPE_DS: … … 1352 1402 break; 1353 1403 case SVGA3D_SHADERTYPE_GS: 1404 pDevice->pImmediateContext->GSSetShaderResources(startView, cShaderResourceView, papShaderResourceView); 1405 break; 1354 1406 case SVGA3D_SHADERTYPE_HS: 1355 1407 case SVGA3D_SHADERTYPE_DS: … … 1428 1480 td.Usage = D3D11_USAGE_STAGING; 1429 1481 td.BindFlags = 0; /* No flags allowed. */ 1430 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ ;1482 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; 1431 1483 hr = pDXDevice->pDevice->CreateTexture2D(&td, 0, &pBackendSurface->pStagingTexture); 1432 1484 Assert(SUCCEEDED(hr)); … … 1571 1623 td.Usage = D3D11_USAGE_STAGING; 1572 1624 td.BindFlags = 0; /* No flags allowed. */ 1573 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ ;1625 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; 1574 1626 hr = pDXDevice->pDevice->CreateTexture2D(&td, 0, &pBackendSurface->pStagingTexture); 1575 1627 Assert(SUCCEEDED(hr)); … … 1660 1712 td.Usage = D3D11_USAGE_STAGING; 1661 1713 td.BindFlags = 0; /* No flags allowed. */ 1662 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ ;1714 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; 1663 1715 td.MiscFlags = 0; 1664 1716 hr = pDXDevice->pDevice->CreateTexture2D(&td, paInitialData, &pBackendSurface->pStagingTexture); … … 1750 1802 td.Usage = D3D11_USAGE_STAGING; 1751 1803 td.BindFlags = 0; /* No flags allowed. */ 1752 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ ;1804 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; 1753 1805 td.MiscFlags = 0; 1754 1806 hr = pDXDevice->pDevice->CreateTexture3D(&td, paInitialData, &pBackendSurface->pStagingTexture3D); … … 1835 1887 td.Usage = D3D11_USAGE_STAGING; 1836 1888 td.BindFlags = 0; /* No flags allowed. */ 1837 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ ;1889 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; 1838 1890 td.MiscFlags = 0; 1839 1891 hr = pDXDevice->pDevice->CreateTexture2D(&td, paInitialData, &pBackendSurface->pStagingTexture); … … 1962 2014 td.Usage = D3D11_USAGE_STAGING; 1963 2015 td.BindFlags = 0; /* No flags allowed. */ 1964 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ ;2016 td.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; 1965 2017 td.MiscFlags = 0; 1966 2018 hr = pDXDevice->pDevice->CreateTexture2D(&td, paInitialData, &pBackendSurface->pStagingTexture); … … 2048 2100 2049 2101 2050 static int vmsvga3dBackSurfaceCreate ConstantBuffer(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, PVMSVGA3DSURFACE pSurface)2102 static int vmsvga3dBackSurfaceCreateSoBuffer(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, PVMSVGA3DSURFACE pSurface) 2051 2103 { 2052 2104 DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device; … … 2054 2106 2055 2107 /* Buffers should be created as such. */ 2056 AssertReturn(RT_BOOL(pSurface->surfaceFlags & ( SVGA3D_SURFACE_BIND_CONSTANT_BUFFER)), VERR_INVALID_PARAMETER);2108 AssertReturn(RT_BOOL(pSurface->surfaceFlags & SVGA3D_SURFACE_BIND_STREAM_OUTPUT), VERR_INVALID_PARAMETER); 2057 2109 2058 2110 if (pSurface->pBackendSurface != NULL) … … 2068 2120 D3D11_BUFFER_DESC bd; 2069 2121 RT_ZERO(bd); 2070 bd.ByteWidth = pSurface->paMipmapLevels[0].cbSurface;2071 bd.Usage = D3D11_USAGE_DYNAMIC;2072 bd.BindFlags = D3D11_BIND_CONSTANT_BUFFER;2073 bd.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;2122 bd.ByteWidth = pSurface->paMipmapLevels[0].cbSurface; 2123 bd.Usage = D3D11_USAGE_DEFAULT; 2124 bd.BindFlags = dxBindFlags(pSurface->surfaceFlags); // D3D11_BIND_VERTEX_BUFFER | D3D11_BIND_STREAM_OUTPUT; 2125 bd.CPUAccessFlags = 0; /// @todo ? D3D11_CPU_ACCESS_READ; 2074 2126 bd.MiscFlags = 0; 2075 2127 bd.StructureByteStride = 0; … … 2086 2138 pSurface->idAssociatedContext = pDXContext->cid; 2087 2139 pSurface->fDirty = true; 2140 return VINF_SUCCESS; 2141 } 2142 2143 /* Failure. */ 2144 D3D_RELEASE(pBackendSurface->u.pBuffer); 2145 RTMemFree(pBackendSurface); 2146 return VERR_NO_MEMORY; 2147 } 2148 2149 /** @todo Not needed */ 2150 static int vmsvga3dBackSurfaceCreateConstantBuffer(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, PVMSVGA3DSURFACE pSurface) 2151 { 2152 DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device; 2153 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 2154 2155 /* Buffers should be created as such. */ 2156 AssertReturn(RT_BOOL(pSurface->surfaceFlags & ( SVGA3D_SURFACE_BIND_CONSTANT_BUFFER)), VERR_INVALID_PARAMETER); 2157 2158 if (pSurface->pBackendSurface != NULL) 2159 { 2160 AssertFailed(); /** @todo Should the function not be used like that? */ 2161 vmsvga3dBackSurfaceDestroy(pThisCC, pSurface); 2162 } 2163 2164 PVMSVGA3DMIPMAPLEVEL pMipLevel; 2165 int rc = vmsvga3dMipmapLevel(pSurface, 0, 0, &pMipLevel); 2166 AssertRCReturn(rc, rc); 2167 2168 PVMSVGA3DBACKENDSURFACE pBackendSurface; 2169 rc = dxBackendSurfaceAlloc(&pBackendSurface); 2170 AssertRCReturn(rc, rc); 2171 2172 /* Upload the current data, if any. */ 2173 D3D11_SUBRESOURCE_DATA *pInitialData = NULL; 2174 D3D11_SUBRESOURCE_DATA initialData; 2175 if (pMipLevel->pSurfaceData) 2176 { 2177 initialData.pSysMem = pMipLevel->pSurfaceData; 2178 initialData.SysMemPitch = pMipLevel->cbSurface; 2179 initialData.SysMemSlicePitch = pMipLevel->cbSurface; 2180 2181 pInitialData = &initialData; 2182 2183 pMipLevel->fDirty = false; 2184 pSurface->fDirty = false; 2185 } 2186 2187 D3D11_BUFFER_DESC bd; 2188 RT_ZERO(bd); 2189 bd.ByteWidth = pMipLevel->cbSurface; 2190 bd.Usage = D3D11_USAGE_DYNAMIC; 2191 bd.BindFlags = D3D11_BIND_CONSTANT_BUFFER; 2192 bd.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; 2193 bd.MiscFlags = 0; 2194 bd.StructureByteStride = 0; 2195 2196 HRESULT hr = pDevice->pDevice->CreateBuffer(&bd, pInitialData, &pBackendSurface->u.pBuffer); 2197 if (SUCCEEDED(hr)) 2198 { 2199 /* 2200 * Success. 2201 */ 2202 pBackendSurface->enmResType = VMSVGA3D_RESTYPE_BUFFER; 2203 pBackendSurface->enmDxgiFormat = DXGI_FORMAT_UNKNOWN; 2204 pSurface->pBackendSurface = pBackendSurface; 2205 pSurface->idAssociatedContext = pDXContext->cid; 2088 2206 return VINF_SUCCESS; 2089 2207 } … … 2128 2246 } 2129 2247 2130 2248 /** @todo Not needed? */ 2131 2249 static int vmsvga3dBackSurfaceCreate(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, PVMSVGA3DSURFACE pSurface) 2132 2250 { … … 2542 2660 } 2543 2661 2544 /** @todo D3D11_MAP_WRITE does not work with D3D11_USAGE_DYNAMIC resources. Probably VMSVGA3D_SURFACE_MAP_WRITE is not necessary. */ 2662 /// @todo Hack. Need Staging buffer ro CopyResource data to the actual buffer 2663 if (enmMapType == VMSVGA3D_SURFACE_MAP_WRITE && pBackendSurface->enmResType == VMSVGA3D_RESTYPE_BUFFER) 2664 enmMapType = VMSVGA3D_SURFACE_MAP_WRITE_DISCARD; 2665 2545 2666 D3D11_MAP d3d11MapType; 2546 2667 switch (enmMapType) … … 2577 2698 pDevice->pImmediateContext->CopyResource(pBackendSurface->pStagingTexture, pBackendSurface->u.pTexture2D); 2578 2699 } 2700 else if (enmMapType == VMSVGA3D_SURFACE_MAP_WRITE) 2701 pMappedTexture = pBackendSurface->pStagingTexture; 2579 2702 else 2580 2703 pMappedTexture = pBackendSurface->pDynamicTexture; … … 2603 2726 { 2604 2727 //Assert(pImage->face == 0 && pImage->mipmap == 0); 2605 if (!pBackendSurface->pStagingTexture || !pBackendSurface->pDynamicTexture) return VERR_NOT_IMPLEMENTED; 2606 ID3D11Texture2D *pMappedTexture; 2728 if (!( (pBackendSurface->pStagingTexture && pBackendSurface->pDynamicTexture) 2729 || (pBackendSurface->pStagingTexture3D && pBackendSurface->pDynamicTexture3D) 2730 ) 2731 ) 2732 { 2733 AssertFailed(); 2734 return VERR_NOT_IMPLEMENTED; 2735 } 2736 2737 ID3D11Resource *pMappedResource; 2607 2738 if (enmMapType == VMSVGA3D_SURFACE_MAP_READ) 2608 2739 { 2609 pMappedTexture = pBackendSurface->pStagingTexture; 2740 pMappedResource = (pBackendSurface->enmResType == VMSVGA3D_RESTYPE_TEXTURE_3D) 2741 ? (ID3D11Resource *)pBackendSurface->pStagingTexture3D 2742 : (ID3D11Resource *)pBackendSurface->pStagingTexture; 2610 2743 2611 2744 /* Wait for the surface to finish drawing. */ … … 2621 2754 * Always copy entire miplevel so all Dst are zero and pSrcBox is NULL, as D3D11 requires. 2622 2755 */ 2623 ID3D11Resource *pDstResource = p BackendSurface->pStagingTexture;2756 ID3D11Resource *pDstResource = pMappedResource; 2624 2757 UINT DstSubresource = 0; 2625 2758 UINT DstX = 0; 2626 2759 UINT DstY = 0; 2627 2760 UINT DstZ = 0; 2628 ID3D11Resource *pSrcResource = pBackendSurface->u.p Texture2D;2761 ID3D11Resource *pSrcResource = pBackendSurface->u.pResource; 2629 2762 UINT SrcSubresource = D3D11CalcSubresource(pImage->mipmap, pImage->face, pSurface->cLevels); 2630 2763 D3D11_BOX *pSrcBox = NULL; … … 2639 2772 pSrcResource, SrcSubresource, pSrcBox); 2640 2773 } 2774 else if (enmMapType == VMSVGA3D_SURFACE_MAP_WRITE) 2775 pMappedResource = (pBackendSurface->enmResType == VMSVGA3D_RESTYPE_TEXTURE_3D) 2776 ? (ID3D11Resource *)pBackendSurface->pStagingTexture3D 2777 : (ID3D11Resource *)pBackendSurface->pStagingTexture; 2641 2778 else 2642 pMappedTexture = pBackendSurface->pDynamicTexture; 2779 pMappedResource = (pBackendSurface->enmResType == VMSVGA3D_RESTYPE_TEXTURE_3D) 2780 ? (ID3D11Resource *)pBackendSurface->pDynamicTexture3D 2781 : (ID3D11Resource *)pBackendSurface->pDynamicTexture; 2643 2782 2644 2783 UINT const Subresource = 0; 2645 HRESULT hr = pDevice->pImmediateContext->Map(pMapped Texture, Subresource,2784 HRESULT hr = pDevice->pImmediateContext->Map(pMappedResource, Subresource, 2646 2785 d3d11MapType, /* MapFlags = */ 0, &mappedResource); 2647 2786 if (SUCCEEDED(hr)) … … 2720 2859 ID3D11Texture2D *pMappedTexture; 2721 2860 if (pMap->enmMapType == VMSVGA3D_SURFACE_MAP_READ) 2861 pMappedTexture = pBackendSurface->pStagingTexture; 2862 else if (pMap->enmMapType == VMSVGA3D_SURFACE_MAP_WRITE) 2722 2863 pMappedTexture = pBackendSurface->pStagingTexture; 2723 2864 else … … 2757 2898 || pBackendSurface->enmResType == VMSVGA3D_RESTYPE_TEXTURE_3D) 2758 2899 { 2759 ID3D11 Texture2D *pMappedTexture;2900 ID3D11Resource *pMappedResource; 2760 2901 if (pMap->enmMapType == VMSVGA3D_SURFACE_MAP_READ) 2761 pMappedTexture = pBackendSurface->pStagingTexture; 2902 pMappedResource = (pBackendSurface->enmResType == VMSVGA3D_RESTYPE_TEXTURE_3D) 2903 ? (ID3D11Resource *)pBackendSurface->pStagingTexture3D 2904 : (ID3D11Resource *)pBackendSurface->pStagingTexture; 2905 else if (pMap->enmMapType == VMSVGA3D_SURFACE_MAP_WRITE) 2906 pMappedResource = (pBackendSurface->enmResType == VMSVGA3D_RESTYPE_TEXTURE_3D) 2907 ? (ID3D11Resource *)pBackendSurface->pStagingTexture3D 2908 : (ID3D11Resource *)pBackendSurface->pStagingTexture; 2762 2909 else 2763 pMappedTexture = pBackendSurface->pDynamicTexture; 2910 pMappedResource = (pBackendSurface->enmResType == VMSVGA3D_RESTYPE_TEXTURE_3D) 2911 ? (ID3D11Resource *)pBackendSurface->pDynamicTexture3D 2912 : (ID3D11Resource *)pBackendSurface->pDynamicTexture; 2764 2913 2765 2914 UINT const Subresource = 0; /* Staging or dynamic textures have one subresource. */ 2766 pDevice->pImmediateContext->Unmap(pMapped Texture, Subresource);2915 pDevice->pImmediateContext->Unmap(pMappedResource, Subresource); 2767 2916 2768 2917 if ( fWritten … … 2771 2920 || pMap->enmMapType == VMSVGA3D_SURFACE_MAP_WRITE_DISCARD)) 2772 2921 { 2773 ID3D11Resource *pDstResource = pBackendSurface->u.pTexture2D; 2922 /* If entire resource must be copied then use pSrcBox = NULL and dst point (0,0,0) 2923 * Because DX11 insists on this for some resource types, for example DEPTH_STENCIL resources. 2924 */ 2925 uint32_t const cWidth0 = pSurface->paMipmapLevels[0].mipmapSize.width; 2926 uint32_t const cHeight0 = pSurface->paMipmapLevels[0].mipmapSize.height; 2927 uint32_t const cDepth0 = pSurface->paMipmapLevels[0].mipmapSize.depth; 2928 bool const fEntireResource = pMap->box.x == 0 && pMap->box.y == 0 && pMap->box.z == 0 2929 && pMap->box.w == cWidth0 && pMap->box.h == cHeight0 && pMap->box.d == cDepth0; 2930 2931 ID3D11Resource *pDstResource = pBackendSurface->u.pResource; 2774 2932 UINT DstSubresource = D3D11CalcSubresource(pImage->mipmap, pImage->face, pSurface->cLevels); 2775 UINT DstX = pMap->box.x;2776 UINT DstY = pMap->box.y;2933 UINT DstX = (pMap->box.x / pSurface->cxBlock) * pSurface->cxBlock; 2934 UINT DstY = (pMap->box.y / pSurface->cyBlock) * pSurface->cyBlock; 2777 2935 UINT DstZ = pMap->box.z; 2778 ID3D11Resource *pSrcResource = p BackendSurface->pDynamicTexture;2936 ID3D11Resource *pSrcResource = pMappedResource; 2779 2937 UINT SrcSubresource = Subresource; 2938 D3D11_BOX *pSrcBox; 2780 2939 D3D11_BOX SrcBox; 2781 SrcBox.left = pMap->box.x; 2782 SrcBox.top = pMap->box.y; 2783 SrcBox.front = pMap->box.z; 2784 SrcBox.right = pMap->box.x + pMap->box.w; 2785 SrcBox.bottom = pMap->box.y + pMap->box.h; 2786 SrcBox.back = pMap->box.z + pMap->box.d; 2940 if (fEntireResource) 2941 pSrcBox = NULL; 2942 else 2943 { 2944 uint32_t const cxBlocks = (pMap->box.w + pSurface->cxBlock - 1) / pSurface->cxBlock; 2945 uint32_t const cyBlocks = (pMap->box.h + pSurface->cyBlock - 1) / pSurface->cyBlock; 2946 2947 SrcBox.left = DstX; 2948 SrcBox.top = DstY; 2949 SrcBox.front = DstZ; 2950 SrcBox.right = DstX + cxBlocks * pSurface->cxBlock; 2951 SrcBox.bottom = DstY + cyBlocks * pSurface->cyBlock; 2952 SrcBox.back = DstZ + pMap->box.d; 2953 pSrcBox = &SrcBox; 2954 } 2787 2955 2788 2956 pDevice->pImmediateContext->CopySubresourceRegion(pDstResource, DstSubresource, DstX, DstY, DstZ, 2789 pSrcResource, SrcSubresource, &SrcBox);2957 pSrcResource, SrcSubresource, pSrcBox); 2790 2958 2791 2959 pBackendSurface->cidDrawing = pSurface->idAssociatedContext; … … 3533 3701 Assert(pSrcSurface->idAssociatedContext == DX_CID_BACKEND && pDstSurface->idAssociatedContext == DX_CID_BACKEND); 3534 3702 3703 /* Wait for the source surface to finish drawing. */ 3704 if (pSrcSurface->pBackendSurface->cidDrawing != SVGA_ID_INVALID) 3705 { 3706 dxContextWait(pSrcSurface->pBackendSurface->cidDrawing, pState); 3707 pSrcSurface->pBackendSurface->cidDrawing = SVGA_ID_INVALID; 3708 } 3709 3535 3710 DXDEVICE *pDXDevice = &pBackend->device; 3536 3711 … … 4019 4194 4020 4195 VMSVGA3D_MAPPED_SURFACE map; 4021 rc = vmsvga3dBackSurfaceMap(pThisCC, &image, &box, VMSVGA3D_SURFACE_MAP_WRITE _DISCARD, &map);4196 rc = vmsvga3dBackSurfaceMap(pThisCC, &image, &box, VMSVGA3D_SURFACE_MAP_WRITE, &map); 4022 4197 if (RT_SUCCESS(rc)) 4023 4198 { … … 4094 4269 4095 4270 VMSVGA3D_SURFACE_MAP const enmMap = transfer == SVGA3D_WRITE_HOST_VRAM 4096 ? VMSVGA3D_SURFACE_MAP_WRITE _DISCARD4271 ? VMSVGA3D_SURFACE_MAP_WRITE 4097 4272 : VMSVGA3D_SURFACE_MAP_READ; 4098 4273 … … 4101 4276 if (RT_SUCCESS(rc)) 4102 4277 { 4278 #if 0 4279 if (box.w == 250 && box.h == 250 && box.d == 1 && enmMap == VMSVGA3D_SURFACE_MAP_READ) 4280 { 4281 DEBUG_BREAKPOINT_TEST(); 4282 vmsvga3dMapWriteBmpFile(&map, "P"); 4283 } 4284 #endif 4103 4285 /* Prepare parameters for vmsvgaR3GmrTransfer, which needs the host buffer address, size 4104 4286 * and offset of the first scanline. … … 4253 4435 { 4254 4436 for (uint32_t i = 0; i < pBackendDXContext->cShader; ++i) 4255 D3D_RELEASE(pBackendDXContext->paShader[i].pShader); 4437 D3D_RELEASE(pBackendDXContext->paShader[i].pShader); /// @todo dxDestroyShader 4438 } 4439 if (pBackendDXContext->paStreamOutput) 4440 { 4441 for (uint32_t i = 0; i < pBackendDXContext->cStreamOutput; ++i) 4442 dxDestroyStreamOutput(&pBackendDXContext->paStreamOutput[i]); 4256 4443 } 4257 4444 … … 4266 4453 RTMemFreeZ(pBackendDXContext->papQuery, sizeof(pBackendDXContext->papQuery[0]) * pBackendDXContext->cQuery); 4267 4454 RTMemFreeZ(pBackendDXContext->paShader, sizeof(pBackendDXContext->paShader[0]) * pBackendDXContext->cShader); 4455 RTMemFreeZ(pBackendDXContext->paStreamOutput, sizeof(pBackendDXContext->paStreamOutput[0]) * pBackendDXContext->cStreamOutput); 4268 4456 4269 4457 /* Destroy backend surfaces which belong to this context. */ … … 4349 4537 AssertRCReturn(rc, rc); 4350 4538 4351 uint32_t const cbSurface = pSurface->paMipmapLevels[0].cbSurface; 4539 PVMSVGA3DMIPMAPLEVEL pMipLevel; 4540 rc = vmsvga3dMipmapLevel(pSurface, 0, 0, &pMipLevel); 4541 AssertRCReturn(rc, rc); 4542 4543 uint32_t const cbSurface = pMipLevel->cbSurface; 4352 4544 ASSERT_GUEST_RETURN( offsetInBytes < cbSurface 4353 4545 && sizeInBytes <= cbSurface - offsetInBytes, VERR_INVALID_PARAMETER); 4354 4546 4355 if (pSurface->pBackendSurface == NULL) 4356 { 4357 /* Create the resource. */ 4358 rc = vmsvga3dBackSurfaceCreateConstantBuffer(pThisCC, pDXContext, pSurface); 4359 AssertRCReturn(rc, rc); 4360 } 4361 4362 if (pSurface->fDirty) 4363 { 4364 /* Get mobid for the surface and read from the MOB. */ 4365 SVGA3dSurfaceImageId imageId; 4366 imageId.sid = sid; 4367 imageId.face = 0; 4368 imageId.mipmap = 0; 4369 4370 SVGA3dPoint ptSrc; 4371 ptSrc.x = offsetInBytes / pSurface->cbBlock; 4372 ptSrc.y = 0; 4373 ptSrc.z = 0; 4374 4375 SVGA3dBox boxDst; 4376 boxDst.x = 0; 4377 boxDst.y = 0; 4378 boxDst.z = 0; 4379 boxDst.w = sizeInBytes / pSurface->cbBlock; 4380 boxDst.h = 1; 4381 boxDst.d = 1; 4382 4383 rc = vmsvgaR3UpdateGBSurfaceEx(pThisCC, &imageId, &boxDst, &ptSrc); 4384 AssertRCReturn(rc, rc); 4385 } 4386 4387 dxConstantBufferSet(pDevice, slot, type, pSurface->pBackendSurface->u.pBuffer); 4547 /* Constant buffers are created on demand. */ 4548 Assert(pSurface->pBackendSurface == NULL); 4549 4550 /* Upload the current data, if any. */ 4551 D3D11_SUBRESOURCE_DATA *pInitialData = NULL; 4552 D3D11_SUBRESOURCE_DATA initialData; 4553 if (pMipLevel->pSurfaceData) 4554 { 4555 initialData.pSysMem = (uint8_t *)pMipLevel->pSurfaceData + offsetInBytes; 4556 initialData.SysMemPitch = sizeInBytes; 4557 initialData.SysMemSlicePitch = sizeInBytes; 4558 4559 pInitialData = &initialData; 4560 } 4561 4562 D3D11_BUFFER_DESC bd; 4563 RT_ZERO(bd); 4564 bd.ByteWidth = sizeInBytes; 4565 bd.Usage = D3D11_USAGE_DEFAULT; 4566 bd.BindFlags = D3D11_BIND_CONSTANT_BUFFER; 4567 bd.CPUAccessFlags = 0; 4568 bd.MiscFlags = 0; 4569 bd.StructureByteStride = 0; 4570 4571 ID3D11Buffer *pBuffer = 0; 4572 HRESULT hr = pDevice->pDevice->CreateBuffer(&bd, pInitialData, &pBuffer); 4573 if (SUCCEEDED(hr)) 4574 { 4575 dxConstantBufferSet(pDevice, slot, type, pBuffer); 4576 D3D_RELEASE(pBuffer); 4577 } 4578 4388 4579 return VINF_SUCCESS; 4389 4580 } … … 4431 4622 { 4432 4623 pDXShader = &pDXContext->pBackendDXContext->paShader[pShader->id]; 4624 Assert(pDXShader->pShader); 4433 4625 Assert(pDXShader->enmShaderType >= SVGA3D_SHADERTYPE_MIN && pDXShader->enmShaderType < SVGA3D_SHADERTYPE_MAX); 4434 4626 uint32_t const idxShaderState = pDXShader->enmShaderType - SVGA3D_SHADERTYPE_MIN; … … 4715 4907 } 4716 4908 4909 Assert(pSurface->pBackendSurface->u.pBuffer); 4717 4910 paResources[idxVertexBuffer] = pSurface->pBackendSurface->u.pBuffer; 4718 4911 paStride[idxVertexBuffer] = paVertexBuffer[i].stride; … … 5024 5217 5025 5218 5026 static DECLCALLBACK(int) vmsvga3dBackDXSetSOTargets(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext) 5027 { 5028 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 5029 5030 RT_NOREF(pBackend, pDXContext); 5031 AssertFailed(); /** @todo Implement */ 5032 return VERR_NOT_IMPLEMENTED; 5219 static DECLCALLBACK(int) vmsvga3dBackDXSetSOTargets(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t cSoTarget, SVGA3dSoTarget const *paSoTarget) 5220 { 5221 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 5222 RT_NOREF(pBackend); 5223 5224 DXDEVICE *pDevice = &pDXContext->pBackendDXContext->device; 5225 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 5226 5227 /* For each paSoTarget[i]: 5228 * If the stream outout buffer object does not exist then create it. 5229 * If the surface has been updated by the guest then update the buffer object. 5230 * Use SOSetTargets to set the buffers. 5231 */ 5232 5233 ID3D11Buffer *paResource[SVGA3D_DX_MAX_SOTARGETS]; 5234 UINT paOffset[SVGA3D_DX_MAX_SOTARGETS]; 5235 5236 /* Always re-bind all 4 SO targets. They can be NULL. */ 5237 for (uint32_t i = 0; i < SVGA3D_DX_MAX_SOTARGETS; ++i) 5238 { 5239 /* Get corresponding resource. Create the buffer if does not yet exist. */ 5240 if (i < cSoTarget && paSoTarget[i].sid != SVGA_ID_INVALID) 5241 { 5242 PVMSVGA3DSURFACE pSurface; 5243 int rc = vmsvga3dSurfaceFromSid(pThisCC->svga.p3dState, paSoTarget[i].sid, &pSurface); 5244 AssertRCReturn(rc, rc); 5245 5246 if (pSurface->pBackendSurface == NULL) 5247 { 5248 /* Create the resource. */ 5249 rc = vmsvga3dBackSurfaceCreateSoBuffer(pThisCC, pDXContext, pSurface); 5250 AssertRCReturn(rc, rc); 5251 } 5252 5253 /** @todo How paSoTarget[i].sizeInBytes is used? Maybe when the buffer is created? */ 5254 paResource[i] = pSurface->pBackendSurface->u.pBuffer; 5255 paOffset[i] = paSoTarget[i].offset; 5256 5257 /** @todo This should be in the caller. */ 5258 pDXContext->svgaDXContext.streamOut.targets[i] = paSoTarget[i].sid; 5259 } 5260 else 5261 { 5262 paResource[i] = NULL; 5263 paOffset[i] = 0; 5264 5265 /** @todo This should be in the caller. */ 5266 pDXContext->svgaDXContext.streamOut.targets[i] = SVGA_ID_INVALID; 5267 } 5268 5269 /// @todo pDXContext->svgaDXContext.streamOut.soid? 5270 } 5271 5272 pDevice->pImmediateContext->SOSetTargets(SVGA3D_DX_MAX_SOTARGETS, paResource, paOffset); 5273 5274 return VINF_SUCCESS; 5033 5275 } 5034 5276 … … 5313 5555 && pDXContext->cid != pSurface->idAssociatedContext) 5314 5556 { 5315 /* Supposed to be per context. */ 5316 //AssertFailed(); // test 5557 /* Supposed to be per context. Sometimes the guest reuses the texture in another context. */ 5317 5558 vmsvga3dBackSurfaceDestroy(pThisCC, pSurface); 5318 5559 } … … 5554 5795 5555 5796 5797 static int dxDestroyShader(DXSHADER *pDXShader) 5798 { 5799 pDXShader->enmShaderType = SVGA3D_SHADERTYPE_INVALID; 5800 D3D_RELEASE(pDXShader->pShader); 5801 RTMemFree(pDXShader->pvDXBC); 5802 pDXShader->pvDXBC = NULL; 5803 pDXShader->cbDXBC = 0; 5804 return VINF_SUCCESS; 5805 } 5806 5807 5556 5808 static DECLCALLBACK(int) vmsvga3dBackDXDefineShader(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderId shaderId, SVGACOTableDXShaderEntry const *pEntry) 5557 5809 { … … 5560 5812 5561 5813 DXSHADER *pDXShader = &pDXContext->pBackendDXContext->paShader[shaderId]; 5562 D3D_RELEASE(pDXShader->pShader);5814 dxDestroyShader(pDXShader); 5563 5815 5564 5816 return dxDefineShader(pDXContext, shaderId, pEntry); … … 5566 5818 5567 5819 5568 static DECLCALLBACK(int) vmsvga3dBackDXDestroyShader(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext) 5569 { 5570 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 5571 5572 RT_NOREF(pBackend, pDXContext); 5573 AssertFailed(); /** @todo Implement */ 5574 return VERR_NOT_IMPLEMENTED; 5820 static DECLCALLBACK(int) vmsvga3dBackDXDestroyShader(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderId shaderId) 5821 { 5822 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 5823 RT_NOREF(pBackend); 5824 5825 DXSHADER *pDXShader = &pDXContext->pBackendDXContext->paShader[shaderId]; 5826 dxDestroyShader(pDXShader); 5827 5828 return VINF_SUCCESS; 5575 5829 } 5576 5830 … … 5606 5860 { 5607 5861 if (i > 0) 5608 Log ((",\n"));5609 5610 Log ((" %#04x", pu8[i]));5862 Log6((",\n")); 5863 5864 Log6((" %#04x", pu8[i])); 5611 5865 } 5612 5866 else 5613 5867 { 5614 Log ((", %#04x", pu8[i]));5868 Log6((", %#04x", pu8[i])); 5615 5869 } 5616 5870 } 5617 Log (("\n"));5871 Log6(("\n")); 5618 5872 #endif 5619 5873 … … 5652 5906 5653 5907 5654 static DECLCALLBACK(int) vmsvga3dBackDXDefineStreamOutput(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext) 5655 { 5656 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 5657 5658 RT_NOREF(pBackend, pDXContext); 5659 AssertFailed(); /** @todo Implement */ 5660 return VERR_NOT_IMPLEMENTED; 5661 } 5662 5663 5664 static DECLCALLBACK(int) vmsvga3dBackDXDestroyStreamOutput(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext) 5665 { 5666 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 5667 5668 RT_NOREF(pBackend, pDXContext); 5669 AssertFailed(); /** @todo Implement */ 5670 return VERR_NOT_IMPLEMENTED; 5908 static DECLCALLBACK(int) vmsvga3dBackDXDefineStreamOutput(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dStreamOutputId soid, SVGACOTableDXStreamOutputEntry const *pEntry) 5909 { 5910 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 5911 RT_NOREF(pBackend); 5912 5913 DXSTREAMOUTPUT *pDXStreamOutput = &pDXContext->pBackendDXContext->paStreamOutput[soid]; 5914 dxDestroyStreamOutput(pDXStreamOutput); 5915 5916 return dxDefineStreamOutput(pDXContext, soid, pEntry); 5917 } 5918 5919 5920 static DECLCALLBACK(int) vmsvga3dBackDXDestroyStreamOutput(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dStreamOutputId soid) 5921 { 5922 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 5923 RT_NOREF(pBackend); 5924 5925 DXSTREAMOUTPUT *pDXStreamOutput = &pDXContext->pBackendDXContext->paStreamOutput[soid]; 5926 dxDestroyStreamOutput(pDXStreamOutput); 5927 5928 return VINF_SUCCESS; 5671 5929 } 5672 5930 … … 5682 5940 5683 5941 5684 static int dxCOTableRealloc(void **ppvCOTable, uint32_t *pcCOTable, uint32_t cbEntry, uint32_t cEntries) 5685 { 5942 static int dxCOTableRealloc(void **ppvCOTable, uint32_t *pcCOTable, uint32_t cbEntry, uint32_t cEntries, uint32_t cValidEntries) 5943 { 5944 uint32_t const cCOTableCurrent = *pcCOTable; 5945 5686 5946 if (*pcCOTable != cEntries) 5687 5947 { … … 5703 5963 5704 5964 if (*ppvCOTable) 5705 memset(*ppvCOTable, 0, cEntries * cbEntry); 5965 { 5966 uint32_t const cEntriesToKeep = RT_MIN(cCOTableCurrent, cValidEntries); 5967 memset((uint8_t *)(*ppvCOTable) + cEntriesToKeep * cbEntry, 0, (cEntries - cEntriesToKeep) * cbEntry); 5968 } 5706 5969 5707 5970 return VINF_SUCCESS; … … 5727 5990 /* Clear current entries. */ 5728 5991 if (pBackendDXContext->papRenderTargetView) 5729 DX_RELEASE_ARRAY(pBackendDXContext->cRenderTargetView, pBackendDXContext->papRenderTargetView); 5992 { 5993 for (uint32_t i = cValidEntries; i < pBackendDXContext->cRenderTargetView; ++i) 5994 D3D_RELEASE(pBackendDXContext->papRenderTargetView[i]); 5995 } 5730 5996 5731 5997 rc = dxCOTableRealloc((void **)&pBackendDXContext->papRenderTargetView, &pBackendDXContext->cRenderTargetView, 5732 sizeof(pBackendDXContext->papRenderTargetView[0]), pDXContext->cot.cRTView );5998 sizeof(pBackendDXContext->papRenderTargetView[0]), pDXContext->cot.cRTView, cValidEntries); 5733 5999 AssertRCBreak(rc); 5734 6000 … … 5744 6010 case SVGA_COTABLE_DSVIEW: 5745 6011 if (pBackendDXContext->papDepthStencilView) 5746 DX_RELEASE_ARRAY(pBackendDXContext->cDepthStencilView, pBackendDXContext->papDepthStencilView); 6012 { 6013 for (uint32_t i = cValidEntries; i < pBackendDXContext->cDepthStencilView; ++i) 6014 D3D_RELEASE(pBackendDXContext->papDepthStencilView[i]); 6015 } 5747 6016 5748 6017 rc = dxCOTableRealloc((void **)&pBackendDXContext->papDepthStencilView, &pBackendDXContext->cDepthStencilView, 5749 sizeof(pBackendDXContext->papDepthStencilView[0]), pDXContext->cot.cDSView );6018 sizeof(pBackendDXContext->papDepthStencilView[0]), pDXContext->cot.cDSView, cValidEntries); 5750 6019 AssertRCBreak(rc); 5751 6020 … … 5761 6030 case SVGA_COTABLE_SRVIEW: 5762 6031 if (pBackendDXContext->papShaderResourceView) 5763 DX_RELEASE_ARRAY(pBackendDXContext->cShaderResourceView, pBackendDXContext->papShaderResourceView); 6032 { 6033 for (uint32_t i = cValidEntries; i < pBackendDXContext->cShaderResourceView; ++i) 6034 D3D_RELEASE(pBackendDXContext->papShaderResourceView[i]); 6035 } 5764 6036 5765 6037 rc = dxCOTableRealloc((void **)&pBackendDXContext->papShaderResourceView, &pBackendDXContext->cShaderResourceView, 5766 sizeof(pBackendDXContext->papShaderResourceView[0]), pDXContext->cot.cSRView );6038 sizeof(pBackendDXContext->papShaderResourceView[0]), pDXContext->cot.cSRView, cValidEntries); 5767 6039 AssertRCBreak(rc); 5768 6040 … … 5779 6051 if (pBackendDXContext->paElementLayout) 5780 6052 { 5781 for (uint32_t i = 0; i < pBackendDXContext->cElementLayout; ++i)6053 for (uint32_t i = cValidEntries; i < pBackendDXContext->cElementLayout; ++i) 5782 6054 D3D_RELEASE(pBackendDXContext->paElementLayout[i].pElementLayout); 5783 6055 } 5784 6056 5785 6057 rc = dxCOTableRealloc((void **)&pBackendDXContext->paElementLayout, &pBackendDXContext->cElementLayout, 5786 sizeof(pBackendDXContext->paElementLayout[0]), pDXContext->cot.cElementLayout );6058 sizeof(pBackendDXContext->paElementLayout[0]), pDXContext->cot.cElementLayout, cValidEntries); 5787 6059 AssertRCBreak(rc); 5788 6060 … … 5798 6070 case SVGA_COTABLE_BLENDSTATE: 5799 6071 if (pBackendDXContext->papBlendState) 5800 DX_RELEASE_ARRAY(pBackendDXContext->cBlendState, pBackendDXContext->papBlendState); 6072 { 6073 for (uint32_t i = cValidEntries; i < pBackendDXContext->cBlendState; ++i) 6074 D3D_RELEASE(pBackendDXContext->papBlendState[i]); 6075 } 5801 6076 5802 6077 rc = dxCOTableRealloc((void **)&pBackendDXContext->papBlendState, &pBackendDXContext->cBlendState, 5803 sizeof(pBackendDXContext->papBlendState[0]), pDXContext->cot.cBlendState );6078 sizeof(pBackendDXContext->papBlendState[0]), pDXContext->cot.cBlendState, cValidEntries); 5804 6079 AssertRCBreak(rc); 5805 6080 … … 5815 6090 case SVGA_COTABLE_DEPTHSTENCIL: 5816 6091 if (pBackendDXContext->papDepthStencilState) 5817 DX_RELEASE_ARRAY(pBackendDXContext->cDepthStencilState, pBackendDXContext->papDepthStencilState); 6092 { 6093 for (uint32_t i = cValidEntries; i < pBackendDXContext->cDepthStencilState; ++i) 6094 D3D_RELEASE(pBackendDXContext->papDepthStencilState[i]); 6095 } 5818 6096 5819 6097 rc = dxCOTableRealloc((void **)&pBackendDXContext->papDepthStencilState, &pBackendDXContext->cDepthStencilState, 5820 sizeof(pBackendDXContext->papDepthStencilState[0]), pDXContext->cot.cDepthStencil );6098 sizeof(pBackendDXContext->papDepthStencilState[0]), pDXContext->cot.cDepthStencil, cValidEntries); 5821 6099 AssertRCBreak(rc); 5822 6100 … … 5832 6110 case SVGA_COTABLE_RASTERIZERSTATE: 5833 6111 if (pBackendDXContext->papRasterizerState) 5834 DX_RELEASE_ARRAY(pBackendDXContext->cRasterizerState, pBackendDXContext->papRasterizerState); 6112 { 6113 for (uint32_t i = cValidEntries; i < pBackendDXContext->cRasterizerState; ++i) 6114 D3D_RELEASE(pBackendDXContext->papRasterizerState[i]); 6115 } 5835 6116 5836 6117 rc = dxCOTableRealloc((void **)&pBackendDXContext->papRasterizerState, &pBackendDXContext->cRasterizerState, 5837 sizeof(pBackendDXContext->papRasterizerState[0]), pDXContext->cot.cRasterizerState );6118 sizeof(pBackendDXContext->papRasterizerState[0]), pDXContext->cot.cRasterizerState, cValidEntries); 5838 6119 AssertRCBreak(rc); 5839 6120 … … 5849 6130 case SVGA_COTABLE_SAMPLER: 5850 6131 if (pBackendDXContext->papSamplerState) 5851 DX_RELEASE_ARRAY(pBackendDXContext->cSamplerState, pBackendDXContext->papSamplerState); 6132 { 6133 for (uint32_t i = cValidEntries; i < pBackendDXContext->cSamplerState; ++i) 6134 D3D_RELEASE(pBackendDXContext->papSamplerState[i]); 6135 } 5852 6136 5853 6137 rc = dxCOTableRealloc((void **)&pBackendDXContext->papSamplerState, &pBackendDXContext->cSamplerState, 5854 sizeof(pBackendDXContext->papSamplerState[0]), pDXContext->cot.cSampler );6138 sizeof(pBackendDXContext->papSamplerState[0]), pDXContext->cot.cSampler, cValidEntries); 5855 6139 AssertRCBreak(rc); 5856 6140 … … 5865 6149 break; 5866 6150 case SVGA_COTABLE_STREAMOUTPUT: 5867 //AssertFailed(); /** @todo Implement */ 6151 if (pBackendDXContext->paStreamOutput) 6152 { 6153 for (uint32_t i = cValidEntries; i < pBackendDXContext->cStreamOutput; ++i) 6154 dxDestroyStreamOutput(&pBackendDXContext->paStreamOutput[i]); 6155 } 6156 6157 rc = dxCOTableRealloc((void **)&pBackendDXContext->paStreamOutput, &pBackendDXContext->cStreamOutput, 6158 sizeof(pBackendDXContext->paStreamOutput[0]), pDXContext->cot.cStreamOutput, cValidEntries); 6159 AssertRCBreak(rc); 6160 6161 for (uint32_t i = 0; i < cValidEntries; ++i) 6162 { 6163 SVGACOTableDXStreamOutputEntry const *pEntry = &pDXContext->cot.paStreamOutput[i]; 6164 /** @todo The caller must verify the COTable content using same rules as when a new entry is defined. */ 6165 if (ASMMemFirstNonZero(pEntry, sizeof(*pEntry)) == NULL) 6166 continue; /* Skip uninitialized entry. */ 6167 6168 dxDefineStreamOutput(pDXContext, i, pEntry); 6169 } 5868 6170 break; 5869 6171 case SVGA_COTABLE_DXQUERY: 5870 6172 if (pBackendDXContext->papQuery) 5871 DX_RELEASE_ARRAY(pBackendDXContext->cQuery, pBackendDXContext->papQuery); 6173 { 6174 for (uint32_t i = cValidEntries; i < pBackendDXContext->cQuery; ++i) 6175 D3D_RELEASE(pBackendDXContext->papQuery[i]); 6176 } 5872 6177 5873 6178 rc = dxCOTableRealloc((void **)&pBackendDXContext->papQuery, &pBackendDXContext->cQuery, 5874 sizeof(pBackendDXContext->papQuery[0]), pDXContext->cot.cQuery );6179 sizeof(pBackendDXContext->papQuery[0]), pDXContext->cot.cQuery, cValidEntries); 5875 6180 AssertRCBreak(rc); 5876 6181 … … 5887 6192 if (pBackendDXContext->paShader) 5888 6193 { 5889 for (uint32_t i = 0; i < pBackendDXContext->cShader; ++i) 5890 D3D_RELEASE(pBackendDXContext->paShader[i].pShader); 6194 /* Destroy the no longer used entries. */ 6195 for (uint32_t i = cValidEntries; i < pBackendDXContext->cShader; ++i) 6196 dxDestroyShader(&pBackendDXContext->paShader[i]); 5891 6197 } 5892 6198 5893 6199 rc = dxCOTableRealloc((void **)&pBackendDXContext->paShader, &pBackendDXContext->cShader, 5894 sizeof(pBackendDXContext->paShader[0]), pDXContext->cot.cShader );6200 sizeof(pBackendDXContext->paShader[0]), pDXContext->cot.cShader, cValidEntries); 5895 6201 AssertRCBreak(rc); 5896 6202 … … 5902 6208 continue; /* Skip uninitialized entry. */ 5903 6209 5904 /** @todo this should be in the comm dDX code (the caller). */6210 /** @todo this should be in the common DX code (the caller). */ 5905 6211 PVMSVGA3DSHADER pShader = &pDXContext->paShader[i]; 5906 6212 pShader->id = i; -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.cpp
r91362 r91375 1535 1535 } 1536 1536 1537 uint32_t const cBlocksX = (clipBox.w + pSurface->cxBlock - 1) / pSurface->cxBlock; 1538 uint32_t const cBlocksY = (clipBox.h + pSurface->cyBlock - 1) / pSurface->cyBlock; 1539 1537 1540 /** @todo Calculate offSubresource here, when pSurface will have cbArraySlice field. */ 1538 1541 pResult->offSubresource = vmsvga3dCalcSubresourceOffset(pThisCC, pImage); … … 1540 1543 + (clipBox.y / pSurface->cyBlock) * pMipLevel->cbSurfacePitch 1541 1544 + clipBox.z * pMipLevel->cbSurfacePlane; 1542 pResult->cbRow = (clipBox.w / pSurface->cxBlock)* pSurface->cbBlock;1545 pResult->cbRow = cBlocksX * pSurface->cbBlock; 1543 1546 pResult->cbPitch = pMipLevel->cbSurfacePitch; 1544 pResult->cyBlocks = c lipBox.h / pSurface->cyBlock;1547 pResult->cyBlocks = cBlocksY; 1545 1548 pResult->cDepth = clipBox.d; 1546 1549 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h
r91361 r91375 424 424 DECLCALLBACKMEMBER(int, pfnDXReadbackQuery, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 425 425 DECLCALLBACKMEMBER(int, pfnDXSetPredication, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 426 DECLCALLBACKMEMBER(int, pfnDXSetSOTargets, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext ));426 DECLCALLBACKMEMBER(int, pfnDXSetSOTargets, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t cSoTarget, SVGA3dSoTarget const *paSoTarget)); 427 427 DECLCALLBACKMEMBER(int, pfnDXSetViewports, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t cViewport, SVGA3dViewport const *paViewport)); 428 428 DECLCALLBACKMEMBER(int, pfnDXSetScissorRects, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t cRect, SVGASignedRect const *paRect)); … … 450 450 DECLCALLBACKMEMBER(int, pfnDXDestroySamplerState, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 451 451 DECLCALLBACKMEMBER(int, pfnDXDefineShader, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderId shaderId, SVGACOTableDXShaderEntry const *pEntry)); 452 DECLCALLBACKMEMBER(int, pfnDXDestroyShader, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext ));452 DECLCALLBACKMEMBER(int, pfnDXDestroyShader, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderId shaderId)); 453 453 DECLCALLBACKMEMBER(int, pfnDXBindShader, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, PVMSVGA3DSHADER pShader, void const *pvShaderBytecode)); 454 DECLCALLBACKMEMBER(int, pfnDXDefineStreamOutput, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext ));455 DECLCALLBACKMEMBER(int, pfnDXDestroyStreamOutput, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext ));454 DECLCALLBACKMEMBER(int, pfnDXDefineStreamOutput, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dStreamOutputId soid, SVGACOTableDXStreamOutputEntry const *pEntry)); 455 DECLCALLBACKMEMBER(int, pfnDXDestroyStreamOutput, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dStreamOutputId soid)); 456 456 DECLCALLBACKMEMBER(int, pfnDXSetStreamOutput, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext)); 457 457 DECLCALLBACKMEMBER(int, pfnDXSetCOTable, (PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGACOTableType type, uint32_t cValidEntries)); … … 553 553 int vmsvga3dDXReadbackQuery(PVGASTATECC pThisCC, uint32_t idDXContext); 554 554 int vmsvga3dDXSetPredication(PVGASTATECC pThisCC, uint32_t idDXContext); 555 int vmsvga3dDXSetSOTargets(PVGASTATECC pThisCC, uint32_t idDXContext );555 int vmsvga3dDXSetSOTargets(PVGASTATECC pThisCC, uint32_t idDXContext, uint32_t cSoTarget, SVGA3dSoTarget const *paSoTarget); 556 556 int vmsvga3dDXSetViewports(PVGASTATECC pThisCC, uint32_t idDXContext, uint32_t cViewport, SVGA3dViewport const *paViewport); 557 557 int vmsvga3dDXSetScissorRects(PVGASTATECC pThisCC, uint32_t idDXContext, uint32_t cRect, SVGASignedRect const *paRect); … … 579 579 int vmsvga3dDXDestroySamplerState(PVGASTATECC pThisCC, uint32_t idDXContext); 580 580 int vmsvga3dDXDefineShader(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDefineShader const *pCmd); 581 int vmsvga3dDXDestroyShader(PVGASTATECC pThisCC, uint32_t idDXContext );581 int vmsvga3dDXDestroyShader(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyShader const *pCmd); 582 582 int vmsvga3dDXBindShader(PVGASTATECC pThisCC, SVGA3dCmdDXBindShader const *pCmd, PVMSVGAMOB pMob); 583 int vmsvga3dDXDefineStreamOutput(PVGASTATECC pThisCC, uint32_t idDXContext );584 int vmsvga3dDXDestroyStreamOutput(PVGASTATECC pThisCC, uint32_t idDXContext );583 int vmsvga3dDXDefineStreamOutput(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDefineStreamOutput const *pCmd); 584 int vmsvga3dDXDestroyStreamOutput(PVGASTATECC pThisCC, uint32_t idDXContext, SVGA3dCmdDXDestroyStreamOutput const *pCmd); 585 585 int vmsvga3dDXSetStreamOutput(PVGASTATECC pThisCC, uint32_t idDXContext); 586 586 int vmsvga3dDXSetCOTable(PVGASTATECC pThisCC, SVGA3dCmdDXSetCOTable const *pCmd, PVMSVGAMOB pMob);
Note:
See TracChangeset
for help on using the changeset viewer.