Changeset 38988 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm
- Timestamp:
- Oct 13, 2011 3:37:16 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
r38982 r38988 2173 2173 } 2174 2174 2175 2176 #if 02177 2178 2179 DECLINLINE(VOID) vboxWddmSwapchainSetBb(PVBOXWDDMDISP_SWAPCHAIN pSwapchain, PVBOXWDDMDISP_RENDERTGT pRT)2180 {2181 UINT iRt = vboxWddmSwapchainRtIndex(pSwapchain, pRT);2182 Assert(iRt < pSwapchain->cRTs);2183 pSwapchain->iBB = iRt;2184 }2185 2186 /* the paRemoved buffer should at least contain VBOXWDDMDISP_MAX_SWAPCHAIN_SIZE elements,2187 * the function does not validate its size in any way */2188 static BOOL vboxWddmSwapchainAdjust(PVBOXWDDMDISP_SWAPCHAIN pSwapchain, PVBOXWDDMDISP_ALLOCATION pBbAlloc, PUINT pcRemoved, PVBOXWDDMDISP_ALLOCATION paRemoved)2189 {2190 UINT cRemoved = 0;2191 BOOL bChanged = FALSE;2192 PVBOXWDDMDISP_RENDERTGT pCurBbRt = vboxWddmSwapchainGetBb(pSwapchain);2193 if (pCurBb)2194 {2195 if (pCurBbRt->pAlloc != pBbAlloc)2196 {2197 bChanged = TRUE;2198 2199 /* determine whether we need to add the current BB2200 * or remove part or all of the current RTs in the swapchain */2201 PVBOXWDDMDISP_RENDERTGT pCorrectRt = vboxWddmSwapchainSearchRt(pSwapchain, pBbAlloc);2202 if (pCorrectRt)2203 {2204 paRemoved[cRemoved] = pCurBbRt->pAlloc;2205 ++cRemoved;2206 vboxWddmSwapchainRemoveRt(pSwapchain, pCurBbRt);2207 vboxWddmSwapchainSetBb(pSwapchain, pBbAlloc);2208 }2209 else2210 {2211 /* check if the pCurBbRt stored in the swapchain match those of the pBbAlloc */2212 if (pBbAlloc->SurfDesc.width == pCurBbRt->pAlloc->SurfDesc.width2213 && pBbAlloc->SurfDesc.height == pCurBbRt->pAlloc->SurfDesc.height2214 && pBbAlloc->SurfDesc.format == pCurBbRt->pAlloc->SurfDesc.format)2215 {2216 for (UINT i = 0; i < pSwapchain->cRTs;)2217 {2218 if (pSwapchain->aRTs[i].cNumFlips > 1)2219 {2220 paRemoved[cRemoved] = pSwapchain->aRTs[i].pAlloc;2221 ++cRemoved;2222 vboxWddmSwapchainRemoveRt(pSwapchain, &pSwapchain->aRTs[i]);2223 }2224 else2225 {2226 ++i;2227 }2228 }2229 }2230 else2231 {2232 /* remove all */2233 for (UINT i = 0; i < pSwapchain->cRTs; ++i)2234 {2235 paRemoved[cRemoved] = pSwapchain->aRTs[i].pAlloc;2236 ++cRemoved;2237 }2238 2239 vboxWddmSwapchainClear(pSwapchain);2240 }2241 2242 vboxWddmSwapchainAllocAddTail(pSwapchain, pBbAlloc);2243 vboxWddmSwapchainSetBb(pSwapchain, pBbAlloc);2244 }2245 }2246 }2247 else2248 {2249 vboxWddmSwapchainAllocAddTail(pSwapchain, pBbAlloc);2250 bChanged = TRUE;2251 }2252 2253 if (!bChanged)2254 {2255 Assert(cRemoved == 0);2256 }2257 2258 *pcRemoved = cRemoved;2259 2260 return bChanged;2261 }2262 #endif2263 2175 static PVBOXWDDMDISP_SWAPCHAIN vboxWddmSwapchainFindCreate(PVBOXWDDMDISP_DEVICE pDevice, PVBOXWDDMDISP_ALLOCATION pBbAlloc, BOOL *pbNeedPresent) 2264 2176 { … … 2389 2301 PVBOXWDDMDISP_ALLOCATION pAlloc = pRt->pAlloc; 2390 2302 Assert(pD3D9Surf); 2391 Assert(pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE 2392 || pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE); 2303 Assert(pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE); 2393 2304 if (pAlloc->pD3DIf) 2394 2305 { … … 2781 2692 fNeedRtPresentSwitch = TRUE; 2782 2693 // vboxWddmSwapchainSwtichRtPresent(pDevice, pSwapchain); 2694 } 2695 else 2696 { 2697 for (UINT i = 0; i < pSwapchain->cRTs; ++i) 2698 { 2699 if (pSwapchain->aRTs[i].pAlloc->enmD3DIfType != VBOXDISP_D3DIFTYPE_SURFACE) 2700 { 2701 fNeedRtPresentSwitch = TRUE; 2702 break; 2703 } 2704 } 2783 2705 } 2784 2706
Note:
See TracChangeset
for help on using the changeset viewer.