- Timestamp:
- Jul 4, 2013 6:08:11 AM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h
r46783 r46966 35 35 36 36 /* One would increase this whenever definitions in this file are changed */ 37 #define VBOXVIDEOIF_VERSION 1 837 #define VBOXVIDEOIF_VERSION 19 38 38 39 39 #define VBOXWDDM_NODE_ID_SYSTEM 0 … … 424 424 VBOXDISP_KMHANDLE hSwapchainKm; /* in, NULL if new is being created */ 425 425 VBOXDISP_UMHANDLE hSwapchainUm; /* in, UMD private data */ 426 DWORDwinHostID;426 int32_t winHostID; 427 427 RECT Rect; 428 428 UINT u32Reserved; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp
r46783 r46966 831 831 832 832 HRESULT hr = pAdapter->D3D.pD3D9If->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, fFlags, &Params.Base, &pDevice9If); 833 if (!SUCCEEDED(hr)) 834 { 833 if (SUCCEEDED(hr)) 834 { 835 int32_t hostId = 0; 836 hr = pAdapter->D3D.D3D.pfnVBoxWineExD3DDev9GetHostId((IDirect3DDevice9Ex*)pDevice9If, &hostId); 837 if (SUCCEEDED(hr)) 838 { 839 Assert(hostId); 840 841 VBOXDISPIFESCAPE Data; 842 Data.escapeCode = VBOXESC_SETCTXHOSTID; 843 Data.u32CmdSpecific = (uint32_t)hostId; 844 D3DDDICB_ESCAPE DdiEscape = {0}; 845 DdiEscape.hContext = pDevice->DefaultContext.ContextInfo.hContext; 846 DdiEscape.hDevice = pDevice->hDevice; 847 // DdiEscape.Flags.Value = 0; 848 DdiEscape.pPrivateDriverData = &Data; 849 DdiEscape.PrivateDriverDataSize = sizeof (Data); 850 hr = pDevice->RtCallbacks.pfnEscapeCb(pDevice->pAdapter->hAdapter, &DdiEscape); 851 if (SUCCEEDED(hr)) 852 { 853 pDevice->pDevice9If = pDevice9If; 854 return S_OK; 855 } 856 else 857 WARN(("pfnEscapeCb VBOXESC_SETCTXHOSTID failed hr 0x%x", hr)); 858 } 859 else 860 WARN(("pfnVBoxWineExD3DDev9GetHostId failed hr 0x%x", hr)); 861 862 pDevice->pAdapter->D3D.D3D.pfnVBoxWineExD3DDev9Term((IDirect3DDevice9Ex *)pDevice9If); 863 } 864 else 835 865 WARN(("CreateDevice failed hr 0x%x", hr)); 836 return hr; 837 } 838 839 pDevice->pDevice9If = pDevice9If; 840 return S_OK; 841 } 842 866 867 return hr; 868 } 869 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.cpp
r46783 r46966 160 160 { 161 161 WARN(("no VBoxWineExD3DSwapchain9GetHostWinID")); 162 break; 163 } 164 165 pD3D->pfnVBoxWineExD3DDev9GetHostId = (PFNVBOXWINEEXD3DDEV9_GETHOSTID)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DDev9GetHostId"); 166 if (!pD3D->pfnVBoxWineExD3DDev9GetHostId) 167 { 168 WARN(("no VBoxWineExD3DDev9GetHostId")); 162 169 break; 163 170 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.h
r46783 r46966 85 85 PFNVBOXWINEEXD3DSWAPCHAIN9_GETHOSTWINID pfnVBoxWineExD3DSwapchain9GetHostWinID; 86 86 87 PFNVBOXWINEEXD3DDEV9_GETHOSTID pfnVBoxWineExD3DDev9GetHostId; 88 87 89 /* module handle */ 88 90 HMODULE hD3DLib; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp
r46876 r46966 394 394 NTSTATUS vboxWddmSwapchainCtxEscape(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext, PVBOXDISPIFESCAPE_SWAPCHAININFO pSwapchainInfo, UINT cbSize) 395 395 { 396 Assert((cbSize >= RT_OFFSETOF(VBOXDISPIFESCAPE_SWAPCHAININFO, SwapchainInfo.ahAllocs[0])));397 396 if (cbSize < RT_OFFSETOF(VBOXDISPIFESCAPE_SWAPCHAININFO, SwapchainInfo.ahAllocs[0])) 397 { 398 WARN(("invalid cbSize1 %d", cbSize)); 398 399 return STATUS_INVALID_PARAMETER; 399 Assert(cbSize >= RT_OFFSETOF(VBOXDISPIFESCAPE_SWAPCHAININFO, SwapchainInfo.ahAllocs[pSwapchainInfo->SwapchainInfo.cAllocs])); 400 } 401 400 402 if (cbSize < RT_OFFSETOF(VBOXDISPIFESCAPE_SWAPCHAININFO, SwapchainInfo.ahAllocs[pSwapchainInfo->SwapchainInfo.cAllocs])) 403 { 401 404 return STATUS_INVALID_PARAMETER; 405 WARN(("invalid cbSize2 %d", cbSize)); 406 } 402 407 403 408 if (!pSwapchainInfo->SwapchainInfo.winHostID) 404 409 { 405 410 WARN(("Zero winHostID specified!")); 411 return STATUS_INVALID_PARAMETER; 412 } 413 414 if (!pContext) 415 { 416 WARN(("vboxWddmSwapchainCtxEscape: no context specified")); 406 417 return STATUS_INVALID_PARAMETER; 407 418 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r46757 r46966 228 228 VBOXDISP_UMHANDLE hSwapchainUm; 229 229 VBOXDISP_KMHANDLE hSwapchainKm; 230 UINTwinHostID;230 int32_t winHostID; 231 231 BOOLEAN fExposed; 232 232 POINT Pos; … … 244 244 UINT EngineAffinity; 245 245 BOOLEAN fRenderFromShadowDisabled; 246 int32_t hostID; 246 247 uint32_t u32CrConClientID; 247 248 VBOXMP_CRPACKER CrPacker; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r46885 r46966 4110 4110 break; 4111 4111 } 4112 case VBOXESC_SETCTXHOSTID: 4113 { 4114 /* set swapchain information */ 4115 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pEscape->hContext; 4116 if (!pContext) 4117 { 4118 WARN(("VBOXESC_SETCTXHOSTID: no context specified")); 4119 Status = STATUS_INVALID_PARAMETER; 4120 break; 4121 } 4122 4123 if (pEscape->PrivateDriverDataSize != sizeof (VBOXDISPIFESCAPE)) 4124 { 4125 WARN(("VBOXESC_SETCTXHOSTID: invalid data size %d", pEscape->PrivateDriverDataSize)); 4126 Status = STATUS_INVALID_PARAMETER; 4127 break; 4128 } 4129 4130 int32_t hostID = (int32_t)pEscapeHdr->u32CmdSpecific; 4131 if (hostID <= 0) 4132 { 4133 WARN(("VBOXESC_SETCTXHOSTID: invalid hostID %d", hostID)); 4134 Status = STATUS_INVALID_PARAMETER; 4135 break; 4136 } 4137 4138 if (pContext->hostID) 4139 { 4140 WARN(("VBOXESC_SETCTXHOSTID: context already has hostID specified")); 4141 Status = STATUS_INVALID_PARAMETER; 4142 break; 4143 } 4144 4145 pContext->hostID = hostID; 4146 Status = STATUS_SUCCESS; 4147 break; 4148 } 4112 4149 case VBOXESC_SWAPCHAININFO: 4113 4150 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d9/d3d9wddm.def
r46783 r46966 13 13 Direct3DCreate9Ex 14 14 VBoxWineExD3DDev9Flush 15 VBoxWineExD3DDev9 FlushToHost15 VBoxWineExD3DDev9GetHostId 16 16 VBoxWineExD3DDev9Finish 17 17 VBoxWineExD3DDev9CreateTexture … … 25 25 VBoxWineExD3DSwapchain9GetHostWinID 26 26 VBoxWineExD3DSurf9SyncToHost 27 VBoxWineExD3DDev9FlushToHost -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d9/device.c
r46885 r46966 817 817 wined3d_mutex_lock(); 818 818 hr = wined3d_device_finish(device->wined3d_device); 819 wined3d_mutex_unlock(); 820 821 return hr; 822 } 823 824 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9GetHostId(IDirect3DDevice9Ex *iface, int32_t *pi32Id) 825 { 826 struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); 827 HRESULT hr; 828 829 TRACE("iface %p, FlushToHost\n", iface); 830 831 wined3d_mutex_lock(); 832 hr = wined3d_device_get_host_id(device->wined3d_device, pi32Id); 819 833 wined3d_mutex_unlock(); 820 834 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d9/swapchain.c
r46757 r46966 307 307 } 308 308 309 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSwapchain9GetHostWinID(IDirect3DSwapChain9 *iface, DWORD *pID)310 { 311 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9(iface); 312 HRESULT hr; 313 wined3d_mutex_lock(); 314 hr = wined3d_swapchain_get_host_win_id(swapchain->wined3d_swapchain, p ID);309 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSwapchain9GetHostWinID(IDirect3DSwapChain9 *iface, int32_t *pi32Id) 310 { 311 struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9(iface); 312 HRESULT hr; 313 wined3d_mutex_lock(); 314 hr = wined3d_swapchain_get_host_win_id(swapchain->wined3d_swapchain, pi32Id); 315 315 wined3d_mutex_unlock(); 316 316 return hr; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/VBoxWineEx.h
r46783 r46966 72 72 typedef FNVBOXWINEEXD3DDEV9_FLUSHTOHOST *PFNVBOXWINEEXD3DDEV9_FLUSHTOHOST; 73 73 74 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DDEV9_GETHOSTID(IDirect3DDevice9Ex *iface, int32_t *pi32Id); 75 typedef FNVBOXWINEEXD3DDEV9_GETHOSTID *PFNVBOXWINEEXD3DDEV9_GETHOSTID; 76 74 77 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DDEV9_FINISH(IDirect3DDevice9Ex *iface); 75 78 typedef FNVBOXWINEEXD3DDEV9_FINISH *PFNVBOXWINEEXD3DDEV9_FINISH; … … 87 90 typedef FNVBOXWINEEXD3DSWAPCHAIN9_PRESENT *PFNVBOXWINEEXD3DSWAPCHAIN9_PRESENT; 88 91 89 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DSWAPCHAIN9_GETHOSTWINID(IDirect3DSwapChain9 *iface, DWORD*pID);92 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DSWAPCHAIN9_GETHOSTWINID(IDirect3DSwapChain9 *iface, int32_t *pID); 90 93 typedef FNVBOXWINEEXD3DSWAPCHAIN9_GETHOSTWINID *PFNVBOXWINEEXD3DSWAPCHAIN9_GETHOSTWINID; 91 94 … … 127 130 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9FlushToHost(IDirect3DDevice9Ex *iface); /* flash data to host */ 128 131 132 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9GetHostId(IDirect3DDevice9Ex *iface, int32_t *pi32Id); 133 129 134 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9Term(IDirect3DDevice9Ex *iface); 130 135 … … 139 144 IDirect3DSurface9 *surf); /* use the given surface as a frontbuffer content source */ 140 145 141 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSwapchain9GetHostWinID(IDirect3DSwapChain9 *iface, DWORD *pID);146 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSwapchain9GetHostWinID(IDirect3DSwapChain9 *iface, int32_t *pi32Id); 142 147 143 148 typedef struct VBOXWINEEX_D3DPRESENT_PARAMETERS -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/libWineStub/include/wine/wined3d.h
r46783 r46966 2479 2479 HRESULT __cdecl wined3d_device_blt_vol(struct wined3d_device *device, struct wined3d_volume *src, struct wined3d_volume *dst, const struct wined3d_box *pSrcBoxArg, const struct VBOXPOINT3D *pDstPoin3D); 2480 2480 HRESULT __cdecl wined3d_device_blt_voltex(struct wined3d_device *device, struct wined3d_texture *src, struct wined3d_texture *dst, const struct wined3d_box *pSrcBoxArg, const struct VBOXPOINT3D *pDstPoin3D); 2481 HRESULT __cdecl wined3d_device_get_host_id(struct wined3d_device *device, int32_t *pid); 2482 2481 2483 HRESULT __cdecl wined3d_surface_get_host_id(struct wined3d_surface *surface, uint32_t *id); 2482 2484 HRESULT __cdecl wined3d_surface_sync_to_host(struct wined3d_surface *surface); 2483 2485 2484 2486 HRESULT __cdecl wined3d_swapchain_present_rt(struct wined3d_swapchain *swapchain, struct wined3d_surface *rt); 2487 HRESULT __cdecl wined3d_swapchain_get_host_win_id(struct wined3d_swapchain *swapchain, int32_t *pi32Id); 2485 2488 #endif 2486 2489 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/device.c
r46602 r46966 5688 5688 5689 5689 } 5690 5691 HRESULT CDECL wined3d_device_get_host_id(struct wined3d_device *device, int32_t *pid) 5692 { 5693 int32_t id = pVBoxGetContextId(device->contexts[0]->glCtx); 5694 if (!id) 5695 { 5696 *pid = 0; 5697 ERR("pVBoxGetContextId to get id for context 0x%x", device->contexts[0]->glCtx); 5698 return E_FAIL; 5699 } 5700 5701 *pid = id; 5702 return WINED3D_OK; 5703 } 5690 5704 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/swapchain.c
r46757 r46966 1536 1536 } 1537 1537 1538 HRESULT CDECL wined3d_swapchain_get_host_win_id(struct wined3d_swapchain *swapchain, DWORD *pID)1539 { 1540 DWORD id = (DWORD)pVBoxGetWindowId(swapchain->hDC);1538 HRESULT CDECL wined3d_swapchain_get_host_win_id(struct wined3d_swapchain *swapchain, int32_t *pi32Id) 1539 { 1540 int32_t id = pVBoxGetWindowId(swapchain->hDC); 1541 1541 if (!id) 1542 1542 { 1543 *pi32Id = 0; 1543 1544 ERR("failed to get id for hdc 0x%x", swapchain->hDC); 1544 1545 return E_FAIL; 1545 1546 } 1546 *p ID= id;1547 *pi32Id = id; 1547 1548 return S_OK; 1548 1549 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_gl.h
r46783 r46966 185 185 void (WINAPI *pVBoxFlushToHost)(HGLRC) DECLSPEC_HIDDEN; 186 186 GLint (WINAPI *pVBoxGetWindowId)(HDC) DECLSPEC_HIDDEN; 187 GLint (WINAPI *pVBoxGetContextId)(HGLRC) DECLSPEC_HIDDEN; 187 188 188 189 … … 192 193 VBOX_USE_FUNC(VBoxCreateContext) \ 193 194 VBOX_USE_FUNC(VBoxFlushToHost) \ 194 VBOX_USE_FUNC(VBoxGetWindowId) 195 VBOX_USE_FUNC(VBoxGetWindowId) \ 196 VBOX_USE_FUNC(VBoxGetContextId) 195 197 196 198 # define VBOX_GL_EXT_FUNCS_GEN \ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3dwddm.def
r46783 r46966 261 261 wined3d_surface_sync_to_host 262 262 wined3d_swapchain_get_host_win_id 263 wined3d_device_get_host_id -
trunk/src/VBox/Additions/WINNT/include/VBoxDisplay.h
r44557 r46966 37 37 # define VBOXESC_REINITVIDEOMODESBYMASK 0xABCD9010 38 38 # define VBOXESC_ADJUSTVIDEOMODES 0xABCD9011 39 # define VBOXESC_SETCTXHOSTID 0xABCD9012 39 40 #endif /* #ifdef VBOX_WITH_WDDM */ 40 41 -
trunk/src/VBox/Additions/common/crOpenGL/defs.py
r46227 r46966 498 498 VBoxCreateContext 499 499 VBoxGetWindowId 500 VBoxGetContextId 500 501 VBoxFlushToHost""" 501 502 #print "DllMain" -
trunk/src/VBox/Additions/common/crOpenGL/defs64.py
r46227 r46966 479 479 VBoxCreateContext 480 480 VBoxGetWindowId 481 VBoxGetContextId 481 482 VBoxFlushToHost""" 482 483 #print "DllMain" -
trunk/src/VBox/Additions/common/crOpenGL/wgl.c
r45484 r46966 329 329 DECLEXPORT(GLint) WINAPI VBoxGetWindowId( HDC hdc ) 330 330 { 331 WindowInfo *window = stubGetWindowInfo(hdc); 331 WindowInfo *window; 332 GLint winid = 0; 333 334 CR_DDI_PROLOGUE(); 335 336 crHashtableLock(stub.windowTable); 337 338 window = stubGetWindowInfo(hdc); 332 339 if (!window) 333 340 { 334 CRASSERT(0);335 341 crWarning("stubGetWindowInfo: window not found!"); 336 return 0;342 goto end; 337 343 } 338 344 if (!window->spuWindow) 339 345 { 340 CRASSERT(0);341 346 crWarning("stubGetWindowInfo: window is null!"); 342 return 0; 343 } 344 return window->spuWindow; 345 } 347 goto end; 348 } 349 350 winid = window->spuWindow; 351 352 end: 353 crHashtableUnlock(stub.windowTable); 354 return winid; 355 } 356 357 DECLEXPORT(GLint) WINAPI VBoxGetContextId( HGLRC hglrc ) 358 { 359 ContextInfo *context; 360 GLint ctxid = 0; 361 362 CR_DDI_PROLOGUE(); 363 364 // crHashtableLock(stub.windowTable); 365 crHashtableLock(stub.contextTable); 366 367 context = (ContextInfo *) crHashtableSearch(stub.contextTable, (unsigned long) hglrc); 368 if (!context) 369 { 370 crWarning("crHashtableSearch: context not found!"); 371 goto end; 372 } 373 374 if (context->type != CHROMIUM) 375 { 376 crWarning("unexpected context type %d", context->type); 377 goto end; 378 } 379 380 if (context->spuContext <= 0) 381 { 382 crWarning("no spuSontext defined"); 383 goto end; 384 } 385 386 ctxid = context->spuContext; 387 388 end: 389 crHashtableUnlock(stub.contextTable); 390 return ctxid; 391 } 392 346 393 347 394 DECLEXPORT(HGLRC) WINAPI wglCreateContext_prox( HDC hdc ) -
trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h
r46173 r46966 287 287 DECLEXPORT(int32_t) crStateLoadGlobals(PSSMHANDLE pSSM, uint32_t u32Version); 288 288 DECLEXPORT(int32_t) crStateSaveGlobals(PSSMHANDLE pSSM); 289 290 DECLEXPORT(CRSharedState *) crStateGlobalSharedAcquire(); 291 DECLEXPORT(void) crStateGlobalSharedRelease(); 289 292 #endif 290 293 -
trunk/src/VBox/GuestHost/OpenGL/include/cr_protocol.h
r46885 r46966 33 33 #define CR_PRESENT_DEFINE_FLAG(_f) (1 << (CR_PRESENT_FLAGS_OFFSET + _f)) 34 34 35 #define CR_PRESENT_FLAG_CLEAR_RECTS CR_PRESENT_DEFINE_FLAG(0)36 //#define CR_PRESENT_FLAG_TEX_UPSIDEDOWNCR_PRESENT_DEFINE_FLAG(1)35 #define CR_PRESENT_FLAG_CLEAR_RECTS CR_PRESENT_DEFINE_FLAG(0) 36 #define CR_PRESENT_FLAG_TEX_NONINVERT_YCOORD CR_PRESENT_DEFINE_FLAG(1) 37 37 38 38 #define CR_PRESENT_GET_SCREEN(_cfg) ((_cfg) & CR_PRESENT_SCREEN_MASK) -
trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
r46885 r46966 209 209 VBOXVR_SCR_COMPOSITOR_ENTRY CEntry; 210 210 VBOXVR_SCR_COMPOSITOR_ENTRY RootVrCEntry; 211 void *pvUserData1; 212 void *pvUserData2; 211 213 } CR_DISPLAY_ENTRY, *PCR_DISPLAY_ENTRY; 212 214 /**/ … … 358 360 void CrDpTerm(PCR_DISPLAY pDisplay); 359 361 void CrDpResize(PCR_DISPLAY pDisplay, int32_t xPos, int32_t yPos, uint32_t width, uint32_t height); 360 void CrDpEntryInit(PCR_DISPLAY_ENTRY pEntry, const VBOXVR_TEXTURE *pTextureData );362 void CrDpEntryInit(PCR_DISPLAY_ENTRY pEntry, const VBOXVR_TEXTURE *pTextureData, void *pvUserData); 361 363 void CrDpEntryCleanup(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry); 362 364 int CrDpEntryRegionsSet(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions); … … 380 382 int CrDemInit(PCR_DISPLAY_ENTRY_MAP pMap); 381 383 void CrDemTerm(PCR_DISPLAY_ENTRY_MAP pMap); 382 PCR_DISPLAY_ENTRY CrDemEntryGetCreate(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture, CRContextInfo *pCtxInfo); 383 void CrDemEntryDestroy(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture); 384 PCR_DISPLAY_ENTRY CrDemEntryAcquire(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture); 385 void CrDemEntryRelease(PCR_DISPLAY_ENTRY pEntry); 386 //void CrDemEntryDestroy(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture); 384 387 385 388 /* */ -
trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h
r46885 r46966 195 195 RTLISTNODE Node; 196 196 VBOXVR_LIST Vr; 197 uint32_t cRefs; 197 198 } VBOXVR_COMPOSITOR_ENTRY, *PVBOXVR_COMPOSITOR_ENTRY; 198 199 199 200 struct VBOXVR_COMPOSITOR; 200 201 201 typedef DECLCALLBACK(void) FNVBOXVRCOMPOSITOR_ENTRY_RE MOVED(const struct VBOXVR_COMPOSITOR *pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry);202 typedef FNVBOXVRCOMPOSITOR_ENTRY_RE MOVED *PFNVBOXVRCOMPOSITOR_ENTRY_REMOVED;202 typedef DECLCALLBACK(void) FNVBOXVRCOMPOSITOR_ENTRY_RELEASED(const struct VBOXVR_COMPOSITOR *pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry); 203 typedef FNVBOXVRCOMPOSITOR_ENTRY_RELEASED *PFNVBOXVRCOMPOSITOR_ENTRY_RELEASED; 203 204 204 205 typedef struct VBOXVR_COMPOSITOR 205 206 { 206 207 RTLISTNODE List; 207 PFNVBOXVRCOMPOSITOR_ENTRY_RE MOVED pfnEntryRemoved;208 PFNVBOXVRCOMPOSITOR_ENTRY_RELEASED pfnEntryReleased; 208 209 } VBOXVR_COMPOSITOR, *PVBOXVR_COMPOSITOR; 209 210 … … 211 212 typedef FNVBOXVRCOMPOSITOR_VISITOR *PFNVBOXVRCOMPOSITOR_VISITOR; 212 213 213 VBOXVREGDECL(void) VBoxVrCompositorInit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_ENTRY_RE MOVED pfnEntryRemoved);214 VBOXVREGDECL(void) VBoxVrCompositorInit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_ENTRY_RELEASED pfnEntryReleased); 214 215 VBOXVREGDECL(void) VBoxVrCompositorClear(PVBOXVR_COMPOSITOR pCompositor); 215 216 VBOXVREGDECL(void) VBoxVrCompositorRegionsClear(PVBOXVR_COMPOSITOR pCompositor, bool *pfChanged); … … 297 298 } VBOXVR_TEXTURE, *PVBOXVR_TEXTURE; 298 299 300 struct VBOXVR_SCR_COMPOSITOR_ENTRY; 301 struct VBOXVR_SCR_COMPOSITOR; 302 303 typedef DECLCALLBACK(void) FNVBOXVRSCRCOMPOSITOR_ENTRY_RELEASED(const struct VBOXVR_SCR_COMPOSITOR *pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pReplacingEntry); 304 typedef FNVBOXVRSCRCOMPOSITOR_ENTRY_RELEASED *PFNVBOXVRSCRCOMPOSITOR_ENTRY_RELEASED; 305 306 299 307 typedef struct VBOXVR_SCR_COMPOSITOR_ENTRY 300 308 { … … 308 316 PRTRECT paDstRects; 309 317 PRTRECT paDstUnstretchedRects; 318 PFNVBOXVRSCRCOMPOSITOR_ENTRY_RELEASED pfnEntryReleased; 310 319 } VBOXVR_SCR_COMPOSITOR_ENTRY, *PVBOXVR_SCR_COMPOSITOR_ENTRY; 311 320 … … 325 334 } VBOXVR_SCR_COMPOSITOR, *PVBOXVR_SCR_COMPOSITOR; 326 335 336 327 337 typedef DECLCALLBACK(bool) FNVBOXVRSCRCOMPOSITOR_VISITOR(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, void *pvVisitor); 328 338 typedef FNVBOXVRSCRCOMPOSITOR_VISITOR *PFNVBOXVRSCRCOMPOSITOR_VISITOR; 329 339 330 DECLINLINE(void) CrVrScrCompositorEntryInit(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const VBOXVR_TEXTURE *pTex )340 DECLINLINE(void) CrVrScrCompositorEntryInit(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const VBOXVR_TEXTURE *pTex, PFNVBOXVRSCRCOMPOSITOR_ENTRY_RELEASED pfnEntryReleased) 331 341 { 332 342 VBoxVrCompositorEntryInit(&pEntry->Ce); 333 343 pEntry->Tex = *pTex; 334 344 memset(&pEntry->Pos, 0, sizeof (VBOXVR_SCR_COMPOSITOR_ENTRY) - RT_OFFSETOF(VBOXVR_SCR_COMPOSITOR_ENTRY, Pos)); 345 pEntry->pfnEntryReleased = pfnEntryReleased; 335 346 } 336 347 -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_misc.c
r46757 r46966 126 126 WRITE_DATA( 0, GLint, size ); 127 127 WRITE_DATA( 4, GLenum, CR_VBOXTEXPRESENT_EXTEND_OPCODE ); 128 WRITE_DATA( 8, GL int, texture );129 WRITE_DATA( 12, GL int, cfg );128 WRITE_DATA( 8, GLuint, texture ); 129 WRITE_DATA( 12, GLuint, cfg ); 130 130 WRITE_DATA( 16, GLint, xPos ); 131 131 WRITE_DATA( 20, GLint, yPos ); -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c
r46395 r46966 112 112 { 113 113 s->refCount--; 114 Assert(s->refCount >= 0); 114 115 if (s->refCount <= 0) { 115 116 if (s==gSharedState) … … 125 126 } 126 127 #ifndef IN_GUEST 127 else 128 else if (pContext) 128 129 { 129 130 /* evaluate usage bits*/ … … 137 138 } 138 139 #endif 140 } 141 142 DECLEXPORT(CRSharedState *) crStateGlobalSharedAcquire() 143 { 144 if (!gSharedState) 145 { 146 crWarning("No Global Shared State!"); 147 return NULL; 148 } 149 gSharedState->refCount++; 150 return gSharedState; 151 } 152 153 DECLEXPORT(void) crStateGlobalSharedRelease() 154 { 155 crStateFreeShared(NULL, gSharedState); 139 156 } 140 157 -
trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp
r46885 r46966 1165 1165 } 1166 1166 1167 VBOXVREGDECL(void) VBoxVrCompositorInit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_ENTRY_RE MOVED pfnEntryRemoved)1167 VBOXVREGDECL(void) VBoxVrCompositorInit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_ENTRY_RELEASED pfnEntryReleased) 1168 1168 { 1169 1169 RTListInit(&pCompositor->List); 1170 pCompositor->pfnEntryRe moved = pfnEntryRemoved;1170 pCompositor->pfnEntryReleased = pfnEntryReleased; 1171 1171 } 1172 1172 … … 1190 1190 } 1191 1191 1192 DECLINLINE(void) vboxVrCompositorEntryRelease(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry) 1193 { 1194 if (--pEntry->cRefs) 1195 { 1196 Assert(pEntry->cRefs < UINT32_MAX/2); 1197 return; 1198 } 1199 1200 Assert(!VBoxVrCompositorEntryIsInList(pEntry)); 1201 1202 if (pCompositor->pfnEntryReleased) 1203 pCompositor->pfnEntryReleased(pCompositor, pEntry, pReplacingEntry); 1204 } 1205 1206 DECLINLINE(void) vboxVrCompositorEntryAcquire(PVBOXVR_COMPOSITOR_ENTRY pEntry) 1207 { 1208 ++pEntry->cRefs; 1209 } 1210 1192 1211 DECLINLINE(void) vboxVrCompositorEntryAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry) 1193 1212 { 1194 1213 RTListPrepend(&pCompositor->List, &pEntry->Node); 1214 vboxVrCompositorEntryAcquire(pEntry); 1195 1215 } 1196 1216 … … 1198 1218 { 1199 1219 RTListNodeRemove(&pEntry->Node); 1200 if (pCompositor->pfnEntryRemoved) 1201 pCompositor->pfnEntryRemoved(pCompositor, pEntry, pReplacingEntry); 1220 vboxVrCompositorEntryRelease(pCompositor, pEntry, pReplacingEntry); 1202 1221 } 1203 1222 … … 1205 1224 { 1206 1225 VBoxVrListInit(&pEntry->Vr); 1226 pEntry->cRefs = 0; 1207 1227 } 1208 1228 1209 1229 VBOXVREGDECL(bool) VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry) 1210 1230 { 1231 vboxVrCompositorEntryAcquire(pEntry); 1232 1211 1233 if (!VBoxVrCompositorEntryIsInList(pEntry)) 1234 { 1235 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1212 1236 return false; 1237 } 1213 1238 VBoxVrListClear(&pEntry->Vr); 1214 1239 vboxVrCompositorEntryRemove(pCompositor, pEntry, NULL); 1240 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1215 1241 return true; 1216 1242 } … … 1219 1245 { 1220 1246 bool fChanged; 1247 vboxVrCompositorEntryAcquire(pEntry); 1248 1221 1249 int rc = VBoxVrListRectsSubst(&pEntry->Vr, cRects, paRects, &fChanged); 1222 1250 if (RT_SUCCESS(rc)) … … 1229 1257 if (pfChanged) 1230 1258 *pfChanged = false; 1231 return VINF_SUCCESS; 1232 } 1233 1234 WARN(("VBoxVrListRectsSubst failed, rc %d", rc)); 1259 } 1260 else 1261 WARN(("VBoxVrListRectsSubst failed, rc %d", rc)); 1262 1263 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1235 1264 return rc; 1236 1265 } … … 1242 1271 int rc = VINF_SUCCESS; 1243 1272 1273 if (pEntry) 1274 vboxVrCompositorEntryAcquire(pEntry); 1275 1244 1276 if (!cRects) 1245 1277 { 1246 1278 if (pfChangeFlags) 1247 1279 *pfChangeFlags = 0; 1280 if (pEntry) 1281 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1248 1282 return VINF_SUCCESS; 1249 1283 } … … 1260 1294 if (pfChangeFlags) 1261 1295 *pfChangeFlags = 0; 1296 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1262 1297 return VINF_SUCCESS; 1263 1298 } … … 1266 1301 { 1267 1302 WARN(("VBoxVrListRectsAdd failed, rc %d", rc)); 1303 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1268 1304 return rc; 1269 1305 } … … 1310 1346 AssertRC(rc); 1311 1347 1312 if (pEntry && !fEntryWasInList) 1313 { 1314 Assert(!VBoxVrListIsEmpty(&pEntry->Vr)); 1315 vboxVrCompositorEntryAdd(pCompositor, pEntry); 1348 if (pEntry) 1349 { 1350 if (!fEntryWasInList) 1351 { 1352 Assert(!VBoxVrListIsEmpty(&pEntry->Vr)); 1353 vboxVrCompositorEntryAdd(pCompositor, pEntry); 1354 } 1355 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1316 1356 } 1317 1357 … … 1348 1388 } 1349 1389 1390 vboxVrCompositorEntryAcquire(pEntry); 1391 1350 1392 if (VBoxVrListIsEmpty(&pEntry->Vr)) 1351 1393 { 1352 1394 if (pfChanged) 1353 1395 *pfChanged = false; 1396 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1354 1397 return VINF_SUCCESS; 1355 1398 … … 1357 1400 1358 1401 int rc = vboxVrCompositorEntryRegionsSubst(pCompositor, pEntry, cRects, paRects, pfChanged); 1359 if (RT_SUCCESS(rc)) 1360 return VINF_SUCCESS; 1361 1362 WARN(("pfChanged failed, rc %d", rc)); 1402 if (!RT_SUCCESS(rc)) 1403 WARN(("pfChanged failed, rc %d", rc)); 1404 1405 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1406 1363 1407 return rc; 1364 1408 } … … 1373 1417 return VERR_INVALID_PARAMETER; 1374 1418 } 1419 1420 vboxVrCompositorEntryAcquire(pEntry); 1375 1421 1376 1422 bool fChanged = false, fCurChanged = false; … … 1382 1428 rc = VBoxVrCompositorEntryRegionsAdd(pCompositor, pEntry, cRects, paRects, NULL, &fChangeFlags); 1383 1429 if (RT_SUCCESS(rc)) 1430 { 1384 1431 fChanged |= !!fChangeFlags; 1432 if (pfChanged) 1433 *pfChanged = fChanged; 1434 } 1385 1435 else 1386 {1387 1436 WARN(("VBoxVrCompositorEntryRegionsAdd failed, rc %d", rc)); 1388 return rc; 1389 } 1390 1391 AssertRC(rc); 1437 1438 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1439 1440 return VINF_SUCCESS; 1441 } 1442 1443 VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, const VBOXVR_LIST *pList2, bool *pfChanged) 1444 { 1445 int rc = VINF_SUCCESS; 1446 bool fChanged = false; 1447 1448 vboxVrCompositorEntryAcquire(pEntry); 1449 1450 if (VBoxVrCompositorEntryIsInList(pEntry)) 1451 { 1452 rc = VBoxVrListIntersect(&pEntry->Vr, pList2, &fChanged); 1453 if (RT_SUCCESS(rc)) 1454 { 1455 if (VBoxVrListIsEmpty(&pEntry->Vr)) 1456 { 1457 Assert(fChanged); 1458 vboxVrCompositorEntryRemove(pCompositor, pEntry, NULL); 1459 } 1460 } 1461 else 1462 { 1463 WARN(("VBoxVrListRectsIntersect failed, rc %d", rc)); 1464 } 1465 } 1392 1466 1393 1467 if (pfChanged) 1394 1468 *pfChanged = fChanged; 1395 return VINF_SUCCESS; 1396 } 1397 1398 VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, const VBOXVR_LIST *pList2, bool *pfChanged) 1469 1470 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1471 1472 return rc; 1473 } 1474 1475 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRects, const RTRECT *paRects, bool *pfChanged) 1399 1476 { 1400 1477 int rc = VINF_SUCCESS; 1401 1478 bool fChanged = false; 1479 1480 vboxVrCompositorEntryAcquire(pEntry); 1481 1402 1482 if (VBoxVrCompositorEntryIsInList(pEntry)) 1403 1483 { 1404 rc = VBoxVrList Intersect(&pEntry->Vr, pList2, &fChanged);1484 rc = VBoxVrListRectsIntersect(&pEntry->Vr, cRects, paRects, &fChanged); 1405 1485 if (RT_SUCCESS(rc)) 1406 1486 { … … 1420 1500 *pfChanged = fChanged; 1421 1501 1422 return rc; 1423 } 1424 1425 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRects, const RTRECT *paRects, bool *pfChanged) 1426 { 1427 int rc = VINF_SUCCESS; 1428 bool fChanged = false; 1429 if (VBoxVrCompositorEntryIsInList(pEntry)) 1430 { 1431 rc = VBoxVrListRectsIntersect(&pEntry->Vr, cRects, paRects, &fChanged); 1432 if (RT_SUCCESS(rc)) 1433 { 1434 if (VBoxVrListIsEmpty(&pEntry->Vr)) 1435 { 1436 Assert(fChanged); 1437 vboxVrCompositorEntryRemove(pCompositor, pEntry, NULL); 1438 } 1439 } 1440 else 1441 { 1442 WARN(("VBoxVrListRectsIntersect failed, rc %d", rc)); 1443 } 1444 } 1445 1446 if (pfChanged) 1447 *pfChanged = fChanged; 1502 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1448 1503 1449 1504 return rc; … … 1518 1573 } 1519 1574 1575 vboxVrCompositorEntryAcquire(pEntry); 1576 1520 1577 if ((!x && !y) 1521 1578 || !VBoxVrCompositorEntryIsInList(pEntry)) … … 1523 1580 if (pfChanged) 1524 1581 *pfChanged = false; 1582 1583 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1525 1584 return VINF_SUCCESS; 1526 1585 } … … 1574 1633 if (paRects) 1575 1634 RTMemFree(paRects); 1635 1636 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1576 1637 1577 1638 return rc; … … 2262 2323 } 2263 2324 2325 static DECLCALLBACK(void) crVrScrCompositorEntryReleasedCB(const struct VBOXVR_COMPOSITOR *pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry) 2326 { 2327 PVBOXVR_SCR_COMPOSITOR_ENTRY pCEntry = VBOXVR_SCR_COMPOSITOR_ENTRY_FROM_ENTRY(pEntry); 2328 CrVrScrCompositorEntrySetChanged(pCEntry, true); 2329 2330 if (pCEntry->pfnEntryReleased) 2331 { 2332 PVBOXVR_SCR_COMPOSITOR_ENTRY pCReplacingEntry = pReplacingEntry ? VBOXVR_SCR_COMPOSITOR_ENTRY_FROM_ENTRY(pReplacingEntry) : NULL; 2333 PVBOXVR_SCR_COMPOSITOR pCConpositor = VBOXVR_SCR_COMPOSITOR_FROM_COMPOSITOR(pCompositor); 2334 pCEntry->pfnEntryReleased(pCConpositor, pCEntry, pCReplacingEntry); 2335 } 2336 } 2337 2264 2338 VBOXVREGDECL(void) CrVrScrCompositorInit(PVBOXVR_SCR_COMPOSITOR pCompositor) 2265 2339 { 2266 2340 memset(pCompositor, 0, sizeof (*pCompositor)); 2267 VBoxVrCompositorInit(&pCompositor->Compositor, NULL);2341 VBoxVrCompositorInit(&pCompositor->Compositor, crVrScrCompositorEntryReleasedCB); 2268 2342 pCompositor->fFlags = CRBLT_F_LINEAR | CRBLT_F_INVERT_YCOORDS; 2269 2343 #ifndef IN_RING0 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r46885 r46966 140 140 } 141 141 142 void CrDpEntryInit(PCR_DISPLAY_ENTRY pEntry, const VBOXVR_TEXTURE *pTextureData) 143 { 144 CrVrScrCompositorEntryInit(&pEntry->CEntry, pTextureData); 142 #define PCR_DISPLAY_ENTRY_FROM_CENTRY(_pe) ((PCR_DISPLAY_ENTRY)((uint8_t*)(_pe) - RT_OFFSETOF(CR_DISPLAY_ENTRY, CEntry))) 143 static DECLCALLBACK(void) crDpEntryCEntryReleaseCB(const struct VBOXVR_SCR_COMPOSITOR *pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pReplacingEntry) 144 { 145 PCR_DISPLAY_ENTRY pCEntry = PCR_DISPLAY_ENTRY_FROM_CENTRY(pEntry); 146 CrDemEntryRelease(pCEntry); 147 } 148 149 void CrDpEntryInit(PCR_DISPLAY_ENTRY pEntry, const VBOXVR_TEXTURE *pTextureData, void *pvUserData1, void *pvUserData2) 150 { 151 CrVrScrCompositorEntryInit(&pEntry->CEntry, pTextureData, crDpEntryCEntryReleaseCB); 145 152 CrVrScrCompositorEntryFlagsSet(&pEntry->CEntry, CRBLT_F_INVERT_SRC_YCOORDS); 146 CrVrScrCompositorEntryInit(&pEntry->RootVrCEntry, pTextureData );153 CrVrScrCompositorEntryInit(&pEntry->RootVrCEntry, pTextureData, NULL); 147 154 CrVrScrCompositorEntryFlagsSet(&pEntry->RootVrCEntry, CRBLT_F_INVERT_SRC_YCOORDS); 155 pEntry->pvUserData1 = pvUserData1; 156 pEntry->pvUserData2 = pvUserData2; 148 157 } 149 158 … … 175 184 } 176 185 186 void crDemEntryRelease(PCR_DISPLAY_ENTRY_MAP pMap, PCR_DISPLAY_ENTRY pEntry, bool fForceDelete) 187 { 188 CRTextureObj *pTobj = (CRTextureObj *)pEntry->pvUserData2; 189 if (!pTobj) 190 { 191 crWarning("Trying to release entry that does not have tobj specified"); 192 return; 193 } 194 195 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pTobj, cr_server.MainContextInfo.pContext); 196 197 bool fDeleteEntry = fForceDelete; 198 GLuint idTexture = pTobj->id; 199 200 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pTobj)) 201 { 202 CRSharedState *pShared = crStateGlobalSharedAcquire(); 203 204 CRASSERT(pShared); 205 /* on the host side, we need to delete an ogl texture object here as well, which crStateDeleteTextureCallback will do 206 * in addition to calling crStateDeleteTextureObject to delete a state object */ 207 crHashtableDelete(pShared->textureTable, idTexture, crStateDeleteTextureCallback); 208 209 crStateGlobalSharedRelease(); 210 211 fDeleteEntry = true; 212 } 213 else 214 { 215 /* this is something we would not generally expect */ 216 CRASSERT(!fForceDelete); 217 } 218 219 if (fDeleteEntry) 220 { 221 if (pMap) 222 crHashtableDelete(pMap->pTextureMap, idTexture, crFree); 223 else 224 crFree(pEntry); /* <- when called from crDemTermEntryCb */ 225 226 crStateGlobalSharedRelease(); 227 } 228 } 229 230 void crDemTermEntryCb(void *pvEntry) 231 { 232 crDemEntryRelease(NULL, (PCR_DISPLAY_ENTRY)pvEntry, true); 233 } 234 177 235 void CrDemTerm(PCR_DISPLAY_ENTRY_MAP pMap) 178 236 { 179 crFreeHashtable(pMap->pTextureMap, crFree); 180 } 181 182 PCR_DISPLAY_ENTRY CrDemEntryGetCreate(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture, CRContextInfo *pCtxInfo) 237 crFreeHashtable(pMap->pTextureMap, crDemTermEntryCb); 238 } 239 240 void CrDemEntryRelease(PCR_DISPLAY_ENTRY pEntry) 241 { 242 PCR_DISPLAY_ENTRY_MAP pMap = (PCR_DISPLAY_ENTRY_MAP)pEntry->pvUserData1; 243 Assert(pMap); 244 crDemEntryRelease(pMap, pEntry, false); 245 } 246 247 PCR_DISPLAY_ENTRY CrDemEntryAcquire(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture) 183 248 { 184 249 PCR_DISPLAY_ENTRY pEntry = (PCR_DISPLAY_ENTRY)crHashtableSearch(pMap->pTextureMap, idTexture); … … 186 251 return pEntry; 187 252 188 CR Context *pContext = pCtxInfo->pContext;189 if (!p Context)190 { 191 crWarning("p Contextis null!");253 CRSharedState *pShared = crStateGlobalSharedAcquire(); 254 if (!pShared) 255 { 256 crWarning("pShared is null!"); 192 257 return NULL; 193 258 } 194 259 195 CRTextureObj *pTobj = (CRTextureObj*)crHashtableSearch(p Context->shared->textureTable, idTexture);260 CRTextureObj *pTobj = (CRTextureObj*)crHashtableSearch(pShared->textureTable, idTexture); 196 261 if (!pTobj) 197 262 { 198 263 crWarning("pTobj is null!"); 264 crStateGlobalSharedRelease(); 199 265 return NULL; 200 266 } 267 268 Assert(pTobj->id == idTexture); 201 269 202 270 GLuint hwId = crStateGetTextureObjHWID(pTobj); … … 204 272 { 205 273 crWarning("hwId is null!"); 274 crStateGlobalSharedRelease(); 206 275 return NULL; 207 276 } … … 217 286 { 218 287 crWarning("crAlloc failed allocating CR_DISPLAY_ENTRY"); 288 crStateGlobalSharedRelease(); 219 289 return NULL; 220 290 } 221 291 222 CrDpEntryInit(pEntry, &TextureData); 292 CrDpEntryInit(pEntry, &TextureData, pMap, pTobj); 293 294 /* just use main context info's context to hold the texture reference */ 295 CR_STATE_SHAREDOBJ_USAGE_SET(pTobj, cr_server.MainContextInfo.pContext); 223 296 224 297 crHashtableAdd(pMap->pTextureMap, idTexture, pEntry); … … 226 299 227 300 } 228 301 #if 0 229 302 void CrDemEntryDestroy(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture) 230 303 { … … 243 316 crHashtableDelete(pMap->pTextureMap, idTexture, crFree); 244 317 } 245 318 #endif 246 319 PCR_DISPLAY crServerDisplayGetInitialized(uint32_t idScreen) 247 320 { … … 412 485 if (texture) 413 486 { 414 pEntry = CrDemEntry GetCreate(&cr_server.PresentTexturepMap, texture, cr_server.currentCtxInfo);487 pEntry = CrDemEntryAcquire(&cr_server.PresentTexturepMap, texture); 415 488 if (!pEntry) 416 489 { 417 crWarning("CrDemEntry GetCreate Failed");490 crWarning("CrDemEntryAcquire Failed"); 418 491 return; 419 492 } … … 428 501 if (!RT_SUCCESS(rc)) 429 502 { 430 crWarning("CrDpEntrySetRegions Failed rc %d", rc); 503 crWarning("CrDpEntryRegionsAdd Failed rc %d", rc); 504 // if (pEntry) 505 // CrDemEntryRelease(pEntry); 431 506 return; 432 507 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
r46885 r46966 55 55 Tex.target = GL_TEXTURE_2D; 56 56 Tex.hwid = 0; 57 CrVrScrCompositorEntryInit(&mural->DefaultDEntry.CEntry, &Tex );57 CrVrScrCompositorEntryInit(&mural->DefaultDEntry.CEntry, &Tex, NULL); 58 58 59 59 if (cr_server.fRootVrOn) 60 60 { 61 CrVrScrCompositorEntryInit(&mural->DefaultDEntry.RootVrCEntry, &Tex );61 CrVrScrCompositorEntryInit(&mural->DefaultDEntry.RootVrCEntry, &Tex, NULL); 62 62 mural->fRootVrOn = GL_TRUE; 63 63 } … … 407 407 { 408 408 CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry); 409 CrVrScrCompositorEntryInit(&pDEntry->RootVrCEntry, CrVrScrCompositorEntryTexGet(pEntry) );409 CrVrScrCompositorEntryInit(&pDEntry->RootVrCEntry, CrVrScrCompositorEntryTexGet(pEntry), NULL); 410 410 return &pDEntry->RootVrCEntry; 411 411 } … … 416 416 417 417 crServerVBoxRootVrTranslateForMural(mural); 418 419 /* ensure the rootvr compositor does not hold any data, 420 * i.e. cleanup all rootvr entries data */ 421 CrVrScrCompositorClear(&mural->RootVrCompositor); 418 422 419 423 rc = CrVrScrCompositorIntersectedList(&mural->Compositor, &cr_server.RootVr, &mural->RootVrCompositor, crServerMuralGetRootVrCEntry, NULL, NULL); … … 468 472 goto end; 469 473 } 470 CrVrScrCompositorEntryInit(&mural->DefaultDEntry.CEntry, &Tex );474 CrVrScrCompositorEntryInit(&mural->DefaultDEntry.CEntry, &Tex, NULL); 471 475 /* initially set regions to all visible since this is what some guest assume 472 476 * and will not post any more visible regions command */
Note:
See TracChangeset
for help on using the changeset viewer.