Changeset 30144 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display
- Timestamp:
- Jun 10, 2010 10:45:02 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r30139 r30144 938 938 } 939 939 940 uint32_t cPixCopyLine = pRect-> left - pRect->right;940 uint32_t cPixCopyLine = pRect->right - pRect->left; 941 941 942 942 if (cPixCopyLine == pAlloc->SurfDesc.width && srcPitch == dstPitch) … … 1792 1792 static HRESULT APIENTRY vboxWddmDDevDrawPrimitive2(HANDLE hDevice, CONST D3DDDIARG_DRAWPRIMITIVE2* pData) 1793 1793 { 1794 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1795 AssertBreakpoint(); 1796 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1797 return E_FAIL; 1794 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1795 PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice; 1796 Assert(pDevice); 1797 Assert(pDevice->pDevice9If); 1798 HRESULT hr = pDevice->pDevice9If->DrawPrimitive(pData->PrimitiveType, pData->FirstVertexOffset, pData->PrimitiveCount); 1799 Assert(hr == S_OK); 1800 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 1801 return hr; 1798 1802 } 1799 1803 … … 2045 2049 Assert(pD3DIfTex); 2046 2050 RECT *pRect = NULL; 2051 Assert(!pData->Flags.RangeValid); 2052 Assert(!pData->Flags.BoxValid); 2047 2053 if (pData->Flags.AreaValid) 2048 2054 { 2049 2055 pRect = &pData->Area; 2050 2056 } 2051 else if (pData->Flags.RangeValid) 2052 { 2053 AssertBreakpoint(); 2054 } 2055 else if (pData->Flags.BoxValid) 2056 { 2057 AssertBreakpoint(); 2058 } 2057 2059 2058 /* else - we lock the entire texture, pRect == NULL */ 2060 2059 … … 2123 2122 } 2124 2123 } 2124 else if (pRc->RcDesc.fFlags.VertexBuffer) 2125 { 2126 Assert(pData->SubResourceIndex < pRc->cAllocations); 2127 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SubResourceIndex]; 2128 IDirect3DVertexBuffer9 *pD3D9VBuf = (IDirect3DVertexBuffer9*)pAlloc->pD3DIf; 2129 Assert(pD3D9VBuf); 2130 Assert(!pData->Flags.AreaValid); 2131 Assert(!pData->Flags.BoxValid); 2132 D3DDDIRANGE *pRange = NULL; 2133 if (pData->Flags.RangeValid) 2134 { 2135 pRange = &pData->Range; 2136 } 2137 2138 /* else - we lock the entire texture, pRect == NULL */ 2139 2140 // Assert(!pLockAlloc->LockInfo.cLocks); 2141 if (!pAlloc->LockInfo.cLocks) 2142 { 2143 hr = pD3D9VBuf->Lock(pRange ? pRange->Offset : 0, 2144 pRange ? pRange->Size : 0, 2145 &pAlloc->LockInfo.LockedRect.pBits, 2146 vboxDDI2D3DLockFlags(pData->Flags)); 2147 Assert(hr == S_OK); 2148 if (hr == S_OK) 2149 { 2150 pAlloc->LockInfo.LockedRect.Pitch = pAlloc->SurfDesc.width; 2151 // Assert(pLockAlloc->LockInfo.fFlags.Value == 0); 2152 pAlloc->LockInfo.fFlags = pData->Flags; 2153 if (pRange) 2154 { 2155 pAlloc->LockInfo.Range = *pRange; 2156 Assert(pAlloc->LockInfo.fFlags.RangeValid == 1); 2157 // pAlloc->LockInfo.fFlags.RangeValid = 1; 2158 } 2159 else 2160 { 2161 Assert(pAlloc->LockInfo.fFlags.RangeValid == 0); 2162 // pAlloc->LockInfo.fFlags.RangeValid = 0; 2163 } 2164 2165 ++pAlloc->LockInfo.cLocks; 2166 } 2167 } 2168 else 2169 { 2170 // Assert(pAlloc->LockInfo.fFlags.Value == pData->Flags.Value); 2171 // if (pAlloc->LockInfo.fFlags.Value != pData->Flags.Value) 2172 // { 2173 // } 2174 Assert(pAlloc->LockInfo.fFlags.RangeValid == pData->Flags.RangeValid); 2175 if (pAlloc->LockInfo.fFlags.RangeValid && pData->Flags.RangeValid) 2176 { 2177 Assert(pAlloc->LockInfo.Range.Offset == pData->Range.Offset); 2178 Assert(pAlloc->LockInfo.Range.Size == pData->Range.Size); 2179 } 2180 Assert(pAlloc->LockInfo.LockedRect.pBits); 2181 } 2182 2183 2184 ++pAlloc->LockInfo.cLocks; 2185 2186 if (!pData->Flags.NotifyOnly) 2187 { 2188 pData->pSurfData = pAlloc->LockInfo.LockedRect.pBits; 2189 pData->Pitch = pAlloc->LockInfo.LockedRect.Pitch; 2190 pData->SlicePitch = 0; 2191 Assert(pAlloc->SurfDesc.slicePitch == 0); 2192 Assert(!pAlloc->pvMem); 2193 } 2194 else 2195 { 2196 Assert(pAlloc->pvMem); 2197 Assert(pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM); 2198 if (/* !pData->Flags.WriteOnly && */ !pData->Flags.Discard) 2199 { 2200 RECT r, *pr; 2201 if (pRange) 2202 { 2203 r.top = 0; 2204 r.left = pRange->Offset; 2205 r.bottom = 1; 2206 r.right = pRange->Offset + pRange->Size; 2207 pr = &r; 2208 } 2209 else 2210 pr = NULL; 2211 vboxWddmLockUnlockMemSynch(pAlloc, &pAlloc->LockInfo.LockedRect, pr, false /*bool bToLockInfo*/); 2212 } 2213 } 2214 } 2125 2215 else 2126 2216 { … … 2201 2291 2202 2292 --pLockAlloc->LockInfo.cLocks; 2293 Assert(pLockAlloc->LockInfo.cLocks < UINT32_MAX); 2294 // pLockAlloc->LockInfo.cLocks = 0; 2203 2295 if (!pLockAlloc->LockInfo.cLocks) 2204 2296 { 2205 2297 PVBOXWDDMDISP_ALLOCATION pTexAlloc = &pRc->aAllocations[0]; 2206 Assert(pLockAlloc->LockInfo.cLocks);2298 // Assert(!pLockAlloc->LockInfo.cLocks); 2207 2299 IDirect3DTexture9 *pD3DIfTex = (IDirect3DTexture9*)pTexAlloc->pD3DIf; 2208 2300 Assert(pD3DIfTex); … … 2220 2312 { 2221 2313 Assert(pLockAlloc->LockInfo.cLocks < UINT32_MAX); 2314 } 2315 } 2316 else if (pRc->RcDesc.fFlags.VertexBuffer) 2317 { 2318 Assert(pData->SubResourceIndex < pRc->cAllocations); 2319 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SubResourceIndex]; 2320 2321 --pAlloc->LockInfo.cLocks; 2322 Assert(pAlloc->LockInfo.cLocks < UINT32_MAX); 2323 // pAlloc->LockInfo.cLocks = 0; 2324 if (!pAlloc->LockInfo.cLocks) 2325 { 2326 // Assert(!pAlloc->LockInfo.cLocks); 2327 IDirect3DVertexBuffer9 *pD3D9VBuf = (IDirect3DVertexBuffer9*)pAlloc->pD3DIf; 2328 Assert(pD3D9VBuf); 2329 /* this is a sysmem texture, update */ 2330 if (pAlloc->pvMem && !pAlloc->LockInfo.fFlags.ReadOnly) 2331 { 2332 RECT r, *pr; 2333 if (pAlloc->LockInfo.fFlags.RangeValid) 2334 { 2335 r.top = 0; 2336 r.left = pAlloc->LockInfo.Range.Offset; 2337 r.bottom = 1; 2338 r.right = pAlloc->LockInfo.Range.Offset + pAlloc->LockInfo.Range.Size; 2339 pr = &r; 2340 } 2341 else 2342 pr = NULL; 2343 vboxWddmLockUnlockMemSynch(pAlloc, &pAlloc->LockInfo.LockedRect, 2344 pr, 2345 true /*bool bToLockInfo*/); 2346 } 2347 hr = pD3D9VBuf->Unlock(); 2348 Assert(hr == S_OK); 2349 } 2350 else 2351 { 2352 Assert(pAlloc->LockInfo.cLocks < UINT32_MAX); 2222 2353 } 2223 2354 } … … 2973 3104 static HRESULT APIENTRY vboxWddmDDevSetStreamSource(HANDLE hDevice, CONST D3DDDIARG_SETSTREAMSOURCE* pData) 2974 3105 { 2975 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 2976 AssertBreakpoint(); 2977 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 2978 return E_FAIL; 3106 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 3107 PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice; 3108 Assert(pDevice); 3109 Assert(pDevice->pDevice9If); 3110 PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hVertexBuffer; 3111 Assert(pRc); 3112 Assert(pRc->cAllocations == 1); 3113 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[0]; 3114 Assert(pAlloc->pD3DIf); 3115 IDirect3DVertexBuffer9 *pStreamData = (IDirect3DVertexBuffer9*)pAlloc->pD3DIf; 3116 HRESULT hr = pDevice->pDevice9If->SetStreamSource(pData->Stream, pStreamData, pData->Offset, pData->Stride); 3117 Assert(hr == S_OK); 3118 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 3119 return hr; 2979 3120 } 2980 3121 static HRESULT APIENTRY vboxWddmDDevSetStreamSourceFreq(HANDLE hDevice, CONST D3DDDIARG_SETSTREAMSOURCEFREQ* pData)
Note:
See TracChangeset
for help on using the changeset viewer.