d3d8: Don't store shader_handle's.

They're not stable across table resizes.
This commit is contained in:
H. Verbeet 2008-08-19 17:50:12 +02:00 committed by Alexandre Julliard
parent f71fdecdc7
commit 898c2c9778
2 changed files with 8 additions and 8 deletions

View File

@ -600,7 +600,7 @@ struct IDirect3DVertexShader8Impl {
const IDirect3DVertexShader8Vtbl *lpVtbl;
LONG ref;
shader_handle *handle;
DWORD handle;
IDirect3DVertexDeclaration8 *vertex_declaration;
IWineD3DVertexShader *wineD3DVertexShader;
};
@ -623,7 +623,7 @@ typedef struct IDirect3DPixelShader8Impl {
const IDirect3DPixelShader8Vtbl *lpVtbl;
LONG ref;
shader_handle *handle;
DWORD handle;
/* The device, to be replaced by an IDirect3DDeviceImpl */
IWineD3DPixelShader *wineD3DPixelShader;
} IDirect3DPixelShader8Impl;

View File

@ -1581,9 +1581,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8
IDirect3DVertexShader8_Release((IUnknown *)object);
hrc = E_OUTOFMEMORY;
} else {
object->handle = handle;
*handle = object;
*ppShader = (handle - This->shader_handles) + VS_HIGHESTFIXEDFXF + 1;
object->handle = (handle - This->shader_handles) + VS_HIGHESTFIXEDFXF + 1;
*ppShader = object->handle;
load_local_constants(pDeclaration, object->wineD3DVertexShader);
TRACE("(%p) : returning %p (handle %#x)\n", This, object, *ppShader);
@ -1689,7 +1689,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShader(LPDIRECT3DDEVICE8 ifa
IDirect3DVertexShader8Impl *d3d8_shader;
hrc = IWineD3DVertexShader_GetParent(pShader, (IUnknown **)&d3d8_shader);
IWineD3DVertexShader_Release(pShader);
*ppShader = (d3d8_shader->handle - This->shader_handles) + (VS_HIGHESTFIXEDFXF + 1);
*ppShader = d3d8_shader->handle;
} else {
*ppShader = 0;
hrc = D3D_OK;
@ -1889,9 +1889,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 i
IDirect3DVertexShader8_Release((IUnknown *)object);
hrc = E_OUTOFMEMORY;
} else {
object->handle = handle;
*handle = object;
*ppShader = (handle - This->shader_handles) + VS_HIGHESTFIXEDFXF + 1;
object->handle = (handle - This->shader_handles) + VS_HIGHESTFIXEDFXF + 1;
*ppShader = object->handle;
TRACE("(%p) : returning %p (handle %#x)\n", This, object, *ppShader);
}
}
@ -1938,7 +1938,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShader(LPDIRECT3DDEVICE8 ifac
IDirect3DPixelShader8Impl *d3d8_shader;
hrc = IWineD3DPixelShader_GetParent(object, (IUnknown **)&d3d8_shader);
IWineD3DPixelShader_Release(object);
*ppShader = (d3d8_shader->handle - This->shader_handles) + (VS_HIGHESTFIXEDFXF + 1);
*ppShader = d3d8_shader->handle;
} else {
*ppShader = (DWORD)NULL;
}