Changeset 30916 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Wine
- Timestamp:
- Jul 19, 2010 8:32:01 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Wine
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/Makefile.kmk
r30721 r30916 186 186 VBoxD3D8_DEFS += WINE_NO_DEBUG_MSGS 187 187 endif 188 #ifdef VBOXWDDM 189 # VBoxD3D8_DEFS += VBOXWDDM IN_VBOXWINEEX 190 #endif 188 191 VBoxD3D8_INCS := $(PATH_SUB_CURRENT)/include 189 192 VBoxD3D8_SOURCES := \ … … 206 209 $(PATH_LIB)/libWine$(VBOX_SUFF_LIB) \ 207 210 $(PATH_LIB)/wined3d$(VBOX_SUFF_LIB) 208 209 211 DLLS += VBoxD3D9 210 212 … … 220 222 ifneq ($(KBUILD_TYPE),debug) 221 223 VBoxD3D9_DEFS += WINE_NO_DEBUG_MSGS 224 endif 225 ifdef VBOXWDDM 226 VBoxD3D9_DEFS += VBOXWDDM IN_VBOXWINEEX 222 227 endif 223 228 VBoxD3D9_INCS := $(PATH_SUB_CURRENT)/include -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9.def
r20612 r30916 15 15 Direct3DCreate9@4=Direct3DCreate9 16 16 Direct3DCreate9Ex@8=Direct3DCreate9Ex 17 VBoxWineExD3DDev9CreateTexture -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9_private.h
r28475 r30916 47 47 #include "d3d9.h" 48 48 #include "wine/wined3d.h" 49 50 #ifdef VBOXWDDM 51 #include "../vbox/VBoxWineEx.h" 52 #endif 49 53 50 54 /* =========================================================================== … … 316 320 HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *device, 317 321 UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level, 318 DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality) DECLSPEC_HIDDEN; 322 DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality 323 #ifdef VBOXWDDM 324 , HANDLE *shared_handle 325 , void *pvClientMem 326 #endif 327 ) DECLSPEC_HIDDEN; 319 328 320 329 /* ---------------------- */ … … 428 437 429 438 HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *device, 430 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN; 439 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool 440 #ifdef VBOXWDDM 441 , HANDLE *shared_handle 442 , void *pvClientMem 443 #endif 444 ) DECLSPEC_HIDDEN; 431 445 432 446 /* ----------------------- */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/device.c
r28475 r30916 713 713 } 714 714 715 #ifdef VBOXWDDM 716 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DDev9CreateTexture(IDirect3DDevice9Ex *iface, 717 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, 718 D3DPOOL pool, IDirect3DTexture9 **texture, HANDLE *shared_handle, 719 void *pvClientMem) /* <- extension arg to pass in the client memory buffer, 720 * applicable ONLY for SYSMEM textures */ 721 { 722 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; 723 IDirect3DTexture9Impl *object; 724 HRESULT hr; 725 726 TRACE("iface %p, width %u, height %u, levels %u, usage %#x, format %#x, pool %#x, texture %p, shared_handle %p.\n", 727 iface, width, height, levels, usage, format, pool, texture, shared_handle); 728 729 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); 730 if (!object) 731 { 732 ERR("Failed to allocate texture memory.\n"); 733 return D3DERR_OUTOFVIDEOMEMORY; 734 } 735 736 hr = texture_init(object, This, width, height, levels, usage, format, pool 737 #ifdef VBOXWDDM 738 , shared_handle 739 , pvClientMem 740 #endif 741 ); 742 if (FAILED(hr)) 743 { 744 WARN("Failed to initialize texture, hr %#x.\n", hr); 745 HeapFree(GetProcessHeap(), 0, object); 746 return hr; 747 } 748 749 TRACE("Created texture %p.\n", object); 750 *texture = (IDirect3DTexture9 *)object; 751 752 return D3D_OK; 753 } 754 #endif 755 715 756 static HRESULT WINAPI IDirect3DDevice9Impl_CreateTexture(IDirect3DDevice9Ex *iface, 716 757 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, 717 758 D3DPOOL pool, IDirect3DTexture9 **texture, HANDLE *shared_handle) 718 759 { 760 #ifdef VBOXWDDM 761 return VBoxWineExD3DDev9CreateTexture(iface, width, height, levels, usage, format, 762 pool, texture, shared_handle, NULL); 763 #else 719 764 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; 720 765 IDirect3DTexture9Impl *object; … … 743 788 744 789 return D3D_OK; 790 #endif 745 791 } 746 792 … … 873 919 } 874 920 875 static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, 921 #ifdef VBOXWDDM 922 HRESULT VBoxWineExD3DDev9CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, 876 923 D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface, 877 UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality) 924 UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality 925 , HANDLE *shared_handle 926 , void *pvClientMem 927 ) 878 928 { 879 929 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; … … 894 944 895 945 hr = surface_init(object, This, Width, Height, Format, Lockable, Discard, 896 Level, Usage, Pool, MultiSample, MultisampleQuality); 946 Level, Usage, Pool, MultiSample, MultisampleQuality, 947 shared_handle, pvClientMem); 897 948 if (FAILED(hr)) 898 949 { … … 906 957 907 958 return D3D_OK; 959 } 960 #endif 961 static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, 962 D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface, 963 UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality) 964 { 965 #ifdef VBOXWDDM 966 return VBoxWineExD3DDev9CreateSurface(iface, Width, Height, Format, Lockable, Discard, Level, ppSurface, 967 Usage, Pool, MultiSample, MultisampleQuality, NULL, NULL); 968 #else 969 IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; 970 IDirect3DSurface9Impl *object; 971 HRESULT hr; 972 973 TRACE("iface %p, width %u, height %u, format %#x, lockable %#x, discard %#x, level %u, surface %p.\n" 974 "usage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n", 975 iface, Width, Height, Format, Lockable, Discard, Level, ppSurface, 976 Usage, Pool, MultiSample, MultisampleQuality); 977 978 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DSurface9Impl)); 979 if (!object) 980 { 981 FIXME("Failed to allocate surface memory.\n"); 982 return D3DERR_OUTOFVIDEOMEMORY; 983 } 984 985 hr = surface_init(object, This, Width, Height, Format, Lockable, Discard, 986 Level, Usage, Pool, MultiSample, MultisampleQuality); 987 if (FAILED(hr)) 988 { 989 WARN("Failed to initialize surface, hr %#x.\n", hr); 990 HeapFree(GetProcessHeap(), 0, object); 991 return hr; 992 } 993 994 TRACE("Created surface %p.\n", object); 995 *ppSurface = (IDirect3DSurface9 *)object; 996 997 return D3D_OK; 998 #endif 908 999 } 909 1000 … … 2630 2721 static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParent *iface, 2631 2722 IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, DWORD usage, 2632 WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface **surface) 2723 WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface **surface 2724 #ifdef VBOXWDDM 2725 , HANDLE *shared_handle 2726 , void *pvClientMem 2727 #endif 2728 ) 2633 2729 { 2634 2730 struct IDirect3DDevice9Impl *This = device_from_device_parent(iface); … … 2644 2740 lockable = FALSE; 2645 2741 2742 #ifdef VBOXWDDM 2743 hr = VBoxWineExD3DDev9CreateSurface((IDirect3DDevice9Ex *)This, width, height, 2744 d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level, 2745 (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */ 2746 , shared_handle 2747 , pvClientMem 2748 ); 2749 2750 #else 2646 2751 hr = IDirect3DDevice9Impl_CreateSurface((IDirect3DDevice9Ex *)This, width, height, 2647 2752 d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level, 2648 (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */); 2753 (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */ 2754 ); 2755 #endif 2649 2756 if (FAILED(hr)) 2650 2757 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/surface.c
r25949 r30916 381 381 HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *device, 382 382 UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level, 383 DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality) 383 DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality 384 #ifdef VBOXWDDM 385 , HANDLE *shared_handle 386 , void *pvClientMem 387 #endif 388 ) 384 389 { 385 390 HRESULT hr; … … 412 417 413 418 wined3d_mutex_lock(); 419 #ifdef VBOXWDDM 420 hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format), 421 lockable, discard, level, &surface->wineD3DSurface, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, 422 multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface, 423 &d3d9_surface_wined3d_parent_ops 424 , shared_handle 425 , pvClientMem 426 ); 427 #else 414 428 hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format), 415 429 lockable, discard, level, &surface->wineD3DSurface, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, 416 430 multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface, 417 431 &d3d9_surface_wined3d_parent_ops); 432 #endif 418 433 wined3d_mutex_unlock(); 419 434 if (FAILED(hr)) -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/texture.c
r25949 r30916 398 398 399 399 HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *device, 400 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) 400 UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool 401 #ifdef VBOXWDDM 402 , HANDLE *shared_handle 403 , void *pvClientMem 404 #endif 405 ) 401 406 { 402 407 HRESULT hr; … … 406 411 407 412 wined3d_mutex_lock(); 413 #ifdef VBOXWDDM 414 hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels, 415 usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool, 416 &texture->wineD3DTexture, (IUnknown *)texture, &d3d9_texture_wined3d_parent_ops 417 , shared_handle 418 , pvClientMem); 419 #else 408 420 hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels, 409 421 usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool, 410 422 &texture->wineD3DTexture, (IUnknown *)texture, &d3d9_texture_wined3d_parent_ops); 423 #endif 424 411 425 wined3d_mutex_unlock(); 412 426 if (FAILED(hr)) -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wine/wined3d.h
r28475 r30916 2689 2689 UINT level, 2690 2690 WINED3DCUBEMAP_FACES face, 2691 IWineD3DSurface **surface); 2691 IWineD3DSurface **surface 2692 #ifdef VBOXWDDM 2693 , HANDLE *shared_handle 2694 , void *pvClientMem 2695 #endif 2696 ); 2692 2697 2693 2698 HRESULT (STDMETHODCALLTYPE *CreateRenderTarget)( … … 2742 2747 /*** IWineD3DDeviceParent methods ***/ 2743 2748 #define IWineD3DDeviceParent_WineD3DDeviceCreated(This,device) (This)->lpVtbl->WineD3DDeviceCreated(This,device) 2749 #ifdef VBOXWDDM 2750 #define IWineD3DDeviceParent_CreateSurface(This,superior,width,height,format,usage,pool,level,face,surface,shared_handle,pvClientMem) (This)->lpVtbl->CreateSurface(This,superior,width,height,format,usage,pool,level,face,surface,shared_handle,pvClientMem) 2751 #else 2744 2752 #define IWineD3DDeviceParent_CreateSurface(This,superior,width,height,format,usage,pool,level,face,surface) (This)->lpVtbl->CreateSurface(This,superior,width,height,format,usage,pool,level,face,surface) 2753 #endif 2745 2754 #define IWineD3DDeviceParent_CreateRenderTarget(This,superior,width,height,format,multisample_type,multisample_quality,lockable,surface) (This)->lpVtbl->CreateRenderTarget(This,superior,width,height,format,multisample_type,multisample_quality,lockable,surface) 2746 2755 #define IWineD3DDeviceParent_CreateDepthStencilSurface(This,superior,width,height,format,multisample_type,multisample_quality,discard,surface) (This)->lpVtbl->CreateDepthStencilSurface(This,superior,width,height,format,multisample_type,multisample_quality,discard,surface) … … 7356 7365 WINED3DSURFTYPE surface_type, 7357 7366 IUnknown *parent, 7358 const struct wined3d_parent_ops *parent_ops); 7367 const struct wined3d_parent_ops *parent_ops 7368 #ifdef VBOXWDDM 7369 , HANDLE *shared_handle 7370 , void *pvClientMem 7371 #endif 7372 ); 7359 7373 7360 7374 HRESULT (STDMETHODCALLTYPE *CreateRendertargetView)( … … 7374 7388 IWineD3DTexture **texture, 7375 7389 IUnknown *parent, 7376 const struct wined3d_parent_ops *parent_ops); 7390 const struct wined3d_parent_ops *parent_ops 7391 #ifdef VBOXWDDM 7392 , HANDLE *shared_handle 7393 , void *pvClientMem 7394 #endif 7395 ); 7377 7396 7378 7397 HRESULT (STDMETHODCALLTYPE *CreateVolumeTexture)( … … 8054 8073 #define IWineD3DDevice_CreateIndexBuffer(This,length,usage,pool,index_buffer,parent,parent_ops) (This)->lpVtbl->CreateIndexBuffer(This,length,usage,pool,index_buffer,parent,parent_ops) 8055 8074 #define IWineD3DDevice_CreateStateBlock(This,type,stateblock,parent) (This)->lpVtbl->CreateStateBlock(This,type,stateblock,parent) 8075 #ifdef VBOXWDDM 8076 #define IWineD3DDevice_CreateSurface(This,width,height,format,lockable,discard,level,surface,usage,pool,multisample_type,multisample_quality,surface_type,parent,parent_ops,shared_handle,pvClientMem) (This)->lpVtbl->CreateSurface(This,width,height,format,lockable,discard,level,surface,usage,pool,multisample_type,multisample_quality,surface_type,parent,parent_ops,shared_handle,pvClientMem) 8077 #else 8056 8078 #define IWineD3DDevice_CreateSurface(This,width,height,format,lockable,discard,level,surface,usage,pool,multisample_type,multisample_quality,surface_type,parent,parent_ops) (This)->lpVtbl->CreateSurface(This,width,height,format,lockable,discard,level,surface,usage,pool,multisample_type,multisample_quality,surface_type,parent,parent_ops) 8079 #endif 8057 8080 #define IWineD3DDevice_CreateRendertargetView(This,resource,parent,rendertarget_view) (This)->lpVtbl->CreateRendertargetView(This,resource,parent,rendertarget_view) 8081 #ifdef VBOXWDDM 8082 #define IWineD3DDevice_CreateTexture(This,width,height,levels,usage,format,pool,texture,parent,parent_ops,shared_handle,pvClientMem) (This)->lpVtbl->CreateTexture(This,width,height,levels,usage,format,pool,texture,parent,parent_ops,shared_handle,pvClientMem) 8083 #else 8058 8084 #define IWineD3DDevice_CreateTexture(This,width,height,levels,usage,format,pool,texture,parent,parent_ops) (This)->lpVtbl->CreateTexture(This,width,height,levels,usage,format,pool,texture,parent,parent_ops) 8085 #endif 8059 8086 #define IWineD3DDevice_CreateVolumeTexture(This,width,height,depth,levels,usage,format,pool,texture,parent,parent_ops) (This)->lpVtbl->CreateVolumeTexture(This,width,height,depth,levels,usage,format,pool,texture,parent,parent_ops) 8060 8087 #define IWineD3DDevice_CreateVolume(This,width,height,depth,usage,format,pool,volume,parent,parent_ops) (This)->lpVtbl->CreateVolume(This,width,height,depth,usage,format,pool,volume,parent,parent_ops) -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/basetexture.c
r28475 r30916 44 44 45 45 hr = resource_init((IWineD3DResource *)texture, resource_type, device, 46 size, usage, format_desc, pool, parent, parent_ops); 46 size, usage, format_desc, pool, parent, parent_ops 47 #ifdef VBOXWDDM 48 , NULL, NULL /* <- no need this info here */ 49 #endif 50 ); 47 51 if (FAILED(hr)) 48 52 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/buffer.c
r28475 r30916 1473 1473 1474 1474 hr = resource_init((IWineD3DResource *)buffer, WINED3DRTYPE_BUFFER, 1475 device, size, usage, format_desc, pool, parent, parent_ops); 1475 device, size, usage, format_desc, pool, parent, parent_ops 1476 #ifdef VBOXWDDM 1477 , NULL, NULL /* <- no need this info here so far */ 1478 #endif 1479 ); 1476 1480 if (FAILED(hr)) 1477 1481 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/cubetexture.c
r28475 r30916 535 535 }; 536 536 537 #ifdef VBOXWDDM 537 538 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w, 538 format, usage, pool, i /* Level */, j, &texture->surfaces[j][i]); 539 format, usage, pool, i /* Level */, j, &texture->surfaces[j][i] 540 , NULL, NULL /* <- no need this info here */ 541 ); 542 #else 543 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w, 544 format, usage, pool, i /* Level */, j, &texture->surfaces[j][i] 545 ); 546 #endif 539 547 if (FAILED(hr)) 540 548 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/device.c
r28475 r30916 802 802 WINED3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IWineD3DSurface **ppSurface, 803 803 DWORD Usage, WINED3DPOOL Pool, WINED3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, 804 WINED3DSURFTYPE Impl, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 804 WINED3DSURFTYPE Impl, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 805 #ifdef VBOXWDDM 806 , HANDLE *shared_handle 807 , void *pvClientMem 808 #endif 809 ) 805 810 { 806 811 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; … … 828 833 829 834 hr = surface_init(object, Impl, This->surface_alignment, Width, Height, Level, Lockable, 830 Discard, MultiSample, MultisampleQuality, This, Usage, Format, Pool, parent, parent_ops); 835 Discard, MultiSample, MultisampleQuality, This, Usage, Format, Pool, parent, parent_ops 836 #ifdef VBOXWDDM 837 , shared_handle 838 , pvClientMem 839 #endif 840 ); 831 841 if (FAILED(hr)) 832 842 { … … 868 878 static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, 869 879 UINT Width, UINT Height, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, 870 IWineD3DTexture **ppTexture, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 880 IWineD3DTexture **ppTexture, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 881 #ifdef VBOXWDDM 882 , HANDLE *shared_handle 883 , void *pvClientMem 884 #endif 885 ) 871 886 { 872 887 IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; … … 886 901 } 887 902 888 hr = texture_init(object, Width, Height, Levels, This, Usage, Format, Pool, parent, parent_ops); 903 hr = texture_init(object, Width, Height, Levels, This, Usage, Format, Pool, parent, parent_ops 904 #ifdef VBOXWDDM 905 , shared_handle 906 , pvClientMem 907 #endif 908 ); 889 909 if (FAILED(hr)) 890 910 { … … 1420 1440 } 1421 1441 1442 #ifdef VBOXWDDM 1443 hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *)This, bm.bmWidth, bm.bmHeight, WINED3DFMT_B5G6R5_UNORM, TRUE, 1444 FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL, 1445 NULL, &wined3d_null_parent_ops, NULL, NULL); 1446 #else 1422 1447 hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *)This, bm.bmWidth, bm.bmHeight, WINED3DFMT_B5G6R5_UNORM, TRUE, 1423 1448 FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL, 1424 1449 NULL, &wined3d_null_parent_ops); 1450 #endif 1425 1451 if(FAILED(hr)) { 1426 1452 ERR("Wine logo requested, but failed to create surface\n"); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/resource.c
r28475 r30916 39 39 HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type, 40 40 IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct wined3d_format_desc *format_desc, 41 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 41 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 42 #ifdef VBOXWDDM 43 , HANDLE *shared_handle 44 , void *pvClientMem 45 #endif 46 ) 42 47 { 43 48 struct IWineD3DResourceClass *resource = &((IWineD3DResourceImpl *)iface)->resource; … … 55 60 list_init(&resource->privateData); 56 61 57 if (size) 58 { 59 resource->heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + RESOURCE_ALIGNMENT); 60 if (!resource->heapMemory) 61 { 62 ERR("Out of memory!\n"); 63 return WINED3DERR_OUTOFVIDEOMEMORY; 64 } 62 #ifdef VBOXWDDM 63 if (pool == WINED3DPOOL_SYSTEMMEM && pvClientMem) 64 { 65 resource->allocatedMemory = pvClientMem; 66 resource->heapMemory = NULL; 65 67 } 66 68 else 67 { 68 resource->heapMemory = NULL; 69 } 70 resource->allocatedMemory = (BYTE *)(((ULONG_PTR)resource->heapMemory + (RESOURCE_ALIGNMENT - 1)) & ~(RESOURCE_ALIGNMENT - 1)); 69 #endif 70 { 71 if (size) 72 { 73 resource->heapMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + RESOURCE_ALIGNMENT); 74 if (!resource->heapMemory) 75 { 76 ERR("Out of memory!\n"); 77 return WINED3DERR_OUTOFVIDEOMEMORY; 78 } 79 } 80 else 81 { 82 resource->heapMemory = NULL; 83 } 84 resource->allocatedMemory = (BYTE *)(((ULONG_PTR)resource->heapMemory + (RESOURCE_ALIGNMENT - 1)) & ~(RESOURCE_ALIGNMENT - 1)); 85 } 71 86 72 87 /* Check that we have enough video ram left */ -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c
r28475 r30916 356 356 UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type, 357 357 UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, 358 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 358 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 359 #ifdef VBOXWDDM 360 , HANDLE *shared_handle 361 , void *pvClientMem 362 #endif 363 ) 359 364 { 360 365 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; … … 393 398 394 399 hr = resource_init((IWineD3DResource *)surface, WINED3DRTYPE_SURFACE, 395 device, resource_size, usage, format_desc, pool, parent, parent_ops); 400 device, resource_size, usage, format_desc, pool, parent, parent_ops 401 #ifdef VBOXWDDM 402 , shared_handle 403 , pvClientMem 404 #endif 405 ); 396 406 if (FAILED(hr)) 397 407 { … … 412 422 /* Flags */ 413 423 surface->Flags = SFLAG_NORMCOORD; /* Default to normalized coords. */ 424 #ifdef VBOXWDDM 425 if (pool == WINED3DPOOL_SYSTEMMEM && pvClientMem) surface->Flags |= SFLAG_CLIENTMEM; 426 #endif 414 427 if (discard) surface->Flags |= SFLAG_DISCARD; 415 428 if (lockable || format == WINED3DFMT_D16_LOCKABLE) surface->Flags |= SFLAG_LOCKABLE; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface_base.c
r28475 r30916 849 849 } 850 850 851 #ifdef VBOXWDDM 852 IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.device, source->currentDesc.Width, 853 source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */, &ret, 854 0 /* usage */, WINED3DPOOL_SCRATCH, WINED3DMULTISAMPLE_NONE /* TODO: Multisampled conversion */, 855 0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source), 856 NULL /* parent */, &wined3d_null_parent_ops, NULL, NULL); 857 #else 851 858 IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.device, source->currentDesc.Width, 852 859 source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */, &ret, … … 854 861 0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source), 855 862 NULL /* parent */, &wined3d_null_parent_ops); 863 #endif 864 856 865 if(!ret) { 857 866 ERR("Failed to create a destination surface for conversion\n"); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/texture.c
r28475 r30916 441 441 HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels, 442 442 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, 443 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) 443 IUnknown *parent, const struct wined3d_parent_ops *parent_ops 444 #ifdef VBOXWDDM 445 , HANDLE *shared_handle 446 , void *pvClientMem 447 #endif 448 ) 444 449 { 445 450 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; … … 577 582 for (i = 0; i < texture->baseTexture.levels; ++i) 578 583 { 584 #ifdef VBOXWDDM 585 /* Use the callback to create the texture surface. */ 586 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h, format_desc->format, 587 usage, pool, i, WINED3DCUBEMAP_FACE_POSITIVE_X, &texture->surfaces[i] 588 , shared_handle 589 , pvClientMem); 590 591 #else 579 592 /* Use the callback to create the texture surface. */ 580 593 hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h, format_desc->format, 581 594 usage, pool, i, WINED3DCUBEMAP_FACE_POSITIVE_X, &texture->surfaces[i]); 595 #endif 596 582 597 if (FAILED(hr)) 583 598 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/volume.c
r28475 r30916 408 408 409 409 hr = resource_init((IWineD3DResource *)volume, WINED3DRTYPE_VOLUME, device, 410 width * height * depth * format_desc->byte_count, usage, format_desc, pool, parent, parent_ops); 410 width * height * depth * format_desc->byte_count, usage, format_desc, pool, parent, parent_ops 411 #ifdef VBOXWDDM 412 , NULL, NULL 413 #endif 414 ); 411 415 if (FAILED(hr)) 412 416 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_private.h
r28475 r30916 1824 1824 HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type, 1825 1825 IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct wined3d_format_desc *format_desc, 1826 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 1826 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 1827 #ifdef VBOXWDDM 1828 , HANDLE *shared_handle 1829 , void *pvClientMem 1830 #endif 1831 ) DECLSPEC_HIDDEN; 1827 1832 WINED3DRESOURCETYPE resource_get_type(IWineD3DResource *iface) DECLSPEC_HIDDEN; 1828 1833 DWORD resource_set_priority(IWineD3DResource *iface, DWORD new_priority) DECLSPEC_HIDDEN; … … 1942 1947 HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels, 1943 1948 IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool, 1944 IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 1949 IUnknown *parent, const struct wined3d_parent_ops *parent_ops 1950 #ifdef VBOXWDDM 1951 , HANDLE *shared_handle 1952 , void *pvClientMem 1953 #endif 1954 ) DECLSPEC_HIDDEN; 1945 1955 1946 1956 /***************************************************************************** … … 2131 2141 UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type, 2132 2142 UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, WINED3DFORMAT format, 2133 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; 2143 WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops 2144 #ifdef VBOXWDDM 2145 , HANDLE *shared_handle 2146 , void *pvClientMem 2147 #endif 2148 ) DECLSPEC_HIDDEN; 2134 2149 2135 2150 /* Predeclare the shared Surface functions */ … … 2213 2228 #define SFLAG_SWAPCHAIN 0x01000000 /* The surface is part of a swapchain */ 2214 2229 2230 #ifdef VBOXWDDM 2231 # define SFLAG_CLIENTMEM 0x10000000 /* SYSMEM surface using client-supplied memory buffer */ 2232 2233 # define SFLAG_DONOTFREE_VBOXWDDM SFLAG_CLIENTMEM 2234 #else 2235 # define SFLAG_DONOTFREE_VBOXWDDM 0 2236 #endif 2237 2215 2238 /* In some conditions the surface memory must not be freed: 2216 2239 * SFLAG_CONVERTED: Converting the data back would take too long … … 2227 2250 SFLAG_USERPTR | \ 2228 2251 SFLAG_PBO | \ 2229 SFLAG_CLIENT) 2252 SFLAG_CLIENT | \ 2253 SFLAG_DONOTFREE_VBOXWDDM \ 2254 ) 2230 2255 2231 2256 #define SFLAG_LOCATIONS (SFLAG_INSYSMEM | \
Note:
See TracChangeset
for help on using the changeset viewer.