--- "H. Verbeet" hverbeet@gmail.com wrote:
SetVertexShader & SetPixelShader should not change the shader's refcount. Verified on win2k, DirectX 9.0c.
Changelog:
- Don't change the shader's refcount in SetVertexShader & SetPixelShader
26c6ae144caaaa6f7e40f7a7c6e3059851819ecf
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index c3a7f9c..a9c253f 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3761,7 +3761,6 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetVer
HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShader(IWineD3DDevice *iface, IWineD3DVertexShader* pShader) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DVertexShader *oldShader = This->updateStateBlock->vertexShader;
This->updateStateBlock->vertexShader = pShader; This->updateStateBlock->changed.vertexShader = TRUE;
@@ -3772,20 +3771,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetVer return D3D_OK; }
- if (pShader != NULL) {
IUnknown *newVertexShaderParent;
/* GetParent will add a ref, so leave it hanging until the vertex buffer is cleared */
TRACE("(%p) : setting pShader(%p)\n", This, pShader);
IWineD3DVertexShader_GetParent(pShader, &newVertexShaderParent);
- } else {
TRACE("Clear down the shader\n");
- }
- if (oldShader != NULL) {
IUnknown *oldVertexShaderParent;
IWineD3DVertexShader_GetParent(oldShader, &oldVertexShaderParent);
IUnknown_Release(oldVertexShaderParent);
IUnknown_Release(oldVertexShaderParent);
- }
- TRACE("(%p) : setting pShader(%p)\n", This, pShader);
The best thing to do is add an internal reference e.g. if (pShader != NULL) { IWineD3DVertexShader_AddRef(pShader) IWineD3DVertexShader_Release(oldShader)
___________________________________________________________ NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! http://uk.cars.yahoo.com/