Commit 09bf3d5a authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Keep track of shaders.

parent c3c6c6f5
......@@ -1142,6 +1142,7 @@ ULONG WINAPI IWineD3DBaseShaderImpl_Release(IWineD3DBaseShader *iface) {
shader_delete_constant_list(&This->baseShader.constantsF);
shader_delete_constant_list(&This->baseShader.constantsB);
shader_delete_constant_list(&This->baseShader.constantsI);
list_remove(&This->baseShader.shader_list_entry);
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......
......@@ -1883,6 +1883,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice *ifac
IWineD3DVertexShader_Release(*ppVertexShader);
return WINED3DERR_INVALIDCALL;
}
list_add_head(&This->shaders, &object->baseShader.shader_list_entry);
return WINED3D_OK;
}
......@@ -1897,6 +1898,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface
hr = IWineD3DPixelShader_SetFunction(*ppPixelShader, pFunction);
if (WINED3D_OK == hr) {
TRACE("(%p) : Created Pixel shader %p\n", This, *ppPixelShader);
list_add_head(&This->shaders, &object->baseShader.shader_list_entry);
} else {
WARN("(%p) : Failed to create pixel shader\n", This);
}
......
......@@ -2742,6 +2742,7 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
IWineD3D_AddRef(object->wineD3D);
object->parent = parent;
list_init(&object->resources);
list_init(&object->shaders);
if(This->dxVersion == 7) {
object->surface_alignment = 8;
......
......@@ -675,6 +675,7 @@ struct IWineD3DDeviceImpl
UINT NumberOfSwapChains;
struct list resources; /* a linked list to track resources created by the device */
struct list shaders; /* a linked list to track shaders (pixel and vertex) */
/* Render Target Support */
IWineD3DSurface **render_targets;
......@@ -1970,6 +1971,7 @@ typedef struct IWineD3DBaseShaderClass
/* Pointer to the parent device */
IWineD3DDevice *device;
struct list shader_list_entry;
} IWineD3DBaseShaderClass;
......
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