- Timestamp:
- Jun 9, 2010 10:53:56 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r30102 r30103 1573 1573 return E_FAIL; 1574 1574 } 1575 AssertCompile(sizeof (RECT) == sizeof (D3DRECT)); 1576 AssertCompile(RT_OFFSETOF(RECT, left) == RT_OFFSETOF(D3DRECT, x1)); 1577 AssertCompile(RT_OFFSETOF(RECT, right) == RT_OFFSETOF(D3DRECT, x2)); 1578 AssertCompile(RT_OFFSETOF(RECT, top) == RT_OFFSETOF(D3DRECT, y1)); 1579 AssertCompile(RT_OFFSETOF(RECT, bottom) == RT_OFFSETOF(D3DRECT, y2)); 1580 1575 1581 static HRESULT APIENTRY vboxWddmDDevClear(HANDLE hDevice, CONST D3DDDIARG_CLEAR* pData, UINT NumRect, CONST RECT* pRect) 1576 1582 { 1577 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1578 AssertBreakpoint(); 1579 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1580 return E_FAIL; 1583 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1584 PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice; 1585 Assert(pDevice); 1586 Assert(pDevice->pDevice9If); 1587 HRESULT hr = pDevice->pDevice9If->Clear(NumRect, (D3DRECT*)pRect /* see AssertCompile above */, 1588 pData->Flags, 1589 pData->FillColor, 1590 pData->FillDepth, 1591 pData->FillStencil); 1592 Assert(hr == S_OK); 1593 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 1594 return hr; 1581 1595 } 1582 1596 static HRESULT APIENTRY vboxWddmDDevUpdatePalette(HANDLE hDevice, CONST D3DDDIARG_UPDATEPALETTE* pData, CONST PALETTEENTRY* pPaletteData) … … 1598 1612 static HRESULT APIENTRY vboxWddmDDevSetVertexShaderConst(HANDLE hDevice, CONST D3DDDIARG_SETVERTEXSHADERCONST* pData , CONST VOID* pRegisters) 1599 1613 { 1600 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1601 AssertBreakpoint(); 1602 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1603 return E_FAIL; 1614 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 1615 PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice; 1616 Assert(pDevice); 1617 Assert(pDevice->pDevice9If); 1618 HRESULT hr = pDevice->pDevice9If->SetVertexShaderConstantF( 1619 pData->Register, 1620 (CONST float*)pRegisters, 1621 pData->Count); 1622 Assert(hr == S_OK); 1623 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 1624 return hr; 1604 1625 } 1605 1626 static HRESULT APIENTRY vboxWddmDDevMultiplyTransform(HANDLE hDevice, CONST D3DDDIARG_MULTIPLYTRANSFORM* pData) … … 1758 1779 else 1759 1780 { 1760 Assert(pLockAlloc->LockInfo.fFlags.Value == pData->Flags.Value);1781 // Assert(pLockAlloc->LockInfo.fFlags.Value == pData->Flags.Value); 1761 1782 // if (pLockAlloc->LockInfo.fFlags.Value != pData->Flags.Value) 1762 1783 // { … … 2012 2033 pDevice->pDevice9If = pDevice9If; 2013 2034 pDevice->hWnd = hWnd; 2035 for (UINT i = 0; i < pResource->SurfCount; ++i) 2036 { 2037 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i]; 2038 2039 IDirect3DSurface9* pD3D9Surf; 2040 hr = pDevice9If->CreateRenderTarget(pAllocation->SurfDesc.width, 2041 pAllocation->SurfDesc.height, 2042 vboxDDI2D3DFormat(pResource->Format), 2043 vboxDDI2D3DMultiSampleType(pResource->MultisampleType), 2044 pResource->MultisampleQuality, 2045 !pResource->Flags.NotLockable /* BOOL Lockable */, 2046 &pD3D9Surf, 2047 NULL /* HANDLE* pSharedHandle */ 2048 ); 2049 Assert(hr == S_OK); 2050 if (hr == S_OK) 2051 { 2052 Assert(pD3D9Surf); 2053 if (pResource->Pool == D3DDDIPOOL_SYSTEMMEM) 2054 { 2055 Assert(pAllocation->pvMem); 2056 D3DLOCKED_RECT lockInfo; 2057 hr = pD3D9Surf->LockRect(&lockInfo, NULL, D3DLOCK_DISCARD); 2058 Assert(hr == S_OK); 2059 if (hr == S_OK) 2060 { 2061 vboxWddmLockUnlockMemSynch(pAllocation, &lockInfo, NULL, true /*bool bToLockInfo*/); 2062 HRESULT tmpHr = pD3D9Surf->UnlockRect(); 2063 Assert(tmpHr == S_OK); 2064 } 2065 } 2066 else 2067 { 2068 Assert(!pAllocation->pvMem); 2069 } 2070 pAllocation->pD3DIf = pD3D9Surf; 2071 } 2072 else 2073 { 2074 for (UINT j = 0; j < i; ++j) 2075 { 2076 pRc->aAllocations[j].pD3DIf->Release(); 2077 } 2078 break; 2079 } 2080 } 2014 2081 } 2015 else 2082 2083 if (hr != S_OK) 2016 2084 { 2017 2085 VBoxDispWndDestroy(pAdapter, hWnd); … … 2487 2555 static HRESULT APIENTRY vboxWddmDDevSetVertexShaderFunc(HANDLE hDevice, HANDLE hShaderHandle) 2488 2556 { 2489 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 2490 AssertBreakpoint(); 2491 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 2492 return E_FAIL; 2557 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 2558 PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice; 2559 Assert(pDevice); 2560 Assert(pDevice->pDevice9If); 2561 IDirect3DVertexShader9 *pShader = (IDirect3DVertexShader9*)hShaderHandle; 2562 Assert(pShader); 2563 HRESULT hr = pDevice->pDevice9If->SetVertexShader(pShader); 2564 Assert(hr == S_OK); 2565 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 2566 return hr; 2493 2567 } 2494 2568 static HRESULT APIENTRY vboxWddmDDevDeleteVertexShaderFunc(HANDLE hDevice, HANDLE hShaderHandle) … … 2608 2682 static HRESULT APIENTRY vboxWddmDDevSetRenderTarget(HANDLE hDevice, CONST D3DDDIARG_SETRENDERTARGET* pData) 2609 2683 { 2610 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 2611 AssertBreakpoint(); 2612 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 2613 return E_FAIL; 2684 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 2685 PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice; 2686 Assert(pDevice); 2687 Assert(pDevice->pDevice9If); 2688 PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hRenderTarget; 2689 Assert(pRc); 2690 Assert(pData->SubResourceIndex < pRc->cAllocations); 2691 IDirect3DSurface9 *pD3D9Surf = (IDirect3DSurface9*)pRc->aAllocations[pData->SubResourceIndex].pD3DIf; 2692 Assert(pD3D9Surf); 2693 HRESULT hr = pDevice->pDevice9If->SetRenderTarget(pData->RenderTargetIndex, pD3D9Surf); 2694 Assert(hr == S_OK); 2695 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 2696 return hr; 2614 2697 } 2615 2698 static HRESULT APIENTRY vboxWddmDDevSetDepthStencil(HANDLE hDevice, CONST D3DDDIARG_SETDEPTHSTENCIL* pData) 2616 2699 { 2617 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 2618 AssertBreakpoint(); 2619 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 2620 return E_FAIL; 2700 vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice)); 2701 PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice; 2702 Assert(pDevice); 2703 Assert(pDevice->pDevice9If); 2704 PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hZBuffer; 2705 Assert(pRc); 2706 Assert(pRc->cAllocations == 1); 2707 IDirect3DSurface9 *pD3D9Surf = (IDirect3DSurface9*)pRc->aAllocations[0].pD3DIf; 2708 Assert(pD3D9Surf); 2709 HRESULT hr = pDevice->pDevice9If->SetDepthStencilSurface(pD3D9Surf); 2710 Assert(hr == S_OK); 2711 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 2712 return hr; 2621 2713 } 2622 2714 static HRESULT APIENTRY vboxWddmDDevGenerateMipSubLevels(HANDLE hDevice, CONST D3DDDIARG_GENERATEMIPSUBLEVELS* pData)
Note:
See TracChangeset
for help on using the changeset viewer.