Changeset 32061 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c
- Timestamp:
- Aug 27, 2010 5:00:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/surface.c
r31936 r32061 482 482 return hr; 483 483 } 484 #ifdef VBOXWDDM485 if (shared_handle && !*shared_handle)486 {487 *shared_handle = VBOXSHRC_GET_SHAREHANDLE(surface);488 }489 #endif490 484 491 485 return hr; … … 497 491 498 492 #if defined(DEBUG_misha) && defined (VBOXWDDM) 499 if (VBOXSHRC_IS_ SHARED(This))493 if (VBOXSHRC_IS_INITIALIZED(This)) 500 494 { 501 495 Assert(0); … … 2025 2019 ENTER_GL(); 2026 2020 glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE); 2027 if(This->texture_name) 2028 { 2029 surface_bind_and_dirtify(This, FALSE); 2030 glTexImage2D(This->texture_target, This->texture_level, 2031 GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); 2032 } 2033 if(This->texture_name_srgb) 2034 { 2035 surface_bind_and_dirtify(This, TRUE); 2036 glTexImage2D(This->texture_target, This->texture_level, 2037 GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); 2021 #ifdef VBOXWDDM 2022 if (!VBOXSHRC_IS_SHARED_OPENED(This)) 2023 #endif 2024 { 2025 if(This->texture_name) 2026 { 2027 surface_bind_and_dirtify(This, FALSE); 2028 glTexImage2D(This->texture_target, This->texture_level, 2029 GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); 2030 } 2031 if(This->texture_name_srgb) 2032 { 2033 surface_bind_and_dirtify(This, TRUE); 2034 glTexImage2D(This->texture_target, This->texture_level, 2035 GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); 2036 } 2038 2037 } 2039 2038 glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); … … 4280 4279 if(((This->Flags & SFLAG_INTEXTURE) && !(flag & SFLAG_INTEXTURE)) || 4281 4280 ((This->Flags & SFLAG_INSRGBTEX) && !(flag & SFLAG_INSRGBTEX))) { 4282 #ifdef VBOXWDDM4283 if (VBOXSHRC_IS_SHARED(This))4284 {4285 IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INTEXTURE, NULL);4286 }4287 else4288 #endif4289 4281 if (IWineD3DSurface_GetContainer(iface, &IID_IWineD3DBaseTexture, (void **)&texture) == WINED3D_OK) { 4290 4282 TRACE("Passing to container\n"); … … 4293 4285 } 4294 4286 } 4287 4295 4288 This->Flags &= ~SFLAG_LOCATIONS; 4296 4289 This->Flags |= flag; … … 4304 4297 } else { 4305 4298 if((This->Flags & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX)) && (flag & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX))) { 4306 #ifdef VBOXWDDM4307 if (VBOXSHRC_IS_SHARED(This))4308 {4309 IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INTEXTURE, NULL);4310 }4311 else4312 #endif4313 4299 if (IWineD3DSurface_GetContainer(iface, &IID_IWineD3DBaseTexture, (void **)&texture) == WINED3D_OK) { 4314 4300 TRACE("Passing to container\n"); … … 4317 4303 } 4318 4304 } 4305 4319 4306 This->Flags &= ~flag; 4320 4307 } 4308 4309 #ifdef VBOXWDDM 4310 if(VBOXSHRC_IS_INITIALIZED(This)) { 4311 /* with the shared resource only texture can be considered valid 4312 * to make sure changes done to the resource in the other device context are visible 4313 * because the resource contents is shared via texture. 4314 * This is why we ensure texture location is the one and only which is always valid */ 4315 if(!(This->Flags & SFLAG_INTEXTURE)) { 4316 IWineD3DSurfaceImpl_LoadLocation(iface, SFLAG_INTEXTURE, NULL); 4317 } else { 4318 This->Flags &= ~SFLAG_LOCATIONS; 4319 This->Flags |= SFLAG_INTEXTURE; 4320 } 4321 } 4322 #endif 4321 4323 4322 4324 if(!(This->Flags & SFLAG_LOCATIONS)) { … … 4619 4621 } 4620 4622 4621 if(rect == NULL) { 4622 This->Flags |= flag; 4623 } 4624 4625 if (in_fbo && (This->Flags & (SFLAG_INTEXTURE | SFLAG_INDRAWABLE))) { 4626 /* With ORM_FBO, SFLAG_INTEXTURE and SFLAG_INDRAWABLE are the same for offscreen targets. */ 4627 This->Flags |= (SFLAG_INTEXTURE | SFLAG_INDRAWABLE); 4623 #ifdef VBOXWDDM 4624 if (VBOXSHRC_IS_INITIALIZED(This)) 4625 { 4626 /* with the shared resource only texture can be considered valid 4627 * to make sure changes done to the resource in the other device context are visible 4628 * because the resource contents is shared via texture. 4629 * One can load and use other locations as needed, 4630 * but they should be reloaded each time on each usage */ 4631 Assert(!!(This->Flags & SFLAG_INTEXTURE) || !!(flag & SFLAG_INTEXTURE)); 4632 This->Flags &= ~SFLAG_LOCATIONS; 4633 This->Flags |= SFLAG_INTEXTURE; 4634 /* @todo: SFLAG_INSRGBTEX ?? */ 4635 // if (in_fbo) 4636 // { 4637 // This->Flags |= SFLAG_INDRAWABLE; 4638 // } 4639 } 4640 else 4641 #endif 4642 { 4643 if(rect == NULL) { 4644 This->Flags |= flag; 4645 } 4646 4647 if (in_fbo && (This->Flags & (SFLAG_INTEXTURE | SFLAG_INDRAWABLE))) { 4648 /* With ORM_FBO, SFLAG_INTEXTURE and SFLAG_INDRAWABLE are the same for offscreen targets. */ 4649 This->Flags |= (SFLAG_INTEXTURE | SFLAG_INDRAWABLE); 4650 } 4628 4651 } 4629 4652
Note:
See TracChangeset
for help on using the changeset viewer.