wined3d: Remove the useless "resource_type" parameter from IWineD3DDevice::CreateSurface().

This commit is contained in:
Henri Verbeet 2009-06-12 09:46:03 +02:00 committed by Alexandre Julliard
parent 8f67918f1d
commit 4bc6b376e0
7 changed files with 49 additions and 40 deletions

View File

@ -700,7 +700,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device *ifac
hr = IWineD3DDevice_CreateSurface(This->wined3d_device, desc->Width, desc->Height,
wined3dformat_from_dxgi_format(desc->Format), FALSE, FALSE, 0,
&object->wined3d_surface, WINED3DRTYPE_SURFACE, desc->Usage, WINED3DPOOL_DEFAULT,
&object->wined3d_surface, desc->Usage, WINED3DPOOL_DEFAULT,
desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3DMULTISAMPLE_NONE,
desc->SampleDesc.Quality, SURFACE_OPENGL, (IUnknown *)object);
if (FAILED(hr))

View File

@ -794,7 +794,10 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateIndexBuffer(LPDIRECT3DDEVICE8 i
return hrc;
}
static HRESULT IDirect3DDevice8Impl_CreateSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface8 **ppSurface,D3DRESOURCETYPE Type, UINT Usage,D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality) {
static HRESULT IDirect3DDevice8Impl_CreateSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height,
D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface8 **ppSurface,
UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality)
{
HRESULT hrc;
IDirect3DSurface8Impl *object;
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
@ -825,8 +828,8 @@ static HRESULT IDirect3DDevice8Impl_CreateSurface(LPDIRECT3DDEVICE8 iface, UINT
EnterCriticalSection(&d3d8_cs);
hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, wined3dformat_from_d3dformat(Format),
Lockable, Discard, Level, &object->wineD3DSurface, Type, Usage & WINED3DUSAGE_MASK,
(WINED3DPOOL)Pool, MultiSample, MultisampleQuality, SURFACE_OPENGL, (IUnknown *)object);
Lockable, Discard, Level, &object->wineD3DSurface, Usage & WINED3DUSAGE_MASK, (WINED3DPOOL)Pool,
MultiSample, MultisampleQuality, SURFACE_OPENGL, (IUnknown *)object);
LeaveCriticalSection(&d3d8_cs);
if (hrc != D3D_OK || NULL == object->wineD3DSurface) {
/* free up object */
@ -845,7 +848,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateRenderTarget(LPDIRECT3DDEVICE8
HRESULT hr;
TRACE("Relay\n");
hr = IDirect3DDevice8Impl_CreateSurface(iface, Width, Height, Format, Lockable, FALSE /* Discard */, 0 /* Level */ , ppSurface, D3DRTYPE_SURFACE, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, MultiSample, 0);
hr = IDirect3DDevice8Impl_CreateSurface(iface, Width, Height, Format, Lockable, FALSE /* Discard */,
0 /* Level */, ppSurface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, MultiSample, 0);
return hr;
}
@ -854,9 +859,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateDepthStencilSurface(LPDIRECT3DD
TRACE("Relay\n");
/* TODO: Verify that Discard is false */
hr = IDirect3DDevice8Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, FALSE, 0 /* Level */
,ppSurface, D3DRTYPE_SURFACE, D3DUSAGE_DEPTHSTENCIL,
D3DPOOL_DEFAULT, MultiSample, 0);
hr = IDirect3DDevice8Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, FALSE,
0 /* Level */, ppSurface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, MultiSample, 0);
return hr;
}
@ -865,8 +870,10 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateImageSurface(LPDIRECT3DDEVICE8
HRESULT hr;
TRACE("Relay\n");
hr = IDirect3DDevice8Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Loackable */ , FALSE /*Discard*/ , 0 /* Level */ , ppSurface,
D3DRTYPE_SURFACE, 0 /* Usage (undefined/none) */ , D3DPOOL_SYSTEMMEM, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */);
hr = IDirect3DDevice8Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, FALSE /* Discard */,
0 /* Level */, ppSurface, 0 /* Usage (undefined/none) */, D3DPOOL_SYSTEMMEM, D3DMULTISAMPLE_NONE,
0 /* MultisampleQuality */);
return hr;
}
@ -2561,8 +2568,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParen
hr = IDirect3DDevice8Impl_CreateSurface((IDirect3DDevice8 *)This, width, height,
d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level,
(IDirect3DSurface8 **)&d3d_surface, D3DRTYPE_SURFACE, usage, pool,
D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */);
(IDirect3DSurface8 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */);
if (FAILED(hr))
{
ERR("(%p) CreateSurface failed, returning %#x\n", iface, hr);

View File

@ -640,7 +640,10 @@ static void WINAPI IDirect3DDevice9Impl_GetGammaRamp(LPDIRECT3DDEVICE9EX iface,
}
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 ) {
static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height,
D3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IDirect3DSurface9 **ppSurface,
UINT Usage, D3DPOOL Pool, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality)
{
HRESULT hrc;
IDirect3DSurface9Impl *object;
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
@ -671,8 +674,8 @@ static HRESULT IDirect3DDevice9Impl_CreateSurface(LPDIRECT3DDEVICE9EX iface, UIN
EnterCriticalSection(&d3d9_cs);
hrc = IWineD3DDevice_CreateSurface(This->WineD3DDevice, Width, Height, wined3dformat_from_d3dformat(Format),
Lockable, Discard, Level, &object->wineD3DSurface, Type, Usage & WINED3DUSAGE_MASK,
(WINED3DPOOL)Pool, MultiSample, MultisampleQuality, SURFACE_OPENGL, (IUnknown *)object);
Lockable, Discard, Level, &object->wineD3DSurface, Usage & WINED3DUSAGE_MASK, (WINED3DPOOL)Pool,
MultiSample, MultisampleQuality, SURFACE_OPENGL, (IUnknown *)object);
LeaveCriticalSection(&d3d9_cs);
if (hrc != D3D_OK || NULL == object->wineD3DSurface) {
@ -698,7 +701,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_CreateRenderTarget(LPDIRECT3DDEVICE
HRESULT hr;
TRACE("Relay\n");
hr = IDirect3DDevice9Impl_CreateSurface(iface,Width,Height,Format,Lockable,FALSE/*Discard*/, 0/*Level*/, ppSurface,D3DRTYPE_SURFACE,D3DUSAGE_RENDERTARGET,D3DPOOL_DEFAULT,MultiSample,MultisampleQuality,pSharedHandle);
hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, Lockable, FALSE /* Discard */,
0 /* Level */, ppSurface, D3DUSAGE_RENDERTARGET, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality);
return hr;
}
@ -709,9 +714,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_CreateDepthStencilSurface(LPDIRECT3
HRESULT hr;
TRACE("Relay\n");
hr = IDirect3DDevice9Impl_CreateSurface(iface,Width,Height,Format,TRUE/* Lockable */,Discard, 0/* Level */
,ppSurface,D3DRTYPE_SURFACE,D3DUSAGE_DEPTHSTENCIL,
D3DPOOL_DEFAULT,MultiSample,MultisampleQuality,pSharedHandle);
hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, Discard,
0 /* Level */, ppSurface, D3DUSAGE_DEPTHSTENCIL, D3DPOOL_DEFAULT, MultiSample, MultisampleQuality);
return hr;
}
@ -824,7 +829,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_CreateOffscreenPlainSurface(LPDIREC
Why, their always lockable?
should I change the usage to dynamic?
*/
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);
hr = IDirect3DDevice9Impl_CreateSurface(iface, Width, Height, Format, TRUE /* Lockable */, FALSE /* Discard */,
0 /* Level */, ppSurface, 0 /* Usage (undefined/none) */, (WINED3DPOOL)Pool, D3DMULTISAMPLE_NONE,
0 /* MultisampleQuality */);
return hr;
}
@ -2000,8 +2007,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParen
hr = IDirect3DDevice9Impl_CreateSurface((IDirect3DDevice9Ex *)This, width, height,
d3dformat_from_wined3dformat(format), lockable, FALSE /* Discard */, level,
(IDirect3DSurface9 **)&d3d_surface, D3DRTYPE_SURFACE, usage, pool,
D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */, NULL);
(IDirect3DSurface9 **)&d3d_surface, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */);
if (FAILED(hr))
{
ERR("(%p) CreateSurface failed, returning %#x\n", iface, hr);

View File

@ -1729,7 +1729,7 @@ IDirectDrawImpl_RecreateSurfacesCallback(IDirectDrawSurface7 *surf,
/* Create the new surface */
hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, Width, Height, Format,
TRUE /* Lockable */, FALSE /* Discard */, surfImpl->mipmap_level, &surfImpl->WineD3DSurface,
Type, Usage, Pool, MultiSampleType, MultiSampleQuality, This->ImplType, Parent);
Usage, Pool, MultiSampleType, MultiSampleQuality, This->ImplType, Parent);
if(hr != D3D_OK)
return hr;
@ -1842,7 +1842,7 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This,
HRESULT hr;
UINT Width = 0, Height = 0;
WINED3DFORMAT Format = WINED3DFMT_UNKNOWN;
WINED3DRESOURCETYPE ResType = WINED3DRTYPE_SURFACE;
WINED3DRESOURCETYPE ResType;
DWORD Usage = 0;
WINED3DSURFTYPE ImplType = This->ImplType;
WINED3DSURFACE_DESC Desc;
@ -2026,8 +2026,8 @@ IDirectDrawImpl_CreateNewSurface(IDirectDrawImpl *This,
/* Now create the WineD3D Surface */
hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, pDDSD->dwWidth, pDDSD->dwHeight, Format,
TRUE /* Lockable */, FALSE /* Discard */, level, &(*ppSurf)->WineD3DSurface, ResType, Usage,
Pool, WINED3DMULTISAMPLE_NONE, 0 /* MultiSampleQuality */, ImplType, Parent);
TRUE /* Lockable */, FALSE /* Discard */, level, &(*ppSurf)->WineD3DSurface,
Usage, Pool, WINED3DMULTISAMPLE_NONE, 0 /* MultiSampleQuality */, ImplType, Parent);
if(hr != D3D_OK)
{

View File

@ -889,10 +889,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface,
UINT Width, UINT Height, WINED3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level,
IWineD3DSurface **ppSurface, WINED3DRESOURCETYPE Type, DWORD Usage, WINED3DPOOL Pool,
WINED3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, WINED3DSURFTYPE Impl, IUnknown *parent)
static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Width, UINT Height,
WINED3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IWineD3DSurface **ppSurface,
DWORD Usage, WINED3DPOOL Pool, WINED3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality,
WINED3DSURFTYPE Impl, IUnknown *parent)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DSurfaceImpl *object; /*NOTE: impl ref allowed since this is a create function */
@ -2109,9 +2109,8 @@ static void IWineD3DDeviceImpl_LoadLogo(IWineD3DDeviceImpl *This, const char *fi
bm.bmHeight = 32;
}
hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *) This, bm.bmWidth, bm.bmHeight, WINED3DFMT_R5G6B5,
TRUE, FALSE, 0, &This->logo_surface, WINED3DRTYPE_SURFACE, 0,
WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL, NULL);
hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *) This, bm.bmWidth, bm.bmHeight, WINED3DFMT_R5G6B5, TRUE,
FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL, NULL);
if(FAILED(hr)) {
ERR("Wine logo requested, but failed to create surface\n");
goto out;

View File

@ -782,10 +782,9 @@ static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source,
return NULL;
}
IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.wineD3DDevice,
source->currentDesc.Width, source->currentDesc.Height, to_fmt, TRUE /* lockable */,
TRUE /* discard */, 0 /* level */, &ret, WINED3DRTYPE_SURFACE, 0 /* usage */,
WINED3DPOOL_SCRATCH, WINED3DMULTISAMPLE_NONE /* TODO: Multisampled conversion */,
IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.wineD3DDevice, source->currentDesc.Width,
source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */, &ret,
0 /* usage */, WINED3DPOOL_SCRATCH, WINED3DMULTISAMPLE_NONE /* TODO: Multisampled conversion */,
0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source), NULL /* parent */);
if(!ret) {
ERR("Failed to create a destination surface for conversion\n");

View File

@ -2932,7 +2932,6 @@ interface IWineD3DDevice : IWineD3DBase
[in] BOOL discard,
[in] UINT level,
[out] IWineD3DSurface **surface,
[in] WINED3DRESOURCETYPE resource_type,
[in] DWORD usage,
[in] WINED3DPOOL pool,
[in] WINED3DMULTISAMPLE_TYPE multisample_type,