Changeset 21731 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9
- Timestamp:
- Jul 21, 2009 9:16:52 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 50306
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/cubetexture.c
r19678 r21731 242 242 static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE9 iface, UINT Level, D3DSURFACE_DESC* pDesc) { 243 243 IDirect3DCubeTexture9Impl *This = (IDirect3DCubeTexture9Impl *)iface; 244 WINED3DSURFACE_DESC wined3ddesc; 245 UINT tmpInt = -1; 246 WINED3DFORMAT format; 247 HRESULT hr; 248 249 TRACE("(%p) Relay\n", This); 250 251 /* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */ 252 wined3ddesc.Format = &format; 253 wined3ddesc.Type = (WINED3DRESOURCETYPE *) &pDesc->Type; 254 wined3ddesc.Usage = &pDesc->Usage; 255 wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool; 256 wined3ddesc.Size = &tmpInt; 257 wined3ddesc.MultiSampleType = (WINED3DMULTISAMPLE_TYPE *) &pDesc->MultiSampleType; 258 wined3ddesc.MultiSampleQuality = &pDesc->MultiSampleQuality; 259 wined3ddesc.Width = &pDesc->Width; 260 wined3ddesc.Height = &pDesc->Height; 244 WINED3DSURFACE_DESC wined3ddesc; 245 HRESULT hr; 246 247 TRACE("(%p) Relay\n", This); 261 248 262 249 EnterCriticalSection(&d3d9_cs); … … 264 251 LeaveCriticalSection(&d3d9_cs); 265 252 266 if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(format); 253 if (SUCCEEDED(hr)) 254 { 255 pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.format); 256 pDesc->Type = wined3ddesc.resource_type; 257 pDesc->Usage = wined3ddesc.usage; 258 pDesc->Pool = wined3ddesc.pool; 259 pDesc->MultiSampleType = wined3ddesc.multisample_type; 260 pDesc->MultiSampleQuality = wined3ddesc.multisample_quality; 261 pDesc->Width = wined3ddesc.width; 262 pDesc->Height = wined3ddesc.height; 263 } 267 264 268 265 return hr; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/device.c
r20612 r21731 434 434 static HRESULT WINAPI reset_enum_callback(IWineD3DResource *resource, void *data) { 435 435 BOOL *resources_ok = data; 436 WINED3DRESOURCETYPE type;436 D3DRESOURCETYPE type; 437 437 HRESULT ret = S_OK; 438 438 WINED3DSURFACE_DESC surface_desc; … … 440 440 D3DINDEXBUFFER_DESC index_desc; 441 441 D3DVERTEXBUFFER_DESC vertex_desc; 442 WINED3DFORMAT dummy_format; 443 WINED3DMULTISAMPLE_TYPE dummy_multisampletype; 444 DWORD dummy_dword; 445 WINED3DPOOL pool = WINED3DPOOL_SCRATCH; /* a harmless pool */ 442 WINED3DPOOL pool; 446 443 IDirect3DResource9 *parent; 447 444 … … 450 447 switch(type) { 451 448 case D3DRTYPE_SURFACE: 452 surface_desc.Format = &dummy_format;453 surface_desc.Type = &type;454 surface_desc.Usage = &dummy_dword;455 surface_desc.Pool = &pool;456 surface_desc.Size = &dummy_dword;457 surface_desc.MultiSampleType = &dummy_multisampletype;458 surface_desc.MultiSampleQuality = &dummy_dword;459 surface_desc.Width = &dummy_dword;460 surface_desc.Height = &dummy_dword;461 462 449 IWineD3DSurface_GetDesc((IWineD3DSurface *) resource, &surface_desc); 450 pool = surface_desc.pool; 463 451 break; 464 452 465 453 case D3DRTYPE_VOLUME: 466 volume_desc.Format = &dummy_format;467 volume_desc.Type = &type;468 volume_desc.Usage = &dummy_dword;469 volume_desc.Pool = &pool;470 volume_desc.Size = &dummy_dword;471 volume_desc.Width = &dummy_dword;472 volume_desc.Height = &dummy_dword;473 volume_desc.Depth = &dummy_dword;474 454 IWineD3DVolume_GetDesc((IWineD3DVolume *) resource, &volume_desc); 455 pool = volume_desc.Pool; 475 456 break; 476 457 … … 489 470 */ 490 471 default: 472 pool = WINED3DPOOL_SCRATCH; /* a harmless pool */ 491 473 break; 492 474 } … … 657 639 658 640 659 static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface,D3DRESOURCETYPE Type, UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality,HANDLE* pSharedHandle ) { 641 static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, 642 D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface, 643 UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality) 644 { 660 645 HRESULT hrc; 661 646 IDirect3DSurface9Impl *object; … … 688 673 EnterCriticalSection(&d3d9_cs); 689 674 hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, wined3dformat_from_d3dformat(Format), 690 Lockable, Discard, Level, &object->wineD3DSurface, Type, Usage & WINED3DUSAGE_MASK,691 (WINED3DPOOL)Pool,MultiSample, MultisampleQuality, SURFACE_OPENGL, (IUnknown *)object);675 Lockable, Discard, Level, &object->wineD3DSurface, Usage & WINED3DUSAGE_MASK, (WINED3DPOOL)Pool, 676 MultiSample, MultisampleQuality, SURFACE_OPENGL, (IUnknown *)object); 692 677 LeaveCriticalSection(&d3d9_cs); 693 678 … … 715 700 TRACE("Relay\n"); 716 701 717 hr = IDirect3DDevice9Impl_CreateSurface(iface,Width,Height,Format,Lockable,FALSE/*Discard*/, 0/*Level*/, ppSurface,D3DRTYPE_SURFACE,D3DUSAGE_RENDERTARGET,D3DPOOL_DEFAULT,MultiSample,MultisampleQuality,pSharedHandle); 718 return hr; 702 hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, Lockable, FALSE /* Discard */, 703 0 /* Level */, ppSurface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality); 704 705 return hr; 719 706 } 720 707 … … 726 713 TRACE("Relay\n"); 727 714 728 hr = IDirect3DDevice9Impl_CreateSurface(iface,Width,Height,Format,TRUE/* Lockable */,Discard, 0/* Level */729 ,ppSurface,D3DRTYPE_SURFACE,D3DUSAGE_DEPTHSTENCIL,730 D3DPOOL_DEFAULT,MultiSample,MultisampleQuality,pSharedHandle); 731 715 hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, Discard, 716 0 /* Level */, ppSurface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality); 717 718 return hr; 732 719 } 733 720 … … 803 790 TRACE("(%p) Relay\n" , This); 804 791 805 memset(&desc, 0, sizeof(desc));806 desc.Usage = &usage;807 desc.Pool = &pool;808 desc.Type = &restype;809 810 792 EnterCriticalSection(&d3d9_cs); 811 793 IWineD3DSurface_GetDesc(surface->wineD3DSurface, &desc); 794 usage = desc.usage; 795 pool = desc.pool; 796 restype = desc.resource_type; 812 797 813 798 /* This method is only allowed with surfaces that are render targets, or offscreen plain surfaces 814 799 * in D3DPOOL_DEFAULT 815 800 */ 816 if(!(usage & WINED3DUSAGE_RENDERTARGET) && (pool != D3DPOOL_DEFAULT || restype !=D3DRTYPE_SURFACE)) {801 if(!(usage & WINED3DUSAGE_RENDERTARGET) && (pool != WINED3DPOOL_DEFAULT || restype != WINED3DRTYPE_SURFACE)) { 817 802 LeaveCriticalSection(&d3d9_cs); 818 803 WARN("Surface is not a render target, or not a stand-alone D3DPOOL_DEFAULT surface\n"); … … 841 826 should I change the usage to dynamic? 842 827 */ 843 hr = IDirect3DDevice9Impl_CreateSurface(iface,Width,Height,Format,TRUE/*Loackable*/,FALSE/*Discard*/,0/*Level*/ , ppSurface,D3DRTYPE_SURFACE, 0/*Usage (undefined/none)*/,(WINED3DPOOL) Pool,D3DMULTISAMPLE_NONE,0/*MultisampleQuality*/,pSharedHandle); 828 hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, FALSE /* Discard */, 829 0 /* Level */, ppSurface, 0 /* Usage (undefined/none) */, (WINED3DPOOL)Pool, D3DMULTISAMPLE_NONE, 830 0 /* MultisampleQuality */); 844 831 845 832 return hr; … … 2017 2004 hr = IDirect3DDevice9Impl_CreateSurface((IDirect3DDevice9Ex *)This, width, height, 2018 2005 d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level, 2019 (IDirect3DSurface9 **)&d3d_surface, D3DRTYPE_SURFACE, usage, pool, 2020 D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */, NULL); 2006 (IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */); 2021 2007 if (FAILED(hr)) 2022 2008 { -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/directx.c
r19678 r21731 116 116 HRESULT hr; 117 117 118 /* dx8 and dx9 have different structures to be filled in, with incompatible 119 layouts so pass in pointers to the places to be filled via an internal 120 structure */ 121 adapter_id.Driver = pIdentifier->Driver; 122 adapter_id.Description = pIdentifier->Description; 123 adapter_id.DeviceName = pIdentifier->DeviceName; 124 adapter_id.DriverVersion = &pIdentifier->DriverVersion; 125 adapter_id.VendorId = &pIdentifier->VendorId; 126 adapter_id.DeviceId = &pIdentifier->DeviceId; 127 adapter_id.SubSysId = &pIdentifier->SubSysId; 128 adapter_id.Revision = &pIdentifier->Revision; 129 adapter_id.DeviceIdentifier = &pIdentifier->DeviceIdentifier; 130 adapter_id.WHQLLevel = &pIdentifier->WHQLLevel; 118 adapter_id.driver = pIdentifier->Driver; 119 adapter_id.driver_size = sizeof(pIdentifier->Driver); 120 adapter_id.description = pIdentifier->Description; 121 adapter_id.description_size = sizeof(pIdentifier->Description); 122 adapter_id.device_name = pIdentifier->DeviceName; 123 adapter_id.device_name_size = sizeof(pIdentifier->DeviceName); 131 124 132 125 EnterCriticalSection(&d3d9_cs); 133 126 hr = IWineD3D_GetAdapterIdentifier(This->WineD3D, Adapter, Flags, &adapter_id); 134 127 LeaveCriticalSection(&d3d9_cs); 128 129 pIdentifier->DriverVersion = adapter_id.driver_version; 130 pIdentifier->VendorId = adapter_id.vendor_id; 131 pIdentifier->DeviceId = adapter_id.device_id; 132 pIdentifier->SubSysId = adapter_id.subsystem_id; 133 pIdentifier->Revision = adapter_id.revision; 134 memcpy(&pIdentifier->DeviceIdentifier, &adapter_id.device_identifier, sizeof(pIdentifier->DeviceIdentifier)); 135 pIdentifier->WHQLLevel = adapter_id.whql_level; 136 135 137 return hr; 136 138 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/surface.c
r19678 r21731 215 215 static HRESULT WINAPI IDirect3DSurface9Impl_GetDesc(LPDIRECT3DSURFACE9 iface, D3DSURFACE_DESC* pDesc) { 216 216 IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; 217 WINED3DSURFACE_DESC wined3ddesc; 218 UINT tmpInt = -1; 219 WINED3DFORMAT format; 220 HRESULT hr; 221 TRACE("(%p) Relay\n", This); 222 223 /* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */ 224 wined3ddesc.Format = &format; 225 wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type; 226 wined3ddesc.Usage = &pDesc->Usage; 227 wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool; 228 wined3ddesc.Size = &tmpInt; 229 wined3ddesc.MultiSampleType = (WINED3DMULTISAMPLE_TYPE *) &pDesc->MultiSampleType; 230 wined3ddesc.MultiSampleQuality = &pDesc->MultiSampleQuality; 231 wined3ddesc.Width = &pDesc->Width; 232 wined3ddesc.Height = &pDesc->Height; 217 WINED3DSURFACE_DESC wined3ddesc; 218 HRESULT hr; 219 TRACE("(%p) Relay\n", This); 233 220 234 221 EnterCriticalSection(&d3d9_cs); … … 236 223 LeaveCriticalSection(&d3d9_cs); 237 224 238 if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(format); 225 if (SUCCEEDED(hr)) 226 { 227 pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.format); 228 pDesc->Type = wined3ddesc.resource_type; 229 pDesc->Usage = wined3ddesc.usage; 230 pDesc->Pool = wined3ddesc.pool; 231 pDesc->MultiSampleType = wined3ddesc.multisample_type; 232 pDesc->MultiSampleQuality = wined3ddesc.multisample_quality; 233 pDesc->Width = wined3ddesc.width; 234 pDesc->Height = wined3ddesc.height; 235 } 239 236 240 237 return hr; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/texture.c
r19678 r21731 239 239 static HRESULT WINAPI IDirect3DTexture9Impl_GetLevelDesc(LPDIRECT3DTEXTURE9 iface, UINT Level, D3DSURFACE_DESC* pDesc) { 240 240 IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface; 241 242 WINED3DSURFACE_DESC wined3ddesc; 243 UINT tmpInt = -1; 244 HRESULT hr; 245 WINED3DFORMAT format; 246 247 TRACE("(%p) Relay\n", This); 248 249 /* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */ 250 wined3ddesc.Format = &format; 251 wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type; 252 wined3ddesc.Usage = &pDesc->Usage; 253 wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool; 254 wined3ddesc.Size = &tmpInt; /* required for d3d8 */ 255 wined3ddesc.MultiSampleType = (WINED3DMULTISAMPLE_TYPE *) &pDesc->MultiSampleType; 256 wined3ddesc.MultiSampleQuality = &pDesc->MultiSampleQuality; 257 wined3ddesc.Width = &pDesc->Width; 258 wined3ddesc.Height = &pDesc->Height; 241 WINED3DSURFACE_DESC wined3ddesc; 242 HRESULT hr; 243 244 TRACE("(%p) Relay\n", This); 259 245 260 246 EnterCriticalSection(&d3d9_cs); … … 262 248 LeaveCriticalSection(&d3d9_cs); 263 249 264 if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(format); 250 if (SUCCEEDED(hr)) 251 { 252 pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.format); 253 pDesc->Type = wined3ddesc.resource_type; 254 pDesc->Usage = wined3ddesc.usage; 255 pDesc->Pool = wined3ddesc.pool; 256 pDesc->MultiSampleType = wined3ddesc.multisample_type; 257 pDesc->MultiSampleQuality = wined3ddesc.multisample_quality; 258 pDesc->Width = wined3ddesc.width; 259 pDesc->Height = wined3ddesc.height; 260 } 265 261 266 262 return hr; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/version.rc
r16477 r21731 26 26 */ 27 27 28 /* 29 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice 30 * other than GPL or LGPL is available it will apply instead, Sun elects to use only 31 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where 32 * a choice of LGPL license versions is made available with the language indicating 33 * that LGPLv2 or any later version may be used, or where a choice of which version 34 * of the LGPL is applied is otherwise unspecified. 35 */ 36 28 37 #define WINE_FILEDESCRIPTION_STR "Wine Direct3D" 29 38 #define WINE_FILENAME_STR "d3d9.dll" -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/volume.c
r19678 r21731 177 177 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface; 178 178 WINED3DVOLUME_DESC wined3ddesc; 179 UINT tmpInt = -1; 180 WINED3DFORMAT format; 181 HRESULT hr; 182 183 TRACE("(%p) Relay\n", This); 184 185 /* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */ 186 wined3ddesc.Format = &format; 187 wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type; 188 wined3ddesc.Usage = &pDesc->Usage; 189 wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool; 190 wined3ddesc.Size = &tmpInt; 191 wined3ddesc.Width = &pDesc->Width; 192 wined3ddesc.Height = &pDesc->Height; 193 wined3ddesc.Depth = &pDesc->Depth; 179 HRESULT hr; 180 181 TRACE("(%p) Relay\n", This); 194 182 195 183 EnterCriticalSection(&d3d9_cs); … … 199 187 LeaveCriticalSection(&d3d9_cs); 200 188 201 if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(format); 189 if (SUCCEEDED(hr)) 190 { 191 pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.Format); 192 pDesc->Type = wined3ddesc.Type; 193 pDesc->Usage = wined3ddesc.Usage; 194 pDesc->Pool = wined3ddesc.Pool; 195 pDesc->Width = wined3ddesc.Width; 196 pDesc->Height = wined3ddesc.Height; 197 pDesc->Depth = wined3ddesc.Depth; 198 } 202 199 203 200 return hr; -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/volumetexture.c
r19678 r21731 291 291 IDirect3DVolumeTexture9Impl *This = (IDirect3DVolumeTexture9Impl *)iface; 292 292 WINED3DVOLUME_DESC wined3ddesc; 293 UINT tmpInt = -1; 294 WINED3DFORMAT format; 295 HRESULT hr; 296 297 TRACE("(%p) Relay\n", This); 298 299 /* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */ 300 wined3ddesc.Format = &format; 301 wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type; 302 wined3ddesc.Usage = &pDesc->Usage; 303 wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool; 304 wined3ddesc.Size = &tmpInt; 305 wined3ddesc.Width = &pDesc->Width; 306 wined3ddesc.Height = &pDesc->Height; 307 wined3ddesc.Depth = &pDesc->Depth; 293 HRESULT hr; 294 295 TRACE("(%p) Relay\n", This); 308 296 309 297 EnterCriticalSection(&d3d9_cs); … … 313 301 LeaveCriticalSection(&d3d9_cs); 314 302 315 if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(format); 303 if (SUCCEEDED(hr)) 304 { 305 pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.Format); 306 pDesc->Type = wined3ddesc.Type; 307 pDesc->Usage = wined3ddesc.Usage; 308 pDesc->Pool = wined3ddesc.Pool; 309 pDesc->Width = wined3ddesc.Width; 310 pDesc->Height = wined3ddesc.Height; 311 pDesc->Depth = wined3ddesc.Depth; 312 } 316 313 317 314 return hr;
Note:
See TracChangeset
for help on using the changeset viewer.