Commit 3ad82a82 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: The stateblock doesn't have a parent.

parent 51a31538
...@@ -1415,8 +1415,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateStateBlock(IDirect3DDevice8 *if ...@@ -1415,8 +1415,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateStateBlock(IDirect3DDevice8 *if
} }
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DDevice_CreateStateBlock(This->WineD3DDevice, (WINED3DSTATEBLOCKTYPE)Type, hr = IWineD3DDevice_CreateStateBlock(This->WineD3DDevice, (WINED3DSTATEBLOCKTYPE)Type, &stateblock);
&stateblock, NULL);
if (FAILED(hr)) if (FAILED(hr))
{ {
wined3d_mutex_unlock(); wined3d_mutex_unlock();
......
...@@ -138,8 +138,8 @@ HRESULT stateblock_init(IDirect3DStateBlock9Impl *stateblock, IDirect3DDevice9Im ...@@ -138,8 +138,8 @@ HRESULT stateblock_init(IDirect3DStateBlock9Impl *stateblock, IDirect3DDevice9Im
else else
{ {
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = IWineD3DDevice_CreateStateBlock(device->WineD3DDevice, (WINED3DSTATEBLOCKTYPE)type, hr = IWineD3DDevice_CreateStateBlock(device->WineD3DDevice,
&stateblock->wineD3DStateBlock, (IUnknown *)stateblock); (WINED3DSTATEBLOCKTYPE)type, &stateblock->wineD3DStateBlock);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
if (FAILED(hr)) if (FAILED(hr))
{ {
......
...@@ -5927,7 +5927,7 @@ IDirect3DDeviceImpl_7_CreateStateBlock(IDirect3DDevice7 *iface, ...@@ -5927,7 +5927,7 @@ IDirect3DDeviceImpl_7_CreateStateBlock(IDirect3DDevice7 *iface,
EnterCriticalSection(&ddraw_cs); EnterCriticalSection(&ddraw_cs);
/* The D3DSTATEBLOCKTYPE enum is fine here. */ /* The D3DSTATEBLOCKTYPE enum is fine here. */
hr = IWineD3DDevice_CreateStateBlock(This->wineD3DDevice, Type, &wined3d_sb, NULL); hr = IWineD3DDevice_CreateStateBlock(This->wineD3DDevice, Type, &wined3d_sb);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to create stateblock, hr %#x.\n", hr); WARN("Failed to create stateblock, hr %#x.\n", hr);
......
...@@ -1012,7 +1012,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface ...@@ -1012,7 +1012,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface
} }
static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice *iface, static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice *iface,
WINED3DSTATEBLOCKTYPE type, IWineD3DStateBlock **stateblock, IUnknown *parent) WINED3DSTATEBLOCKTYPE type, IWineD3DStateBlock **stateblock)
{ {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DStateBlockImpl *object; IWineD3DStateBlockImpl *object;
...@@ -1790,12 +1790,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, ...@@ -1790,12 +1790,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
if(!This->adapter->opengl) return WINED3DERR_INVALIDCALL; if(!This->adapter->opengl) return WINED3DERR_INVALIDCALL;
TRACE("(%p) : Creating stateblock\n", This); TRACE("(%p) : Creating stateblock\n", This);
/* Creating the startup stateBlock - Note Special Case: 0 => Don't fill in yet! */ hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, (IWineD3DStateBlock **)&This->stateBlock);
hr = IWineD3DDevice_CreateStateBlock(iface, if (FAILED(hr))
WINED3DSBT_INIT, {
(IWineD3DStateBlock **)&This->stateBlock,
NULL);
if (WINED3D_OK != hr) { /* Note: No parent needed for initial internal stateblock */
WARN("Failed to create stateblock\n"); WARN("Failed to create stateblock\n");
goto err_out; goto err_out;
} }
...@@ -4488,7 +4485,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_BeginStateBlock(IWineD3DDevice *iface) ...@@ -4488,7 +4485,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_BeginStateBlock(IWineD3DDevice *iface)
if (This->isRecordingState) return WINED3DERR_INVALIDCALL; if (This->isRecordingState) return WINED3DERR_INVALIDCALL;
hr = IWineD3DDeviceImpl_CreateStateBlock(iface, WINED3DSBT_RECORDED, &stateblock, NULL); hr = IWineD3DDeviceImpl_CreateStateBlock(iface, WINED3DSBT_RECORDED, &stateblock);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
IWineD3DStateBlock_Release((IWineD3DStateBlock*)This->updateStateBlock); IWineD3DStateBlock_Release((IWineD3DStateBlock*)This->updateStateBlock);
...@@ -6469,7 +6466,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE ...@@ -6469,7 +6466,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
} }
/* Note: No parent needed for initial internal stateblock */ /* Note: No parent needed for initial internal stateblock */
hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, (IWineD3DStateBlock **)&This->stateBlock, NULL); hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, (IWineD3DStateBlock **)&This->stateBlock);
if (FAILED(hr)) ERR("Resetting the stateblock failed with error 0x%08x\n", hr); if (FAILED(hr)) ERR("Resetting the stateblock failed with error 0x%08x\n", hr);
else TRACE("Created stateblock %p\n", This->stateBlock); else TRACE("Created stateblock %p\n", This->stateBlock);
This->updateStateBlock = This->stateBlock; This->updateStateBlock = This->stateBlock;
......
...@@ -2843,8 +2843,7 @@ interface IWineD3DDevice : IWineD3DBase ...@@ -2843,8 +2843,7 @@ interface IWineD3DDevice : IWineD3DBase
); );
HRESULT CreateStateBlock( HRESULT CreateStateBlock(
[in] WINED3DSTATEBLOCKTYPE type, [in] WINED3DSTATEBLOCKTYPE type,
[out] IWineD3DStateBlock **stateblock, [out] IWineD3DStateBlock **stateblock
[in] IUnknown *parent
); );
HRESULT CreateSurface( HRESULT CreateSurface(
[in] UINT width, [in] UINT width,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment