Changeset 79681 in vbox
- Timestamp:
- Jul 10, 2019 9:02:36 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
r79668 r79681 1242 1242 &pSurface->hSharedObject); 1243 1243 else if (pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_TEXTURE) 1244 hr = pContext->pDevice->CreateTexture(cWidth, 1245 cHeight, 1246 numMipLevels, 1247 pSurface->fUsageD3D | D3DUSAGE_RENDERTARGET, 1248 pSurface->formatD3D, 1249 D3DPOOL_DEFAULT, 1250 &pSharedSurface->u.pTexture, 1251 &pSurface->hSharedObject); 1244 { 1245 if (pSurface->fStencilAsTexture) 1246 { 1247 /* Use the INTZ format for a depth/stencil surface that will be used as a texture */ 1248 hr = pContext->pDevice->CreateTexture(cWidth, 1249 cHeight, 1250 1, /* mip levels */ 1251 D3DUSAGE_DEPTHSTENCIL, 1252 FOURCC_INTZ, 1253 D3DPOOL_DEFAULT, 1254 &pSharedSurface->u.pTexture, 1255 &pSurface->hSharedObject); 1256 } 1257 else 1258 { 1259 hr = pContext->pDevice->CreateTexture(cWidth, 1260 cHeight, 1261 numMipLevels, 1262 pSurface->fUsageD3D | D3DUSAGE_RENDERTARGET, 1263 pSurface->formatD3D, 1264 D3DPOOL_DEFAULT, 1265 &pSharedSurface->u.pTexture, 1266 &pSurface->hSharedObject); 1267 } 1268 } 1252 1269 else 1253 1270 hr = E_FAIL; … … 1891 1908 &pSurface->u.pTexture, 1892 1909 &pSurface->hSharedObject /* might result in poor performance */); 1910 if ( hr == D3D_OK 1911 && ( pSurface->formatD3D == D3DFMT_D24S8 1912 || pSurface->formatD3D == D3DFMT_D24X8)) 1913 { 1914 /* Create another texture object to serve as a bounce buffer as the 1915 * D3DFMT_D24S8 and D3DFMT_D24X8 surface can't be locked apparently (from testing). 1916 */ 1917 hr = pContext->pDevice->CreateTexture(cWidth, 1918 cHeight, 1919 1, /* mip levels */ 1920 D3DUSAGE_DYNAMIC /* Lockable */, 1921 FOURCC_INTZ, 1922 D3DPOOL_SYSTEMMEM, 1923 &pSurface->bounce.pTexture, 1924 NULL); 1925 AssertMsgReturn(hr == D3D_OK, ("CreateTexture (systemmem) failed with %x\n", hr), VERR_INTERNAL_ERROR); 1926 } 1893 1927 AssertMsgReturn(hr == D3D_OK, ("CreateTexture INTZ failed with %x\n", hr), VERR_INTERNAL_ERROR); 1894 1928 … … 4048 4082 #endif 4049 4083 } 4050 Assert(pRenderTarget->idAssociatedContext == cid);4051 4084 4052 4085 /** @todo Assert(!pRenderTarget->fDirty); */ … … 4061 4094 IDirect3DSurface9 *pStencilSurface; 4062 4095 4063 hr = pRenderTarget->u.pTexture->GetSurfaceLevel(0, &pStencilSurface);4064 Assert MsgReturn(hr == D3D_OK, ("GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);4096 rc = vmsvga3dGetD3DSurface(pState, pContext, pRenderTarget, target.face, target.mipmap, /*fLockable=*/ false, &pStencilSurface); 4097 AssertRCReturn(rc, rc); 4065 4098 4066 4099 hr = pContext->pDevice->SetDepthStencilSurface(pStencilSurface); … … 4070 4103 else 4071 4104 { 4105 Assert(pRenderTarget->idAssociatedContext == cid); 4072 4106 hr = pContext->pDevice->SetDepthStencilSurface(pRenderTarget->u.pSurface); 4073 4107 AssertMsgReturn(hr == D3D_OK, ("SetDepthStencilSurface failed with %x\n", hr), VERR_INTERNAL_ERROR);
Note:
See TracChangeset
for help on using the changeset viewer.