Changeset 32184 in vbox
- Timestamp:
- Sep 1, 2010 4:37:20 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r32148 r32184 4106 4106 { 4107 4107 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SrcSubResourceIndex]; 4108 PVBOXWDDMDISP_SCREEN pPrimaryScreen = &pDevice->aScreens[pDevice->iPrimaryScreen]; 4109 Assert(pPrimaryScreen->pDevice9If); 4108 4110 IDirect3DSurface9 *pSecondaryRt; 4109 4111 IDirect3DSurface9 *pDataRt = (IDirect3DSurface9*)pAlloc->pSecondaryOpenedD3DIf; 4110 4112 Assert(pDataRt); 4111 4113 Assert(pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE); 4112 hr = pScreen->pDevice9If->GetRenderTarget(0, &pSecondaryRt); 4113 Assert(hr == S_OK); 4114 if (hr == S_OK) 4115 { 4116 hr = pScreen->pDevice9If->StretchRect(pDataRt, 4117 NULL, 4118 pSecondaryRt, 4119 NULL, 4120 D3DTEXF_NONE); 4121 pSecondaryRt->Release(); 4114 // do we actually need to do flush here ? 4115 // hr = pDevice->pAdapter->D3D.pfnVBoxWineExD3DDev9Flush((IDirect3DDevice9Ex*)pPrimaryScreen->pDevice9If); 4116 // Assert(hr == S_OK); 4117 // if (hr == S_OK) 4118 { 4119 hr = pScreen->pDevice9If->GetRenderTarget(0, &pSecondaryRt); 4120 Assert(hr == S_OK); 4121 if (hr == S_OK) 4122 { 4123 hr = pScreen->pDevice9If->StretchRect(pDataRt, 4124 NULL, 4125 pSecondaryRt, 4126 NULL, 4127 D3DTEXF_NONE); 4128 pSecondaryRt->Release(); 4129 } 4122 4130 } 4123 4131 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/device.c
r31868 r32184 935 935 } 936 936 937 #ifdef VBOXWDDM 938 HRESULT VBoxWineExD3DDev9CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, 937 static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, 939 938 D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface, 940 939 UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality 940 #ifdef VBOXWDDM 941 941 , HANDLE *shared_handle 942 942 , void *pvClientMem 943 #endif 943 944 ) 944 945 { … … 960 961 961 962 hr = surface_init(object, This, Width, Height, Format, Lockable, Discard, 962 Level, Usage, Pool, MultiSample, MultisampleQuality, 963 shared_handle, pvClientMem); 963 Level, Usage, Pool, MultiSample, MultisampleQuality 964 #ifdef VBOXWDDM 965 , shared_handle 966 , pvClientMem 967 #endif 968 ); 964 969 if (FAILED(hr)) 965 970 { … … 973 978 974 979 return D3D_OK; 975 }976 #endif977 static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height,978 D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface,979 UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality)980 {981 #ifdef VBOXWDDM982 return VBoxWineExD3DDev9CreateSurface(iface, Width, Height, Format, Lockable, Discard, Level, ppSurface,983 Usage, Pool, MultiSample, MultisampleQuality, NULL, NULL);984 #else985 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;986 IDirect3DSurface9Impl *object;987 HRESULT hr;988 989 TRACE("iface %p, width %u, height %u, format %#x, lockable %#x, discard %#x, level %u, surface %p.\n"990 "usage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n",991 iface, Width, Height, Format, Lockable, Discard, Level, ppSurface,992 Usage, Pool, MultiSample, MultisampleQuality);993 994 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface9Impl));995 if (!object)996 {997 FIXME("Failed to allocate surface memory.\n");998 return D3DERR_OUTOFVIDEOMEMORY;999 }1000 1001 hr = surface_init(object, This, Width, Height, Format, Lockable, Discard,1002 Level, Usage, Pool, MultiSample, MultisampleQuality);1003 if (FAILED(hr))1004 {1005 WARN("Failed to initialize surface, hr %#x.\n", hr);1006 HeapFree(GetProcessHeap(), 0, object);1007 return hr;1008 }1009 1010 TRACE("Created surface %p.\n", object);1011 *ppSurface = (IDirect3DSurface9 *)object;1012 1013 return D3D_OK;1014 #endif1015 980 } 1016 981 … … 1027 992 1028 993 hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, Lockable, FALSE /* Discard */, 1029 0 /* Level */, ppSurface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality); 994 0 /* Level */, ppSurface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality 995 #ifdef VBOXWDDM 996 , pSharedHandle 997 , NULL 998 #endif 999 ); 1030 1000 1031 1001 return hr; … … 1044 1014 1045 1015 hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, Discard, 1046 0 /* Level */, ppSurface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality); 1016 0 /* Level */, ppSurface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality 1017 #ifdef VBOXWDDM 1018 , pSharedHandle 1019 , NULL 1020 #endif 1021 ); 1047 1022 1048 1023 return hr; … … 1179 1154 hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, FALSE /* Discard */, 1180 1155 0 /* Level */, ppSurface, 0 /* Usage (undefined/none) */, (WINED3DPOOL)Pool, D3DMULTISAMPLE_NONE, 1181 0 /* MultisampleQuality */); 1156 0 /* MultisampleQuality */ 1157 #ifdef VBOXWDDM 1158 , pSharedHandle 1159 , NULL 1160 #endif 1161 ); 1182 1162 1183 1163 return hr; … … 2756 2736 lockable = FALSE; 2757 2737 2758 #ifdef VBOXWDDM2759 hr = VBoxWineExD3DDev9CreateSurface((IDirect3DDevice9Ex *)This, width, height,2760 d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level,2761 (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */2762 , shared_handle2763 , pvClientMem2764 );2765 2766 #else2767 2738 hr = IDirect3DDevice9Impl_CreateSurface((IDirect3DDevice9Ex *)This, width, height, 2768 2739 d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level, 2769 2740 (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */ 2741 #ifdef VBOXWDDM 2742 , shared_handle 2743 , pvClientMem 2744 #endif 2770 2745 ); 2771 #endif2772 2746 if (FAILED(hr)) 2773 2747 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c
r32061 r32184 482 482 return hr; 483 483 } 484 485 #ifdef VBOXWDDM 486 if (VBOXSHRC_IS_SHARED(surface)) 487 { 488 Assert(shared_handle); 489 VBOXSHRC_SET_INITIALIZED(surface); 490 IWineD3DSurface_LoadLocation(surface, SFLAG_INTEXTURE, NULL); 491 if (!VBOXSHRC_IS_SHARED_OPENED(surface)) 492 { 493 Assert(!(*shared_handle)); 494 *shared_handle = VBOXSHRC_GET_SHAREHANDLE(surface); 495 } 496 else 497 { 498 Assert(*shared_handle); 499 Assert(*shared_handle == VBOXSHRC_GET_SHAREHANDLE(surface)); 500 } 501 } 502 else 503 { 504 Assert(!shared_handle); 505 } 506 #endif 484 507 485 508 return hr; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/texture.c
r32061 r32184 590 590 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h, format_desc->format, 591 591 usage, pool, i, WINED3DCUBEMAP_FACE_POSITIVE_X, &texture->surfaces[i] 592 , shared_handle 592 , NULL /* <- we first create a surface in an everage "non-shared" fashion and initialize its share properties later (see below) 593 * this is done this way because the surface does not have its parent (texture) setup properly 594 * thus we can not initialize texture at this stage */ 593 595 , pvClientMem); 594 596 … … 621 623 Assert(shared_handle); 622 624 VBOXSHRC_SET_INITIALIZED(texture); 625 for (i = 0; i < texture->baseTexture.levels; ++i) 626 { 627 VBOXSHRC_COPY_SHAREDATA((IWineD3DSurfaceImpl*)texture->surfaces[i], texture); 628 } 629 #ifdef DEBUG 630 for (i = 0; i < texture->baseTexture.levels; ++i) 631 { 632 Assert(!((IWineD3DSurfaceImpl*)texture->surfaces[i])->texture_name); 633 } 634 #endif 623 635 IWineD3DSurface_LoadLocation(texture->surfaces[0], SFLAG_INTEXTURE, NULL); 624 636 if (!VBOXSHRC_IS_SHARED_OPENED(texture)) -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/vboxsharedrc.h
r32061 r32184 25 25 #define VBOXSHRC_SET_SHAREHANDLE(_o, _h) ((_o)->resource.sharerc_handle = (_h)) 26 26 #define VBOXSHRC_SET_INITIALIZED(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_INITIALIZED) 27 #define VBOXSHRC_COPY_SHAREDATA(_oDst, _oSrc) do { \ 28 VBOXSHRC_GET_SHAREFLAFS(_oDst) = VBOXSHRC_GET_SHAREFLAFS(_oSrc); \ 29 VBOXSHRC_SET_SHAREHANDLE(_oDst, VBOXSHRC_GET_SHAREFLAFS(_oSrc)); \ 30 } while (0) 31 #define VBOXSHRC_SET_SHARED(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_SHARED) 32 #define VBOXSHRC_SET_SHARED_OPENED(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_SHARED_OPENED) 27 33 #define VBOXSHRC_IS_SHARED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_SHARED)) 28 34 #define VBOXSHRC_IS_SHARED_OPENED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_SHARED_OPENED))
Note:
See TracChangeset
for help on using the changeset viewer.