From 4674b94d237c99e51a4c701ef71812e76d83d8ff Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 29 Mar 2011 19:21:51 +0200 Subject: [PATCH] wined3d: Get rid of struct wined3d_geometryshader. --- dlls/wined3d/device.c | 2 +- dlls/wined3d/shader.c | 24 ++++++++++++------------ dlls/wined3d/wined3d_private.h | 14 ++++---------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 6d4004101c1..6fe66ae1547 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1549,7 +1549,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateGeometryShader(IWineD3DDevice *if IWineD3DBaseShader **shader) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - struct wined3d_geometryshader *object; + IWineD3DBaseShaderImpl *object; HRESULT hr; object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index e7e5a1887e9..0eaf728c961 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -1913,8 +1913,8 @@ static HRESULT STDMETHODCALLTYPE geometryshader_QueryInterface(IWineD3DBaseShade static ULONG STDMETHODCALLTYPE geometryshader_AddRef(IWineD3DBaseShader *iface) { - struct wined3d_geometryshader *shader = (struct wined3d_geometryshader *)iface; - ULONG refcount = InterlockedIncrement(&shader->base_shader.ref); + IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)iface; + ULONG refcount = InterlockedIncrement(&shader->baseShader.ref); TRACE("%p increasing refcount to %u.\n", shader, refcount); @@ -1924,15 +1924,15 @@ static ULONG STDMETHODCALLTYPE geometryshader_AddRef(IWineD3DBaseShader *iface) /* Do not call while under the GL lock. */ static ULONG STDMETHODCALLTYPE geometryshader_Release(IWineD3DBaseShader *iface) { - struct wined3d_geometryshader *shader = (struct wined3d_geometryshader *)iface; - ULONG refcount = InterlockedDecrement(&shader->base_shader.ref); + IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)iface; + ULONG refcount = InterlockedDecrement(&shader->baseShader.ref); TRACE("%p decreasing refcount to %u.\n", shader, refcount); if (!refcount) { - shader_cleanup((IWineD3DBaseShaderImpl *)shader); - shader->base_shader.parent_ops->wined3d_object_destroyed(shader->base_shader.parent); + shader_cleanup(shader); + shader->baseShader.parent_ops->wined3d_object_destroyed(shader->baseShader.parent); HeapFree(GetProcessHeap(), 0, shader); } @@ -1975,24 +1975,24 @@ static const IWineD3DBaseShaderVtbl wined3d_geometryshader_vtbl = geometryshader_SetLocalConstantsF, }; -HRESULT geometryshader_init(struct wined3d_geometryshader *shader, IWineD3DDeviceImpl *device, +HRESULT geometryshader_init(IWineD3DBaseShaderImpl *shader, IWineD3DDeviceImpl *device, const DWORD *byte_code, const struct wined3d_shader_signature *output_signature, void *parent, const struct wined3d_parent_ops *parent_ops) { HRESULT hr; - shader->vtbl = &wined3d_geometryshader_vtbl; - shader_init(&shader->base_shader, device, parent, parent_ops); + shader->lpVtbl = &wined3d_geometryshader_vtbl; + shader_init(&shader->baseShader, device, parent, parent_ops); - hr = shader_set_function((IWineD3DBaseShaderImpl *)shader, byte_code, output_signature, 0); + hr = shader_set_function(shader, byte_code, output_signature, 0); if (FAILED(hr)) { WARN("Failed to set function, hr %#x.\n", hr); - shader_cleanup((IWineD3DBaseShaderImpl *)shader); + shader_cleanup(shader); return hr; } - shader->base_shader.load_local_constsF = FALSE; + shader->baseShader.load_local_constsF = FALSE; return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b61c86fa2f4..3c3a3259f11 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2738,6 +2738,10 @@ typedef struct IWineD3DBaseShaderImpl { } u; } IWineD3DBaseShaderImpl; +HRESULT geometryshader_init(IWineD3DBaseShaderImpl *shader, IWineD3DDeviceImpl *device, + const DWORD *byte_code, const struct wined3d_shader_signature *output_signature, + void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; + void find_vs_compile_args(const struct wined3d_state *state, IWineD3DBaseShaderImpl *shader, struct vs_compile_args *args) DECLSPEC_HIDDEN; HRESULT vertexshader_init(IWineD3DBaseShaderImpl *shader, IWineD3DDeviceImpl *device, @@ -2828,16 +2832,6 @@ static inline BOOL shader_constant_is_local(IWineD3DBaseShaderImpl* This, DWORD } -struct wined3d_geometryshader -{ - const struct IWineD3DBaseShaderVtbl *vtbl; - IWineD3DBaseShaderClass base_shader; -}; - -HRESULT geometryshader_init(struct wined3d_geometryshader *shader, IWineD3DDeviceImpl *device, - const DWORD *byte_code, const struct wined3d_shader_signature *output_signature, - void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; - /***************************************************************************** * IDirect3DPixelShader implementation structure */