Changeset 104813 in vbox for trunk/src/VBox
- Timestamp:
- May 29, 2024 6:39:22 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp
r104812 r104813 311 311 typedef struct VMSVGA3DBACKENDDXCONTEXT 312 312 { 313 DXDEVICE dxDevice; /* DX device interfaces for this context operations. */314 315 313 /* Arrays for Context-Object Tables. Number of entries depends on COTable size. */ 316 314 uint32_t cBlendState; /* Number of entries in the papBlendState array. */ … … 1171 1169 int rc = VINF_SUCCESS; 1172 1170 1173 if (pBackend->dxDevice.pDevice)1174 {1175 pDXDevice->pDevice = pBackend->dxDevice.pDevice;1176 pDXDevice->pDevice->AddRef();1177 1178 pDXDevice->pImmediateContext = pBackend->dxDevice.pImmediateContext;1179 pDXDevice->pImmediateContext->AddRef();1180 1181 pDXDevice->pDxgiFactory = pBackend->dxDevice.pDxgiFactory;1182 pDXDevice->pDxgiFactory->AddRef();1183 1184 pDXDevice->FeatureLevel = pBackend->dxDevice.FeatureLevel;1185 1186 pDXDevice->pVideoDevice = pBackend->dxDevice.pVideoDevice;1187 if (pDXDevice->pVideoDevice)1188 pDXDevice->pVideoDevice->AddRef();1189 1190 pDXDevice->pVideoContext = pBackend->dxDevice.pVideoContext;1191 if (pDXDevice->pVideoContext)1192 pDXDevice->pVideoContext->AddRef();1193 1194 #ifdef DX_COMMON_STAGING_BUFFER1195 pDXDevice->pStagingBuffer = 0;1196 pDXDevice->cbStagingBuffer = 0;1197 #endif1198 1199 BlitInit(&pDXDevice->Blitter, pDXDevice->pDevice, pDXDevice->pImmediateContext);1200 return rc;1201 }1202 1203 1171 IDXGIAdapter *pAdapter = NULL; /* Default adapter. */ 1204 1172 static D3D_FEATURE_LEVEL const s_aFeatureLevels[] = … … 1457 1425 1458 1426 1459 /// @todo Rename, parameters 1460 static DXDEVICE *dxDeviceFromCid(uint32_t cid, PVMSVGA3DSTATE pState) 1461 { 1462 RT_NOREF(cid); 1463 return &pState->pBackend->dxDevice; 1464 } 1465 1466 1467 /// @todo Rename, parameters 1468 static DXDEVICE *dxDeviceFromContext(PVMSVGA3DSTATE p3dState, VMSVGA3DDXCONTEXT *pDXContext) 1469 { 1470 RT_NOREF(pDXContext); 1427 static DXDEVICE *dxDeviceGet(PVMSVGA3DSTATE p3dState) 1428 { 1471 1429 DXDEVICE *pDXDevice = &p3dState->pBackend->dxDevice; 1472 1430 #ifdef DEBUG … … 1502 1460 1503 1461 1504 /// @todo Parameters 1505 static ID3D11Resource *dxResource(PVMSVGA3DSTATE pState, PVMSVGA3DSURFACE pSurface, VMSVGA3DDXCONTEXT *pDXContext) 1506 { 1507 RT_NOREF(pState, pDXContext); 1462 static ID3D11Resource *dxResource(PVMSVGA3DSURFACE pSurface) 1463 { 1508 1464 VMSVGA3DBACKENDSURFACE *pBackendSurface = pSurface->pBackendSurface; 1509 1465 if (!pBackendSurface) 1510 1466 AssertFailedReturn(NULL); 1511 1512 1467 return pBackendSurface->u.pResource; 1513 1468 } … … 1851 1806 1852 1807 1853 static HRESULT dxRenderTargetViewCreate(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext,SVGACOTableDXRTViewEntry const *pEntry, VMSVGA3DSURFACE *pSurface, ID3D11RenderTargetView **pp)1854 { 1855 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);1856 1857 ID3D11Resource *pResource = dxResource(p ThisCC->svga.p3dState, pSurface, pDXContext);1808 static HRESULT dxRenderTargetViewCreate(PVGASTATECC pThisCC, SVGACOTableDXRTViewEntry const *pEntry, VMSVGA3DSURFACE *pSurface, ID3D11RenderTargetView **pp) 1809 { 1810 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 1811 1812 ID3D11Resource *pResource = dxResource(pSurface); 1858 1813 1859 1814 D3D11_RENDER_TARGET_VIEW_DESC desc; … … 1928 1883 1929 1884 1930 static HRESULT dxShaderResourceViewCreate(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext,SVGACOTableDXSRViewEntry const *pEntry, VMSVGA3DSURFACE *pSurface, ID3D11ShaderResourceView **pp)1931 { 1932 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);1933 1934 ID3D11Resource *pResource = dxResource(p ThisCC->svga.p3dState, pSurface, pDXContext);1885 static HRESULT dxShaderResourceViewCreate(PVGASTATECC pThisCC, SVGACOTableDXSRViewEntry const *pEntry, VMSVGA3DSURFACE *pSurface, ID3D11ShaderResourceView **pp) 1886 { 1887 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 1888 1889 ID3D11Resource *pResource = dxResource(pSurface); 1935 1890 1936 1891 D3D11_SHADER_RESOURCE_VIEW_DESC desc; … … 2020 1975 2021 1976 2022 static HRESULT dxUnorderedAccessViewCreate(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext,SVGACOTableDXUAViewEntry const *pEntry, VMSVGA3DSURFACE *pSurface, ID3D11UnorderedAccessView **pp)2023 { 2024 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);2025 2026 ID3D11Resource *pResource = dxResource(p ThisCC->svga.p3dState, pSurface, pDXContext);1977 static HRESULT dxUnorderedAccessViewCreate(PVGASTATECC pThisCC, SVGACOTableDXUAViewEntry const *pEntry, VMSVGA3DSURFACE *pSurface, ID3D11UnorderedAccessView **pp) 1978 { 1979 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 1980 1981 ID3D11Resource *pResource = dxResource(pSurface); 2027 1982 2028 1983 D3D11_UNORDERED_ACCESS_VIEW_DESC desc; … … 2082 2037 2083 2038 2084 static HRESULT dxDepthStencilViewCreate(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext,SVGACOTableDXDSViewEntry const *pEntry, VMSVGA3DSURFACE *pSurface, ID3D11DepthStencilView **pp)2085 { 2086 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);2087 2088 ID3D11Resource *pResource = dxResource(p ThisCC->svga.p3dState, pSurface, pDXContext);2039 static HRESULT dxDepthStencilViewCreate(PVGASTATECC pThisCC, SVGACOTableDXDSViewEntry const *pEntry, VMSVGA3DSURFACE *pSurface, ID3D11DepthStencilView **pp) 2040 { 2041 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 2042 2043 ID3D11Resource *pResource = dxResource(pSurface); 2089 2044 2090 2045 D3D11_DEPTH_STENCIL_VIEW_DESC desc; … … 2139 2094 static HRESULT dxShaderCreate(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, DXSHADER *pDXShader) 2140 2095 { 2141 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);2096 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 2142 2097 2143 2098 HRESULT hr = S_OK; … … 2201 2156 static void dxShaderSet(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderType type, DXSHADER *pDXShader) 2202 2157 { 2203 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);2158 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 2204 2159 2205 2160 switch (type) … … 2214 2169 { 2215 2170 Assert(!pDXShader || (pDXShader->soid == pDXContext->svgaDXContext.streamOut.soid)); 2171 RT_NOREF(pDXContext); 2216 2172 pDevice->pImmediateContext->GSSetShader(pDXShader ? pDXShader->pGeometryShader : NULL, NULL, 0); 2217 2173 } break; … … 2351 2307 2352 2308 return BindFlags; 2353 }2354 2355 2356 /// @todo Parameters2357 static DXDEVICE *dxSurfaceDevice(PVMSVGA3DSTATE p3dState, PVMSVGA3DSURFACE pSurface, PVMSVGA3DDXCONTEXT pDXContext, UINT *pMiscFlags)2358 {2359 RT_NOREF(pSurface, pDXContext);2360 *pMiscFlags = 0;2361 return &p3dState->pBackend->dxDevice;2362 2309 } 2363 2310 … … 2482 2429 2483 2430 2484 static int vmsvga3dBackSurfaceCreateTexture(PVGASTATECC pThisCC, PVMSVGA3D DXCONTEXT pDXContext, PVMSVGA3DSURFACE pSurface)2431 static int vmsvga3dBackSurfaceCreateTexture(PVGASTATECC pThisCC, PVMSVGA3DSURFACE pSurface) 2485 2432 { 2486 2433 PVMSVGA3DSTATE p3dState = pThisCC->svga.p3dState; … … 2490 2437 AssertReturn(pBackend, VERR_INVALID_STATE); 2491 2438 2492 UINT MiscFlags ;2493 DXDEVICE *pDXDevice = dxSurfaceDevice(p3dState, pSurface, pDXContext, &MiscFlags);2439 UINT MiscFlags = 0; 2440 DXDEVICE *pDXDevice = &p3dState->pBackend->dxDevice; 2494 2441 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 2495 2442 … … 2825 2772 static int vmsvga3dBackSurfaceCreateBuffer(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, PVMSVGA3DSURFACE pSurface) 2826 2773 { 2827 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);2774 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 2828 2775 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 2829 2776 … … 2915 2862 #endif 2916 2863 2917 static int vmsvga3dBackSurfaceCreateSoBuffer(PVGASTATECC pThisCC, PVMSVGA3D DXCONTEXT pDXContext, PVMSVGA3DSURFACE pSurface)2918 { 2919 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);2864 static int vmsvga3dBackSurfaceCreateSoBuffer(PVGASTATECC pThisCC, PVMSVGA3DSURFACE pSurface) 2865 { 2866 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 2920 2867 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 2921 2868 … … 2989 2936 static int vmsvga3dBackSurfaceCreateConstantBuffer(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, PVMSVGA3DSURFACE pSurface, uint32_t offsetInBytes, uint32_t sizeInBytes) 2990 2937 { 2991 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);2938 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 2992 2939 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 2993 2940 … … 3054 3001 #endif 3055 3002 3056 static int vmsvga3dBackSurfaceCreateResource(PVGASTATECC pThisCC, PVMSVGA3D DXCONTEXT pDXContext, PVMSVGA3DSURFACE pSurface)3057 { 3058 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);3003 static int vmsvga3dBackSurfaceCreateResource(PVGASTATECC pThisCC, PVMSVGA3DSURFACE pSurface) 3004 { 3005 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 3059 3006 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 3060 3007 … … 3195 3142 3196 3143 3197 static int dxEnsureResource(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext,uint32_t sid,3144 static int dxEnsureResource(PVGASTATECC pThisCC, uint32_t sid, 3198 3145 PVMSVGA3DSURFACE *ppSurface, ID3D11Resource **ppResource) 3199 3146 { … … 3208 3155 /** @todo One function to create all resources from surfaces. */ 3209 3156 if (pSurface->format != SVGA3D_BUFFER) 3210 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, p DXContext, pSurface);3157 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pSurface); 3211 3158 else 3212 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, p DXContext, pSurface);3159 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pSurface); 3213 3160 3214 3161 AssertRCReturn(rc, rc); … … 3216 3163 } 3217 3164 3218 ID3D11Resource *pResource = dxResource(p ThisCC->svga.p3dState, pSurface, pDXContext);3165 ID3D11Resource *pResource = dxResource(pSurface); 3219 3166 AssertReturn(pResource, VERR_INVALID_STATE); 3220 3167 … … 3612 3559 ASSERT_GUEST_RETURN(RT_SUCCESS(rc), rc); 3613 3560 3614 /* A surface is always mapped by the DX context which has created the surface. */ 3615 DXDEVICE *pDevice = dxDeviceFromCid(pSurface->idAssociatedContext, pState); 3616 AssertReturn(pDevice && pDevice->pDevice, VERR_INVALID_STATE); 3561 DXDEVICE *pDevice = &pBackend->dxDevice; 3562 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 3617 3563 3618 3564 SVGA3dBox clipBox; … … 3807 3753 ASSERT_GUEST_RETURN(RT_SUCCESS(rc), rc); 3808 3754 3809 /* A surface is always mapped by the DX context which has created the surface. */ 3810 DXDEVICE *pDevice = dxDeviceFromCid(pSurface->idAssociatedContext, pState); 3811 AssertReturn(pDevice && pDevice->pDevice, VERR_INVALID_STATE); 3755 DXDEVICE *pDevice = &pBackend->dxDevice; 3756 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 3812 3757 3813 3758 if ( pBackendSurface->enmResType == VMSVGA3D_RESTYPE_TEXTURE_1D … … 3971 3916 { 3972 3917 /* Create the actual texture. */ 3973 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, NULL,pSurface);3918 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pSurface); 3974 3919 AssertRCReturn(rc, rc); 3975 3920 } … … 4656 4601 pDstSurface->pBackendSurface ? "" : " sysmem", pDstSurface->id)); 4657 4602 4658 //DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);4603 //DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 4659 4604 //AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 4660 4605 … … 4663 4608 if (pDstSurface->pBackendSurface == NULL) 4664 4609 { 4665 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, NULL,pDstSurface);4610 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pDstSurface); 4666 4611 AssertRCReturn(rc, rc); 4667 4612 } … … 4702 4647 ID3D11Resource *pDstResource; 4703 4648 ID3D11Resource *pSrcResource; 4704 pDstResource = dxResource(p State, pDstSurface, NULL);4705 pSrcResource = dxResource( pState, pSrcSurface, NULL);4649 pDstResource = dxResource(pDstSurface); 4650 pSrcResource = dxResource( pSrcSurface); 4706 4651 4707 4652 pDXDevice->pImmediateContext->CopySubresourceRegion(pDstResource, DstSubresource, DstX, DstY, DstZ, … … 5388 5333 static DECLCALLBACK(int) vmsvga3dBackDXDefineContext(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext) 5389 5334 { 5390 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend;5335 RT_NOREF(pThisCC); 5391 5336 5392 5337 /* Allocate a backend specific context structure. */ … … 5396 5341 5397 5342 LogFunc(("cid %d\n", pDXContext->cid)); 5398 5399 int rc = dxDeviceCreate(pBackend, &pBackendDXContext->dxDevice); 5400 return rc; 5343 return VINF_SUCCESS; 5401 5344 } 5402 5345 … … 5410 5353 if (pDXContext->pBackendDXContext) 5411 5354 { 5355 /* Make sure that any pending draw calls are finished. */ 5356 dxDeviceFlush(&pBackend->dxDevice); 5357 5412 5358 /* Clean up context resources. */ 5413 5359 VMSVGA3DBACKENDDXCONTEXT *pBackendDXContext = pDXContext->pBackendDXContext; … … 5418 5364 D3D_RELEASE_ARRAY(RT_ELEMENTS(pBackendDXContext->resources.shaderState[idxShaderState].constantBuffers), papConstantBuffer); 5419 5365 } 5420 5421 if (pBackendDXContext->dxDevice.pImmediateContext)5422 dxDeviceFlush(&pBackendDXContext->dxDevice); /* Make sure that any pending draw calls are finished. */5423 5366 5424 5367 if (pBackendDXContext->paRenderTargetView) … … 5515 5458 RTMemFreeZ(pBackendDXContext->paVideoProcessorOutputView, sizeof(pBackendDXContext->paVideoProcessorOutputView[0]) * pBackendDXContext->cVideoProcessorOutputView); 5516 5459 5517 dxDeviceDestroy(pBackend, &pBackendDXContext->dxDevice);5518 5519 5460 RTMemFreeZ(pBackendDXContext, sizeof(*pBackendDXContext)); 5520 5461 pDXContext->pBackendDXContext = NULL; … … 5563 5504 RT_NOREF(pBackend); 5564 5505 5565 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);5506 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 5566 5507 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 5567 5508 … … 5638 5579 static int dxSetShaderResources(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderType type) 5639 5580 { 5640 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);5581 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 5641 5582 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 5642 5583 … … 5677 5618 { 5678 5619 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 5679 RT_NOREF(pBackend );5680 5681 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);5620 RT_NOREF(pBackend, pDXContext); 5621 5622 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 5682 5623 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 5683 5624 … … 5693 5634 RT_NOREF(pBackend); 5694 5635 5695 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);5636 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 5696 5637 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 5697 5638 … … 5938 5879 static void dxCreateInputLayout(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dElementLayoutId elementLayoutId, DXSHADER *pDXShader) 5939 5880 { 5940 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);5881 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 5941 5882 AssertReturnVoid(pDevice->pDevice); 5942 5883 … … 5985 5926 //DEBUG_BREAKPOINT_TEST(); 5986 5927 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 5987 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);5928 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 5988 5929 VMSVGA3DBACKENDDXCONTEXT *pBackendDXContext = pDXContext->pBackendDXContext; 5989 5930 … … 6053 5994 PVMSVGA3DSURFACE pSurface; 6054 5995 ID3D11Resource *pResource; 6055 int rc = dxEnsureResource(pThisCC, p DXContext, pBufferPipeline->bufferId, &pSurface, &pResource);5996 int rc = dxEnsureResource(pThisCC, pBufferPipeline->bufferId, &pSurface, &pResource); 6056 5997 if ( RT_SUCCESS(rc) 6057 5998 && pSurface->pBackendSurface->enmResType == VMSVGA3D_RESTYPE_BUFFER) … … 6075 6016 } 6076 6017 6077 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);6018 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 6078 6019 LogFunc(("idxMinSlot = %d, idxMaxSlot = %d\n", idxMinSlot, idxMaxSlot)); 6079 6020 if (idxMaxSlot >= 0) … … 6114 6055 PVMSVGA3DSURFACE pSurface; 6115 6056 ID3D11Resource *pResource; 6116 int rc = dxEnsureResource(pThisCC, p DXContext, pPipelineState->inputAssembly.indexBufferSid, &pSurface, &pResource);6057 int rc = dxEnsureResource(pThisCC, pPipelineState->inputAssembly.indexBufferSid, &pSurface, &pResource); 6117 6058 if ( RT_SUCCESS(rc) 6118 6059 && pSurface->pBackendSurface->enmResType == VMSVGA3D_RESTYPE_BUFFER) … … 6136 6077 } 6137 6078 6138 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);6079 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 6139 6080 pDXDevice->pImmediateContext->IASetIndexBuffer(pBuffer, enmDxgiFormat, Offset); 6140 6081 } … … 6369 6310 static void dxDbgDumpIndexedVertexData(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t indexCount, uint32_t startIndexLocation, int32_t baseVertexLocation) 6370 6311 { 6371 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);6312 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 6372 6313 6373 6314 uint32_t const indexBufferSid = pDXContext->svgaDXContext.inputAssembly.indexBufferSid; … … 6560 6501 PVMSVGA3DSURFACE pSurface; 6561 6502 ID3D11Resource *pResource; 6562 int rc = dxEnsureResource(pThisCC, p DXContext, pEntry->sid, &pSurface, &pResource);6503 int rc = dxEnsureResource(pThisCC, pEntry->sid, &pSurface, &pResource); 6563 6504 AssertRCReturn(rc, rc); 6564 6505 … … 6567 6508 6568 6509 ID3D11RenderTargetView *pRenderTargetView; 6569 HRESULT hr = dxRenderTargetViewCreate(pThisCC, p DXContext, pEntry, pSurface, &pRenderTargetView);6510 HRESULT hr = dxRenderTargetViewCreate(pThisCC, pEntry, pSurface, &pRenderTargetView); 6570 6511 AssertReturn(SUCCEEDED(hr), VERR_INVALID_STATE); 6571 6512 … … 6594 6535 PVMSVGA3DSURFACE pSurface; 6595 6536 ID3D11Resource *pResource; 6596 int rc = dxEnsureResource(pThisCC, p DXContext, pEntry->sid, &pSurface, &pResource);6537 int rc = dxEnsureResource(pThisCC, pEntry->sid, &pSurface, &pResource); 6597 6538 AssertRCReturn(rc, rc); 6598 6539 … … 6601 6542 6602 6543 ID3D11DepthStencilView *pDepthStencilView; 6603 HRESULT hr = dxDepthStencilViewCreate(pThisCC, p DXContext, pEntry, pSurface, &pDepthStencilView);6544 HRESULT hr = dxDepthStencilViewCreate(pThisCC, pEntry, pSurface, &pDepthStencilView); 6604 6545 AssertReturn(SUCCEEDED(hr), VERR_INVALID_STATE); 6605 6546 … … 6628 6569 PVMSVGA3DSURFACE pSurface; 6629 6570 ID3D11Resource *pResource; 6630 int rc = dxEnsureResource(pThisCC, p DXContext, pEntry->sid, &pSurface, &pResource);6571 int rc = dxEnsureResource(pThisCC, pEntry->sid, &pSurface, &pResource); 6631 6572 AssertRCReturn(rc, rc); 6632 6573 … … 6635 6576 6636 6577 ID3D11ShaderResourceView *pShaderResourceView; 6637 HRESULT hr = dxShaderResourceViewCreate(pThisCC, p DXContext, pEntry, pSurface, &pShaderResourceView);6578 HRESULT hr = dxShaderResourceViewCreate(pThisCC, pEntry, pSurface, &pShaderResourceView); 6638 6579 AssertReturn(SUCCEEDED(hr), VERR_INVALID_STATE); 6639 6580 … … 6662 6603 PVMSVGA3DSURFACE pSurface; 6663 6604 ID3D11Resource *pResource; 6664 int rc = dxEnsureResource(pThisCC, p DXContext, pEntry->sid, &pSurface, &pResource);6605 int rc = dxEnsureResource(pThisCC, pEntry->sid, &pSurface, &pResource); 6665 6606 AssertRCReturn(rc, rc); 6666 6607 … … 6669 6610 6670 6611 ID3D11UnorderedAccessView *pUnorderedAccessView; 6671 HRESULT hr = dxUnorderedAccessViewCreate(pThisCC, p DXContext, pEntry, pSurface, &pUnorderedAccessView);6612 HRESULT hr = dxUnorderedAccessViewCreate(pThisCC, pEntry, pSurface, &pUnorderedAccessView); 6672 6613 AssertReturn(SUCCEEDED(hr), VERR_INVALID_STATE); 6673 6614 … … 6701 6642 6702 6643 /* Unbind render target views because they mught be (re-)used as shader resource views. */ 6703 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);6644 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 6704 6645 pDXDevice->pImmediateContext->OMSetRenderTargetsAndUnorderedAccessViews(0, NULL, NULL, 0, 0, NULL, NULL); 6705 6646 for (unsigned i = 0; i < SVGA3D_DX11_1_MAX_UAVIEWS; ++i) … … 6787 6728 */ 6788 6729 6789 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);6730 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 6790 6731 AssertReturnVoid(pDevice->pDevice); 6791 6732 … … 7016 6957 RT_NOREF(pBackend); 7017 6958 7018 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);6959 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7019 6960 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7020 6961 … … 7336 7277 RT_NOREF(pBackend); 7337 7278 7338 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7279 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7339 7280 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7340 7281 … … 7367 7308 RT_NOREF(pBackend); 7368 7309 7369 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7310 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7370 7311 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7371 7312 … … 7395 7336 RT_NOREF(pBackend); 7396 7337 7397 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7338 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7398 7339 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7399 7340 … … 7422 7363 RT_NOREF(pBackend); 7423 7364 7424 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7365 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7425 7366 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7426 7367 … … 7442 7383 { 7443 7384 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 7444 RT_NOREF(pBackend );7445 7446 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7385 RT_NOREF(pBackend, pDXContext); 7386 7387 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7447 7388 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7448 7389 … … 7524 7465 { 7525 7466 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 7526 RT_NOREF(pBackend );7527 7528 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7467 RT_NOREF(pBackend, pDXContext); 7468 7469 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7529 7470 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7530 7471 … … 7537 7478 static int dxSetRenderTargets(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext) 7538 7479 { 7539 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7480 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7540 7481 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7541 7482 … … 7600 7541 { 7601 7542 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 7602 RT_NOREF(pBackend );7603 7604 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7543 RT_NOREF(pBackend, pDXContext); 7544 7545 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7605 7546 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7606 7547 … … 7616 7557 RT_NOREF(pBackend); 7617 7558 7618 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7559 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7619 7560 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7620 7561 … … 7636 7577 RT_NOREF(pBackend); 7637 7578 7638 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7579 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7639 7580 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7640 7581 … … 7654 7595 { 7655 7596 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 7656 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7597 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7657 7598 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7658 7599 … … 7723 7664 static int dxDefineQuery(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dQueryId queryId, SVGACOTableDXQueryEntry const *pEntry) 7724 7665 { 7725 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7666 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 7726 7667 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 7727 7668 … … 7775 7716 static int dxBeginQuery(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dQueryId queryId, DXQUERY *pDXQuery) 7776 7717 { 7777 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7718 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 7778 7719 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 7779 7720 … … 7802 7743 SVGADXQueryResultUnion *pQueryResult, uint32_t *pcbOut) 7803 7744 { 7804 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7745 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 7805 7746 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 7806 7747 … … 7884 7825 SVGADXQueryResultUnion *pQueryResult, uint32_t *pcbOut) 7885 7826 { 7886 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7827 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 7887 7828 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 7888 7829 … … 7911 7852 RT_NOREF(pBackend); 7912 7853 7913 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7854 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 7914 7855 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 7915 7856 … … 7949 7890 RT_NOREF(pBackend); 7950 7891 7951 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7892 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 7952 7893 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 7953 7894 … … 7974 7915 { 7975 7916 /* Create the resource. */ 7976 rc = vmsvga3dBackSurfaceCreateSoBuffer(pThisCC, p DXContext, pSurface);7917 rc = vmsvga3dBackSurfaceCreateSoBuffer(pThisCC, pSurface); 7977 7918 AssertRCReturn(rc, rc); 7978 7919 } … … 8000 7941 { 8001 7942 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 8002 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7943 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8003 7944 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8004 7945 8005 RT_NOREF(pBackend );7946 RT_NOREF(pBackend, pDXContext); 8006 7947 8007 7948 /* D3D11_VIEWPORT is identical to SVGA3dViewport. */ … … 8016 7957 { 8017 7958 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 8018 RT_NOREF(pBackend );8019 8020 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7959 RT_NOREF(pBackend, pDXContext); 7960 7961 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8021 7962 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8022 7963 … … 8031 7972 static DECLCALLBACK(int) vmsvga3dBackDXClearRenderTargetView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dRenderTargetViewId renderTargetViewId, SVGA3dRGBAFloat const *pRGBA) 8032 7973 { 8033 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7974 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 8034 7975 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 8035 7976 … … 8046 7987 SVGA3dRGBAFloat const *pColor, uint32_t cRect, SVGASignedRect const *paRect) 8047 7988 { 8048 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);7989 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 8049 7990 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 8050 7991 … … 8060 8001 static DECLCALLBACK(int) vmsvga3dBackDXClearDepthStencilView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, uint32_t flags, SVGA3dDepthStencilViewId depthStencilViewId, float depth, uint8_t stencil) 8061 8002 { 8062 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);8003 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8063 8004 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8064 8005 … … 8081 8022 { 8082 8023 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 8083 RT_NOREF(pBackend );8084 8085 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);8024 RT_NOREF(pBackend, pDXContext); 8025 8026 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8086 8027 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8087 8028 … … 8098 8039 /* Create the resource. */ 8099 8040 if (pSrcSurface->format != SVGA3D_BUFFER) 8100 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, p DXContext, pSrcSurface);8041 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pSrcSurface); 8101 8042 else 8102 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, p DXContext, pSrcSurface);8043 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pSrcSurface); 8103 8044 AssertRCReturn(rc, rc); 8104 8045 } … … 8108 8049 /* Create the resource. */ 8109 8050 if (pSrcSurface->format != SVGA3D_BUFFER) 8110 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pD XContext, pDstSurface);8051 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pDstSurface); 8111 8052 else 8112 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pD XContext, pDstSurface);8053 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pDstSurface); 8113 8054 AssertRCReturn(rc, rc); 8114 8055 } … … 8156 8097 ID3D11Resource *pSrcResource; 8157 8098 8158 pDstResource = dxResource(p ThisCC->svga.p3dState, pDstSurface, pDXContext);8159 pSrcResource = dxResource(p ThisCC->svga.p3dState, pSrcSurface, pDXContext);8099 pDstResource = dxResource(pDstSurface); 8100 pSrcResource = dxResource(pSrcSurface); 8160 8101 8161 8102 pDevice->pImmediateContext->CopySubresourceRegion(pDstResource, DstSubresource, DstX, DstY, DstZ, … … 8185 8126 { 8186 8127 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 8187 RT_NOREF(pBackend );8188 8189 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);8128 RT_NOREF(pBackend, pDXContext); 8129 8130 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8190 8131 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8191 8132 … … 8202 8143 /* Create the resource. */ 8203 8144 if (pSrcSurface->format != SVGA3D_BUFFER) 8204 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, p DXContext, pSrcSurface);8145 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pSrcSurface); 8205 8146 else 8206 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, p DXContext, pSrcSurface);8147 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pSrcSurface); 8207 8148 AssertRCReturn(rc, rc); 8208 8149 } … … 8212 8153 /* Create the resource. */ 8213 8154 if (pSrcSurface->format != SVGA3D_BUFFER) 8214 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pD XContext, pDstSurface);8155 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pDstSurface); 8215 8156 else 8216 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pD XContext, pDstSurface);8157 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pDstSurface); 8217 8158 AssertRCReturn(rc, rc); 8218 8159 } … … 8222 8163 (pDstSurface->f.surfaceFlags & SVGA3D_SURFACE_SCREENTARGET) ? " st" : "", pDstSurface->id)); 8223 8164 8224 ID3D11Resource *pDstResource = dxResource(p ThisCC->svga.p3dState, pDstSurface, pDXContext);8225 ID3D11Resource *pSrcResource = dxResource(p ThisCC->svga.p3dState, pSrcSurface, pDXContext);8165 ID3D11Resource *pDstResource = dxResource(pDstSurface); 8166 ID3D11Resource *pSrcResource = dxResource(pSrcSurface); 8226 8167 8227 8168 pDevice->pImmediateContext->CopyResource(pDstResource, pSrcResource); … … 8483 8424 SVGA3dDXPresentBltMode mode) 8484 8425 { 8485 RT_NOREF( mode);8426 RT_NOREF(pDXContext, mode); 8486 8427 8487 8428 ASSERT_GUEST_RETURN(pBoxDst->z == 0 && pBoxDst->d == 1, VERR_INVALID_PARAMETER); … … 8491 8432 RT_NOREF(pBackend); 8492 8433 8493 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);8434 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8494 8435 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8495 8436 … … 8506 8447 /* Create the resource. */ 8507 8448 if (pSrcSurface->format != SVGA3D_BUFFER) 8508 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, p DXContext, pSrcSurface);8449 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pSrcSurface); 8509 8450 else 8510 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, p DXContext, pSrcSurface);8451 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pSrcSurface); 8511 8452 AssertRCReturn(rc, rc); 8512 8453 } … … 8516 8457 /* Create the resource. */ 8517 8458 if (pSrcSurface->format != SVGA3D_BUFFER) 8518 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pD XContext, pDstSurface);8459 rc = vmsvga3dBackSurfaceCreateTexture(pThisCC, pDstSurface); 8519 8460 else 8520 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pD XContext, pDstSurface);8461 rc = vmsvga3dBackSurfaceCreateResource(pThisCC, pDstSurface); 8521 8462 AssertRCReturn(rc, rc); 8522 8463 } … … 8555 8496 vmsvgaR3ClipBox(&pDstMipLevel->mipmapSize, &clipBoxDst); 8556 8497 8557 ID3D11Resource *pDstResource = dxResource(p ThisCC->svga.p3dState, pDstSurface, pDXContext);8558 ID3D11Resource *pSrcResource = dxResource(p ThisCC->svga.p3dState, pSrcSurface, pDXContext);8498 ID3D11Resource *pDstResource = dxResource(pDstSurface); 8499 ID3D11Resource *pSrcResource = dxResource(pSrcSurface); 8559 8500 8560 8501 D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; … … 8597 8538 static DECLCALLBACK(int) vmsvga3dBackDXGenMips(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dShaderResourceViewId shaderResourceViewId) 8598 8539 { 8599 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);8540 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 8600 8541 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 8601 8542 … … 8688 8629 { 8689 8630 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 8690 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);8631 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8691 8632 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8692 8633 … … 8719 8660 SVGA3dBlendStateId blendId, SVGACOTableDXBlendStateEntry const *pEntry) 8720 8661 { 8721 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);8662 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8722 8663 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8723 8664 … … 8751 8692 static int dxDefineDepthStencilState(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dDepthStencilStateId depthStencilId, SVGACOTableDXDepthStencilEntry const *pEntry) 8752 8693 { 8753 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);8694 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8754 8695 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8755 8696 … … 8782 8723 static int dxDefineRasterizerState(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dRasterizerStateId rasterizerId, SVGACOTableDXRasterizerStateEntry const *pEntry) 8783 8724 { 8784 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);8725 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8785 8726 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8786 8727 … … 8813 8754 static int dxDefineSamplerState(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dSamplerId samplerId, SVGACOTableDXSamplerEntry const *pEntry) 8814 8755 { 8815 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);8756 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8816 8757 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8817 8758 … … 8894 8835 { 8895 8836 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 8896 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);8837 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 8897 8838 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 8898 8839 … … 9568 9509 ID3D11Resource *pDstResource; 9569 9510 ID3D11Resource *pSrcResource; 9570 pDstResource = dxResource(pS tate, pSurface, NULL);9511 pDstResource = dxResource(pSurface); 9571 9512 pSrcResource = pDstResource; 9572 9513 … … 9616 9557 SVGA3dSurfaceId srcSid, uint32_t srcSubResource, SVGA3dSurfaceFormat copyFormat) 9617 9558 { 9618 DXDEVICE *pDXDevice = dxDeviceFromContext(pThisCC->svga.p3dState, pDXContext); 9559 RT_NOREF(pDXContext); 9560 9561 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 9619 9562 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 9620 9563 9621 9564 PVMSVGA3DSURFACE pSrcSurface; 9622 9565 ID3D11Resource *pSrcResource; 9623 int rc = dxEnsureResource(pThisCC, pDXContext,srcSid, &pSrcSurface, &pSrcResource);9566 int rc = dxEnsureResource(pThisCC, srcSid, &pSrcSurface, &pSrcResource); 9624 9567 AssertRCReturn(rc, rc); 9625 9568 9626 9569 PVMSVGA3DSURFACE pDstSurface; 9627 9570 ID3D11Resource *pDstResource; 9628 rc = dxEnsureResource(pThisCC, pDXContext,dstSid, &pDstSurface, &pDstResource);9571 rc = dxEnsureResource(pThisCC, dstSid, &pDstSurface, &pDstResource); 9629 9572 AssertRCReturn(rc, rc); 9630 9573 … … 9698 9641 static DECLCALLBACK(int) vmsvga3dBackDXClearUAViewUint(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dUAViewId uaViewId, uint32_t const aValues[4]) 9699 9642 { 9700 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);9643 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 9701 9644 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 9702 9645 … … 9712 9655 static DECLCALLBACK(int) vmsvga3dBackDXClearUAViewFloat(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dUAViewId uaViewId, float const aValues[4]) 9713 9656 { 9714 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);9657 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 9715 9658 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 9716 9659 … … 9726 9669 static DECLCALLBACK(int) vmsvga3dBackDXCopyStructureCount(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, SVGA3dUAViewId srcUAViewId, SVGA3dSurfaceId destSid, uint32_t destByteOffset) 9727 9670 { 9728 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);9671 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 9729 9672 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 9730 9673 … … 9735 9678 PVMSVGA3DSURFACE pSurface; 9736 9679 ID3D11Resource *pResource; 9737 int rc = dxEnsureResource(pThisCC, pDXContext,destSid, &pSurface, &pResource);9680 int rc = dxEnsureResource(pThisCC, destSid, &pSurface, &pResource); 9738 9681 AssertRCReturn(rc, rc); 9739 9682 AssertReturn(pSurface->pBackendSurface->enmResType == VMSVGA3D_RESTYPE_BUFFER, VERR_INVALID_STATE); … … 9772 9715 RT_NOREF(pBackend); 9773 9716 9774 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);9717 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 9775 9718 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 9776 9719 … … 9781 9724 PVMSVGA3DSURFACE pSurface; 9782 9725 ID3D11Resource *pResource; 9783 int rc = dxEnsureResource(pThisCC, pDXContext,argsBufferSid, &pSurface, &pResource);9726 int rc = dxEnsureResource(pThisCC, argsBufferSid, &pSurface, &pResource); 9784 9727 AssertRCReturn(rc, rc); 9785 9728 AssertReturn(pSurface->pBackendSurface->enmResType == VMSVGA3D_RESTYPE_BUFFER, VERR_INVALID_STATE); … … 9809 9752 RT_NOREF(pBackend); 9810 9753 9811 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);9754 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 9812 9755 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 9813 9756 … … 9818 9761 PVMSVGA3DSURFACE pSurface; 9819 9762 ID3D11Resource *pResource; 9820 int rc = dxEnsureResource(pThisCC, pDXContext,argsBufferSid, &pSurface, &pResource);9763 int rc = dxEnsureResource(pThisCC, argsBufferSid, &pSurface, &pResource); 9821 9764 AssertRCReturn(rc, rc); 9822 9765 AssertReturn(pSurface->pBackendSurface->enmResType == VMSVGA3D_RESTYPE_BUFFER, VERR_INVALID_STATE); … … 9846 9789 RT_NOREF(pBackend); 9847 9790 9848 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);9791 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 9849 9792 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 9850 9793 … … 9963 9906 static int dxSetCSUnorderedAccessViews(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext) 9964 9907 { 9965 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);9908 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 9966 9909 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 9967 9910 … … 9997 9940 { 9998 9941 PVMSVGA3DBACKEND pBackend = pThisCC->svga.p3dState->pBackend; 9999 RT_NOREF(pBackend );10000 10001 DXDEVICE *pDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);9942 RT_NOREF(pBackend, pDXContext); 9943 9944 DXDEVICE *pDevice = dxDeviceGet(pThisCC->svga.p3dState); 10002 9945 AssertReturn(pDevice->pDevice, VERR_INVALID_STATE); 10003 9946 … … 10352 10295 static int dxCreateVideoDecoderOutputView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoDecoderOutputViewId videoDecoderOutputViewId, VBSVGACOTableDXVideoDecoderOutputViewEntry const *pEntry) 10353 10296 { 10354 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10297 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 10355 10298 AssertReturn(pDXDevice->pVideoDevice, VERR_INVALID_STATE); 10356 10299 10357 10300 PVMSVGA3DSURFACE pSurface; 10358 10301 ID3D11Resource *pResource; 10359 int rc = dxEnsureResource(pThisCC, p DXContext, pEntry->sid, &pSurface, &pResource);10302 int rc = dxEnsureResource(pThisCC, pEntry->sid, &pSurface, &pResource); 10360 10303 AssertRCReturn(rc, rc); 10361 10304 … … 10379 10322 static int dxCreateVideoProcessorInputView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoProcessorInputViewId videoProcessorInputViewId, VBSVGACOTableDXVideoProcessorInputViewEntry const *pEntry) 10380 10323 { 10381 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10324 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 10382 10325 AssertReturn(pDXDevice->pVideoDevice, VERR_INVALID_STATE); 10383 10326 10384 10327 PVMSVGA3DSURFACE pSurface; 10385 10328 ID3D11Resource *pResource; 10386 int rc = dxEnsureResource(pThisCC, p DXContext, pEntry->sid, &pSurface, &pResource);10329 int rc = dxEnsureResource(pThisCC, pEntry->sid, &pSurface, &pResource); 10387 10330 AssertRCReturn(rc, rc); 10388 10331 … … 10425 10368 static int dxCreateVideoProcessorOutputView(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoProcessorOutputViewId videoProcessorOutputViewId, VBSVGACOTableDXVideoProcessorOutputViewEntry const *pEntry) 10426 10369 { 10427 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10370 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 10428 10371 AssertReturn(pDXDevice->pVideoDevice, VERR_INVALID_STATE); 10429 10372 10430 10373 PVMSVGA3DSURFACE pSurface; 10431 10374 ID3D11Resource *pResource; 10432 int rc = dxEnsureResource(pThisCC, p DXContext, pEntry->sid, &pSurface, &pResource);10375 int rc = dxEnsureResource(pThisCC, pEntry->sid, &pSurface, &pResource); 10433 10376 AssertRCReturn(rc, rc); 10434 10377 … … 10528 10471 VBSVGA3dVideoDecoderOutputViewId videoDecoderOutputViewId) 10529 10472 { 10530 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10473 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 10531 10474 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 10532 10475 … … 10621 10564 static int dxCreateVideoProcessor(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoProcessorId videoProcessorId, VBSVGACOTableDXVideoProcessorEntry const *pEntry) 10622 10565 { 10623 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10566 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 10624 10567 AssertReturn(pDXDevice->pVideoDevice, VERR_INVALID_STATE); 10625 10568 … … 10661 10604 HRESULT hr; 10662 10605 10663 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10606 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 10664 10607 AssertReturn(pDXDevice->pVideoDevice, VERR_INVALID_STATE); 10665 10608 … … 10749 10692 HRESULT hr; 10750 10693 10751 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10694 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 10752 10695 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 10753 10696 … … 10814 10757 static DECLCALLBACK(int) vmsvga3dBackVBDXVideoDecoderEndFrame(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoDecoderId videoDecoderId) 10815 10758 { 10816 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10759 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 10817 10760 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 10818 10761 … … 10845 10788 uint32_t OutputFrame, uint32_t StreamCount, VBSVGA3dVideoProcessorStream const *pVideoProcessorStreams) 10846 10789 { 10847 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10790 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 10848 10791 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 10849 10792 … … 11026 10969 static DECLCALLBACK(int) vmsvga3dBackVBDXVideoProcessorSetOutputTargetRect(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoProcessorId videoProcessorId, uint8 enable, SVGASignedRect const &outputRect) 11027 10970 { 11028 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10971 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11029 10972 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11030 10973 … … 11037 10980 static DECLCALLBACK(int) vmsvga3dBackVBDXVideoProcessorSetOutputBackgroundColor(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoProcessorId videoProcessorId, uint32 YCbCr, VBSVGA3dVideoColor const &color) 11038 10981 { 11039 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10982 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11040 10983 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11041 10984 … … 11048 10991 static DECLCALLBACK(int) vmsvga3dBackVBDXVideoProcessorSetOutputColorSpace(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoProcessorId videoProcessorId, VBSVGA3dVideoProcessorColorSpace const &colorSpace) 11049 10992 { 11050 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);10993 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11051 10994 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11052 10995 … … 11059 11002 static DECLCALLBACK(int) vmsvga3dBackVBDXVideoProcessorSetOutputAlphaFillMode(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoProcessorId videoProcessorId, VBSVGA3dVideoProcessorAlphaFillMode fillMode, uint32 streamIndex) 11060 11003 { 11061 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11004 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11062 11005 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11063 11006 … … 11070 11013 static DECLCALLBACK(int) vmsvga3dBackVBDXVideoProcessorSetOutputConstriction(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoProcessorId videoProcessorId, uint32 enabled, uint32 width, uint32 height) 11071 11014 { 11072 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11015 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11073 11016 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11074 11017 … … 11081 11024 static DECLCALLBACK(int) vmsvga3dBackVBDXVideoProcessorSetOutputStereoMode(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoProcessorId videoProcessorId, uint32 enable) 11082 11025 { 11083 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11026 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11084 11027 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11085 11028 … … 11092 11035 static DECLCALLBACK(int) vmsvga3dBackVBDXVideoProcessorSetStreamFrameFormat(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoProcessorId videoProcessorId, uint32 streamIndex, VBSVGA3dVideoFrameFormat format) 11093 11036 { 11094 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11037 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11095 11038 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11096 11039 … … 11103 11046 static DECLCALLBACK(int) vmsvga3dBackVBDXVideoProcessorSetStreamColorSpace(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoProcessorId videoProcessorId, uint32 streamIndex, VBSVGA3dVideoProcessorColorSpace colorSpace) 11104 11047 { 11105 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11048 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11106 11049 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11107 11050 … … 11115 11058 uint32 streamIndex, VBSVGA3dVideoProcessorOutputRate outputRate, uint32 repeatFrame, SVGA3dFraction64 const &customRate) 11116 11059 { 11117 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11060 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11118 11061 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11119 11062 … … 11127 11070 uint32 streamIndex, uint32 enable, SVGASignedRect const &sourceRect) 11128 11071 { 11129 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11072 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11130 11073 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11131 11074 … … 11139 11082 uint32 streamIndex, uint32 enable, SVGASignedRect const &destRect) 11140 11083 { 11141 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11084 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11142 11085 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11143 11086 … … 11151 11094 uint32 streamIndex, uint32 enable, float alpha) 11152 11095 { 11153 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11096 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11154 11097 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11155 11098 … … 11163 11106 uint32 streamIndex, uint32_t cEntries, uint32_t const *paEntries) 11164 11107 { 11165 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11108 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11166 11109 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11167 11110 … … 11175 11118 uint32 streamIndex, uint32 enable, SVGA3dFraction64 const &sourceRatio, SVGA3dFraction64 const &destRatio) 11176 11119 { 11177 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11120 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11178 11121 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11179 11122 … … 11187 11130 uint32 streamIndex, uint32 enable, float lower, float upper) 11188 11131 { 11189 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11132 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11190 11133 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11191 11134 … … 11200 11143 uint8 leftViewFrame0, uint8 baseViewFrame0, VBSVGA3dVideoProcessorStereoFlipMode flipMode, int32 monoOffset) 11201 11144 { 11202 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11145 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11203 11146 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11204 11147 … … 11213 11156 uint32 streamIndex, uint32 enable) 11214 11157 { 11215 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11158 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11216 11159 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11217 11160 … … 11225 11168 uint32 streamIndex, uint32 enable, VBSVGA3dVideoProcessorFilter filter, int32 level) 11226 11169 { 11227 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11170 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11228 11171 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11229 11172 … … 11237 11180 uint32 streamIndex, uint32 enable, VBSVGA3dVideoProcessorRotation rotation) 11238 11181 { 11239 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11182 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11240 11183 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11241 11184 … … 11478 11421 static DECLCALLBACK(int) vmsvga3dBackVBDXGetVideoCapability(PVGASTATECC pThisCC, PVMSVGA3DDXCONTEXT pDXContext, VBSVGA3dVideoCapability capability, void *pvData, uint32 cbData, uint32 *pcbOut) 11479 11422 { 11480 DXDEVICE *pDXDevice = dxDeviceFromContext(pThisCC->svga.p3dState, pDXContext); 11423 RT_NOREF(pDXContext); 11424 11425 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11481 11426 AssertReturn(pDXDevice->pVideoContext, VERR_INVALID_STATE); 11482 11427 … … 11500 11445 SVGA3dRGBAFloat const *pColor, uint32_t cRect, SVGASignedRect const *paRect) 11501 11446 { 11502 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11447 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11503 11448 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 11504 11449 … … 11515 11460 SVGA3dRGBAFloat const *pColor, uint32_t cRect, SVGASignedRect const *paRect) 11516 11461 { 11517 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11462 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11518 11463 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 11519 11464 … … 11530 11475 SVGA3dRGBAFloat const *pColor, uint32_t cRect, SVGASignedRect const *paRect) 11531 11476 { 11532 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11477 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11533 11478 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 11534 11479 … … 11545 11490 SVGA3dRGBAFloat const *pColor, uint32_t cRect, SVGASignedRect const *paRect) 11546 11491 { 11547 DXDEVICE *pDXDevice = dxDevice FromContext(pThisCC->svga.p3dState, pDXContext);11492 DXDEVICE *pDXDevice = dxDeviceGet(pThisCC->svga.p3dState); 11548 11493 AssertReturn(pDXDevice->pDevice, VERR_INVALID_STATE); 11549 11494
Note:
See TracChangeset
for help on using the changeset viewer.