Changeset 31936 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Aug 24, 2010 4:52:58 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/resource.c
r31828 r31936 66 66 resource->heapMemory = NULL; 67 67 } 68 else if (pool == WINED3DPOOL_DEFAULT && shared_handle)69 {70 resource->allocatedMemory = NULL;71 resource->heapMemory = NULL;72 resource->sharerc_handle = shared_handle;73 resource->sharerc_flags = VBOXSHRC_F_SHARED;74 if (*shared_handle)75 resource->sharerc_flags |= VBOXSHRC_F_SHARED_OPENED;76 }77 68 else 78 69 #endif 79 70 { 71 #ifdef VBOXWDDM 72 if (pool == WINED3DPOOL_DEFAULT && shared_handle) 73 { 74 resource->sharerc_handle = *shared_handle; 75 resource->sharerc_flags = VBOXSHRC_F_SHARED; 76 if (*shared_handle) 77 resource->sharerc_flags |= VBOXSHRC_F_SHARED_OPENED; 78 } 79 #endif 80 80 if (size) 81 81 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c
r31828 r31936 495 495 { 496 496 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; 497 498 #if defined(DEBUG_misha) && defined (VBOXWDDM) 499 if (VBOXSHRC_IS_SHARED(This)) 500 { 501 Assert(0); 502 } 503 #endif 497 504 498 505 This->Flags &= ~(SFLAG_ALLOCATED | SFLAG_SRGBALLOCATED); … … 887 894 } 888 895 889 if (format_desc->Flags & WINED3DFMT_FLAG_COMPRESSED && mem) 890 { 891 GL_EXTCALL(glCompressedTexImage2DARB(This->texture_target, This->texture_level, 892 internal, width, height, 0, This->resource.size, mem)); 893 } 894 else 895 { 896 glTexImage2D(This->texture_target, This->texture_level, 897 internal, width, height, 0, format_desc->glFormat, format_desc->glType, mem); 898 checkGLcall("glTexImage2D"); 896 #ifdef VBOXWDDM 897 if (!VBOXSHRC_IS_SHARED_OPENED(This)) 898 #endif 899 { 900 if (format_desc->Flags & WINED3DFMT_FLAG_COMPRESSED && mem) 901 { 902 GL_EXTCALL(glCompressedTexImage2DARB(This->texture_target, This->texture_level, 903 internal, width, height, 0, This->resource.size, mem)); 904 } 905 else 906 { 907 glTexImage2D(This->texture_target, This->texture_level, 908 internal, width, height, 0, format_desc->glFormat, format_desc->glType, mem); 909 checkGLcall("glTexImage2D"); 910 } 899 911 } 900 912 … … 1001 1013 IWineD3DBaseTexture *baseTexture = NULL; 1002 1014 1003 #ifdef VBOXWDDM 1004 if (VBOXSHRC_IS_SHARED(This)) 1005 { 1006 if (!VBOXSHRC_IS_SHARED_OPENED(This)) 1007 IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INTEXTURE, NULL); 1008 else 1009 This->Flags |= SFLAG_INTEXTURE; 1010 } 1011 else 1012 #endif 1013 { 1014 if (!(This->Flags & SFLAG_INSYSMEM) && (This->Flags & SFLAG_INTEXTURE)) 1015 IWineD3DSurface_LoadLocation(iface, SFLAG_INSYSMEM, NULL /* no partial locking for textures yet */); 1016 1017 IWineD3DSurface_ModifyLocation(iface, SFLAG_INSYSMEM, TRUE); 1018 } 1015 if (!(This->Flags & SFLAG_INSYSMEM) && (This->Flags & SFLAG_INTEXTURE)) 1016 IWineD3DSurface_LoadLocation(iface, SFLAG_INSYSMEM, NULL /* no partial locking for textures yet */); 1017 1018 IWineD3DSurface_ModifyLocation(iface, SFLAG_INSYSMEM, TRUE); 1019 1019 1020 1020 if (dirty_rect) … … 3982 3982 } 3983 3983 3984 #ifdef VBOXWDDM 3985 static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, DWORD flag, const RECT *rect); 3986 #endif 3987 3984 3988 static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) { 3985 3989 /** Check against the maximum texture sizes supported by the video card **/ … … 4066 4070 } 4067 4071 4068 #ifdef VBOXWDDM 4069 if (!VBOXSHRC_IS_SHARED(This)) 4070 #endif 4071 { 4072 This->Flags |= SFLAG_INSYSMEM; 4073 } 4072 This->Flags |= SFLAG_INSYSMEM; 4074 4073 4075 4074 return WINED3D_OK; … … 4281 4280 if(((This->Flags & SFLAG_INTEXTURE) && !(flag & SFLAG_INTEXTURE)) || 4282 4281 ((This->Flags & SFLAG_INSRGBTEX) && !(flag & SFLAG_INSRGBTEX))) { 4282 #ifdef VBOXWDDM 4283 if (VBOXSHRC_IS_SHARED(This)) 4284 { 4285 IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INTEXTURE, NULL); 4286 } 4287 else 4288 #endif 4283 4289 if (IWineD3DSurface_GetContainer(iface, &IID_IWineD3DBaseTexture, (void **)&texture) == WINED3D_OK) { 4284 4290 TRACE("Passing to container\n"); … … 4298 4304 } else { 4299 4305 if((This->Flags & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX)) && (flag & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX))) { 4306 #ifdef VBOXWDDM 4307 if (VBOXSHRC_IS_SHARED(This)) 4308 { 4309 IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INTEXTURE, NULL); 4310 } 4311 else 4312 #endif 4300 4313 if (IWineD3DSurface_GetContainer(iface, &IID_IWineD3DBaseTexture, (void **)&texture) == WINED3D_OK) { 4301 4314 TRACE("Passing to container\n"); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/texture.c
r31828 r31936 616 616 texture->baseTexture.internal_preload = texture_internal_preload; 617 617 618 #ifdef VBOXWDDM 619 if (VBOXSHRC_IS_SHARED(texture)) 620 { 621 Assert(shared_handle); 622 IWineD3DSurface_LoadLocation(texture->surfaces[0], SFLAG_INTEXTURE, NULL); 623 if (!VBOXSHRC_IS_SHARED_OPENED(texture)) 624 { 625 Assert(!(*shared_handle)); 626 *shared_handle = VBOXSHRC_GET_SHAREHANDLE(texture); 627 } 628 else 629 { 630 Assert(*shared_handle); 631 } 632 #ifdef DEBUG 633 for (i = 0; i < texture->baseTexture.levels; ++i) 634 { 635 Assert((*shared_handle) == ((IWineD3DSurfaceImpl*)texture->surfaces[i])->texture_name); 636 } 637 #endif 638 } 639 else 640 { 641 Assert(!shared_handle); 642 } 643 #endif 644 618 645 return WINED3D_OK; 619 646 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/vboxsharedrc.h
r31884 r31936 26 26 #define VBOXSHRC_IS_SHARED_OPENED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_SHARED_OPENED)) 27 27 28 #ifdef DEBUG_misha 29 /* just for simplicity */ 30 #define AssertBreakpoint() do { __asm {int 3} } while (0) 31 #define Assert(_expr) do { \ 32 if (!(_expr)) AssertBreakpoint(); \ 33 } while (0) 34 #else 35 #define AssertBreakpoint() do { } while (0) 36 #define Assert(_expr) do { } while (0) 37 #endif 38 28 39 #endif /* #ifndef ___vboxsharedrc_h___ */
Note:
See TracChangeset
for help on using the changeset viewer.