Changeset 94276 in vbox for trunk/src/VBox
- Timestamp:
- Mar 16, 2022 6:21:51 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win-dx.cpp
r94273 r94276 1834 1834 1835 1835 1836 static HRESULT dxInitSharedHandle(PVMSVGA3DBACKEND pBackend, PVMSVGA3DBACKENDSURFACE pBackendSurface) 1837 { 1838 if (pBackend->fSingleDevice) 1839 return S_OK; 1840 1841 /* Get the shared handle. */ 1842 IDXGIResource *pDxgiResource = NULL; 1843 HRESULT hr = pBackendSurface->u.pResource->QueryInterface(__uuidof(IDXGIResource), (void**)&pDxgiResource); 1844 Assert(SUCCEEDED(hr)); 1845 if (SUCCEEDED(hr)) 1846 { 1847 hr = pDxgiResource->GetSharedHandle(&pBackendSurface->SharedHandle); 1848 Assert(SUCCEEDED(hr)); 1849 D3D_RELEASE(pDxgiResource); 1850 } 1851 1852 return hr; 1853 } 1854 1855 1836 1856 static int vmsvga3dBackSurfaceCreateScreenTarget(PVGASTATECC pThisCC, PVMSVGA3DSURFACE pSurface) 1837 1857 { … … 1896 1916 } 1897 1917 1898 if ( SUCCEEDED(hr) 1899 && !pBackend->fSingleDevice) 1900 { 1901 /* Get the shared handle. */ 1902 IDXGIResource *pDxgiResource = NULL; 1903 hr = pBackendSurface->u.pTexture2D->QueryInterface(__uuidof(IDXGIResource), (void**)&pDxgiResource); 1904 Assert(SUCCEEDED(hr)); 1905 if (SUCCEEDED(hr)) 1906 { 1907 hr = pDxgiResource->GetSharedHandle(&pBackendSurface->SharedHandle); 1908 Assert(SUCCEEDED(hr)); 1909 D3D_RELEASE(pDxgiResource); 1910 } 1911 } 1918 if (SUCCEEDED(hr)) 1919 hr = dxInitSharedHandle(pBackend, pBackendSurface); 1912 1920 1913 1921 if (SUCCEEDED(hr)) … … 2065 2073 } 2066 2074 2067 if ( SUCCEEDED(hr) 2068 && MiscFlags == D3D11_RESOURCE_MISC_SHARED) 2069 { 2070 /* Get the shared handle. */ 2071 IDXGIResource *pDxgiResource = NULL; 2072 hr = pBackendSurface->u.pTexture2D->QueryInterface(__uuidof(IDXGIResource), (void**)&pDxgiResource); 2073 Assert(SUCCEEDED(hr)); 2074 if (SUCCEEDED(hr)) 2075 { 2076 hr = pDxgiResource->GetSharedHandle(&pBackendSurface->SharedHandle); 2077 Assert(SUCCEEDED(hr)); 2078 D3D_RELEASE(pDxgiResource); 2079 } 2080 } 2075 if (SUCCEEDED(hr)) 2076 hr = dxInitSharedHandle(pBackend, pBackendSurface); 2081 2077 2082 2078 if (SUCCEEDED(hr)) … … 2135 2131 } 2136 2132 2137 if ( SUCCEEDED(hr) 2138 && MiscFlags == D3D11_RESOURCE_MISC_SHARED) 2139 { 2140 /* Get the shared handle. */ 2141 IDXGIResource *pDxgiResource = NULL; 2142 hr = pBackendSurface->u.pTexture2D->QueryInterface(__uuidof(IDXGIResource), (void**)&pDxgiResource); 2143 Assert(SUCCEEDED(hr)); 2144 if (SUCCEEDED(hr)) 2145 { 2146 hr = pDxgiResource->GetSharedHandle(&pBackendSurface->SharedHandle); 2147 Assert(SUCCEEDED(hr)); 2148 D3D_RELEASE(pDxgiResource); 2149 } 2150 } 2133 if (SUCCEEDED(hr)) 2134 hr = dxInitSharedHandle(pBackend, pBackendSurface); 2151 2135 2152 2136 if (SUCCEEDED(hr)) … … 2202 2186 } 2203 2187 2204 if ( SUCCEEDED(hr) 2205 && MiscFlags == D3D11_RESOURCE_MISC_SHARED) 2206 { 2207 /* Get the shared handle. */ 2208 IDXGIResource *pDxgiResource = NULL; 2209 hr = pBackendSurface->u.pTexture1D->QueryInterface(__uuidof(IDXGIResource), (void**)&pDxgiResource); 2210 Assert(SUCCEEDED(hr)); 2211 if (SUCCEEDED(hr)) 2212 { 2213 hr = pDxgiResource->GetSharedHandle(&pBackendSurface->SharedHandle); 2214 Assert(SUCCEEDED(hr)); 2215 D3D_RELEASE(pDxgiResource); 2216 } 2217 } 2188 if (SUCCEEDED(hr)) 2189 hr = dxInitSharedHandle(pBackend, pBackendSurface); 2218 2190 2219 2191 if (SUCCEEDED(hr)) … … 2272 2244 } 2273 2245 2274 if ( SUCCEEDED(hr) 2275 && MiscFlags == D3D11_RESOURCE_MISC_SHARED) 2276 { 2277 /* Get the shared handle. */ 2278 IDXGIResource *pDxgiResource = NULL; 2279 hr = pBackendSurface->u.pTexture3D->QueryInterface(__uuidof(IDXGIResource), (void**)&pDxgiResource); 2280 Assert(SUCCEEDED(hr)); 2281 if (SUCCEEDED(hr)) 2282 { 2283 hr = pDxgiResource->GetSharedHandle(&pBackendSurface->SharedHandle); 2284 Assert(SUCCEEDED(hr)); 2285 D3D_RELEASE(pDxgiResource); 2286 } 2287 } 2246 if (SUCCEEDED(hr)) 2247 hr = dxInitSharedHandle(pBackend, pBackendSurface); 2288 2248 2289 2249 if (SUCCEEDED(hr)) … … 2343 2303 } 2344 2304 2345 if ( SUCCEEDED(hr) 2346 && MiscFlags == D3D11_RESOURCE_MISC_SHARED) 2347 { 2348 /* Get the shared handle. */ 2349 IDXGIResource *pDxgiResource = NULL; 2350 hr = pBackendSurface->u.pTexture2D->QueryInterface(__uuidof(IDXGIResource), (void**)&pDxgiResource); 2351 Assert(SUCCEEDED(hr)); 2352 if (SUCCEEDED(hr)) 2353 { 2354 hr = pDxgiResource->GetSharedHandle(&pBackendSurface->SharedHandle); 2355 Assert(SUCCEEDED(hr)); 2356 D3D_RELEASE(pDxgiResource); 2357 } 2358 } 2305 if (SUCCEEDED(hr)) 2306 hr = dxInitSharedHandle(pBackend, pBackendSurface); 2359 2307 2360 2308 if (SUCCEEDED(hr))
Note:
See TracChangeset
for help on using the changeset viewer.