Module: wine Branch: master Commit: a52edd78108c82b85b5954938a05a775b00778dc URL: http://source.winehq.org/git/wine.git/?a=commit;h=a52edd78108c82b85b5954938a...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Dec 18 17:59:06 2008 +0100
wined3d: Don't call allocate_shader_constants() from Init3D().
CreateStateBlock() should take care of that.
---
dlls/wined3d/device.c | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index dc7017b..09f4739 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -340,6 +340,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, list_init(&object->lightMap[i]); }
+ temp_result = allocate_shader_constants(object); + if (FAILED(temp_result)) + { + HeapFree(GetProcessHeap(), 0, object); + return temp_result; + } + /* Special case - Used during initialization to produce a placeholder stateblock so other functions called can update a state block */ if (Type == WINED3DSBT_INIT) { @@ -347,10 +354,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, be freed due to circular dependencies */ return WINED3D_OK; } - - temp_result = allocate_shader_constants(object); - if (WINED3D_OK != temp_result) - return temp_result;
/* Otherwise, might as well set the whole state block to the appropriate values */ if (This->stateBlock != NULL) @@ -2085,11 +2088,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR This->updateStateBlock = This->stateBlock; IWineD3DStateBlock_AddRef((IWineD3DStateBlock*)This->updateStateBlock);
- hr = allocate_shader_constants(This->updateStateBlock); - if (WINED3D_OK != hr) { - goto err_out; - } - This->render_targets = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IWineD3DSurface *) * GL_LIMITS(buffers)); This->draw_buffers = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLenum) * GL_LIMITS(buffers));