[PATCH 1/4] wined3d: Remove COM from the vertex declaration.

Henri Verbeet hverbeet at codeweavers.com
Wed Feb 2 13:22:50 CST 2011


---
 dlls/d3d10core/Makefile.in         |    2 +-
 dlls/d3d10core/d3d10core_private.h |    2 +-
 dlls/d3d10core/inputlayout.c       |    4 +-
 dlls/d3d8/d3d8_private.h           |    2 +-
 dlls/d3d8/device.c                 |    6 ++--
 dlls/d3d8/vertexdeclaration.c      |    4 +-
 dlls/d3d9/d3d9_private.h           |    2 +-
 dlls/d3d9/device.c                 |    6 ++--
 dlls/d3d9/vertexdeclaration.c      |    4 +-
 dlls/ddraw/ddraw.c                 |   13 +++----
 dlls/ddraw/ddraw_private.h         |    6 ++--
 dlls/ddraw/surface.c               |    4 +-
 dlls/ddraw/vertexbuffer.c          |    4 +-
 dlls/wined3d/device.c              |   10 ++++--
 dlls/wined3d/stateblock.c          |    6 ++--
 dlls/wined3d/vertexdeclaration.c   |   68 ++++++++++-------------------------
 dlls/wined3d/wined3d.spec          |    8 +++-
 dlls/wined3d/wined3d_private.h     |   16 +++-----
 include/wine/wined3d.idl           |   24 +++++-------
 19 files changed, 81 insertions(+), 110 deletions(-)

diff --git a/dlls/d3d10core/Makefile.in b/dlls/d3d10core/Makefile.in
index 4557741..96ff0fd 100644
--- a/dlls/d3d10core/Makefile.in
+++ b/dlls/d3d10core/Makefile.in
@@ -1,6 +1,6 @@
 MODULE    = d3d10core.dll
 IMPORTLIB = d3d10core
-IMPORTS   = dxguid uuid dxgi
+IMPORTS   = dxguid uuid dxgi wined3d
 
 C_SRCS = \
 	async.c \
diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h
index 6d45618..a13931a 100644
--- a/dlls/d3d10core/d3d10core_private.h
+++ b/dlls/d3d10core/d3d10core_private.h
@@ -156,7 +156,7 @@ struct d3d10_input_layout
     const struct ID3D10InputLayoutVtbl *vtbl;
     LONG refcount;
 
-    IWineD3DVertexDeclaration *wined3d_decl;
+    struct wined3d_vertex_declaration *wined3d_decl;
 };
 
 HRESULT d3d10_input_layout_init(struct d3d10_input_layout *layout, struct d3d10_device *device,
diff --git a/dlls/d3d10core/inputlayout.c b/dlls/d3d10core/inputlayout.c
index 2b8b716..4c5bfcd 100644
--- a/dlls/d3d10core/inputlayout.c
+++ b/dlls/d3d10core/inputlayout.c
@@ -131,7 +131,7 @@ static ULONG STDMETHODCALLTYPE d3d10_input_layout_AddRef(ID3D10InputLayout *ifac
 
     if (refcount == 1)
     {
-        IWineD3DVertexDeclaration_AddRef(This->wined3d_decl);
+        wined3d_vertex_declaration_incref(This->wined3d_decl);
     }
 
     return refcount;
@@ -146,7 +146,7 @@ static ULONG STDMETHODCALLTYPE d3d10_input_layout_Release(ID3D10InputLayout *ifa
 
     if (!refcount)
     {
-        IWineD3DVertexDeclaration_Release(This->wined3d_decl);
+        wined3d_vertex_declaration_decref(This->wined3d_decl);
     }
 
     return refcount;
diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h
index ed7c81a..d2dc3e5 100644
--- a/dlls/d3d8/d3d8_private.h
+++ b/dlls/d3d8/d3d8_private.h
@@ -438,7 +438,7 @@ typedef struct {
     DWORD *elements;
     DWORD elements_size; /* Size of elements, in bytes */
 
-    IWineD3DVertexDeclaration *wined3d_vertex_declaration;
+    struct wined3d_vertex_declaration *wined3d_vertex_declaration;
     DWORD shader_handle;
 } IDirect3DVertexDeclaration8Impl;
 
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 1ac9cea..8db0ce8 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -2063,7 +2063,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShader(IDirect3DDevice8 *ifa
 static HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShader(IDirect3DDevice8 *iface, DWORD *ppShader)
 {
     IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface);
-    IWineD3DVertexDeclaration *wined3d_declaration;
+    struct wined3d_vertex_declaration *wined3d_declaration;
     IDirect3DVertexDeclaration8 *d3d8_declaration;
     HRESULT hr;
 
@@ -2086,8 +2086,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShader(IDirect3DDevice8 *ifa
         return D3D_OK;
     }
 
-    d3d8_declaration = IWineD3DVertexDeclaration_GetParent(wined3d_declaration);
-    IWineD3DVertexDeclaration_Release(wined3d_declaration);
+    d3d8_declaration = wined3d_vertex_declaration_get_parent(wined3d_declaration);
+    wined3d_vertex_declaration_decref(wined3d_declaration);
     wined3d_mutex_unlock();
     *ppShader = ((IDirect3DVertexDeclaration8Impl *)d3d8_declaration)->shader_handle;
 
diff --git a/dlls/d3d8/vertexdeclaration.c b/dlls/d3d8/vertexdeclaration.c
index 58573a5..43abf77 100644
--- a/dlls/d3d8/vertexdeclaration.c
+++ b/dlls/d3d8/vertexdeclaration.c
@@ -53,7 +53,7 @@ static ULONG WINAPI IDirect3DVertexDeclaration8Impl_AddRef(IDirect3DVertexDeclar
     if (ref_count == 1)
     {
         wined3d_mutex_lock();
-        IWineD3DVertexDeclaration_AddRef(This->wined3d_vertex_declaration);
+        wined3d_vertex_declaration_incref(This->wined3d_vertex_declaration);
         wined3d_mutex_unlock();
     }
 
@@ -69,7 +69,7 @@ static ULONG WINAPI IDirect3DVertexDeclaration8Impl_Release(IDirect3DVertexDecla
 
     if (!ref_count) {
         wined3d_mutex_lock();
-        IWineD3DVertexDeclaration_Release(This->wined3d_vertex_declaration);
+        wined3d_vertex_declaration_decref(This->wined3d_vertex_declaration);
         wined3d_mutex_unlock();
     }
 
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h
index 9f9e5a9..c61bcd2 100644
--- a/dlls/d3d9/d3d9_private.h
+++ b/dlls/d3d9/d3d9_private.h
@@ -435,7 +435,7 @@ typedef struct IDirect3DVertexDeclaration9Impl {
   UINT element_count;
 
   /* IDirect3DVertexDeclaration9 fields */
-  IWineD3DVertexDeclaration *wineD3DVertexDeclaration;
+  struct wined3d_vertex_declaration *wineD3DVertexDeclaration;
   DWORD convFVF;
 
   /* Parent reference */
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index ca61934..1b6592e 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -2050,7 +2050,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(IDirect3DDevice9
 static HRESULT WINAPI IDirect3DDevice9Impl_GetVertexDeclaration(IDirect3DDevice9Ex *iface,
         IDirect3DVertexDeclaration9 **declaration)
 {
-    IWineD3DVertexDeclaration *wined3d_declaration = NULL;
+    struct wined3d_vertex_declaration *wined3d_declaration = NULL;
     HRESULT hr;
 
     TRACE("iface %p, declaration %p.\n", iface, declaration);
@@ -2061,9 +2061,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetVertexDeclaration(IDirect3DDevice9
     hr = IWineD3DDevice_GetVertexDeclaration(((IDirect3DDevice9Impl *)iface)->WineD3DDevice, &wined3d_declaration);
     if (SUCCEEDED(hr) && wined3d_declaration)
     {
-        *declaration = IWineD3DVertexDeclaration_GetParent(wined3d_declaration);
+        *declaration = wined3d_vertex_declaration_get_parent(wined3d_declaration);
         IDirect3DVertexDeclaration9_AddRef(*declaration);
-        IWineD3DVertexDeclaration_Release(wined3d_declaration);
+        wined3d_vertex_declaration_decref(wined3d_declaration);
     }
     else
     {
diff --git a/dlls/d3d9/vertexdeclaration.c b/dlls/d3d9/vertexdeclaration.c
index 88f912f..a478813 100644
--- a/dlls/d3d9/vertexdeclaration.c
+++ b/dlls/d3d9/vertexdeclaration.c
@@ -222,7 +222,7 @@ static ULONG WINAPI IDirect3DVertexDeclaration9Impl_AddRef(LPDIRECT3DVERTEXDECLA
         if (!This->convFVF)
         {
             wined3d_mutex_lock();
-            IWineD3DVertexDeclaration_AddRef(This->wineD3DVertexDeclaration);
+            wined3d_vertex_declaration_incref(This->wineD3DVertexDeclaration);
             wined3d_mutex_unlock();
         }
     }
@@ -239,7 +239,7 @@ void IDirect3DVertexDeclaration9Impl_Destroy(LPDIRECT3DVERTEXDECLARATION9 iface)
     }
 
     wined3d_mutex_lock();
-    IWineD3DVertexDeclaration_Release(This->wineD3DVertexDeclaration);
+    wined3d_vertex_declaration_decref(This->wineD3DVertexDeclaration);
     wined3d_mutex_unlock();
 }
 
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 01de508..f1ecd31 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -5638,14 +5638,13 @@ static const struct IDirect3DVtbl d3d1_vtbl =
  *  fvf: Fvf to find the decl for
  *
  * Returns:
- *  NULL in case of an error, the IWineD3DVertexDeclaration interface for the
- *  fvf otherwise.
+ *  NULL in case of an error, the vertex declaration for the FVF otherwise.
  *
  *****************************************************************************/
-IWineD3DVertexDeclaration *ddraw_find_decl(IDirectDrawImpl *This, DWORD fvf)
+struct wined3d_vertex_declaration *ddraw_find_decl(IDirectDrawImpl *This, DWORD fvf)
 {
+    struct wined3d_vertex_declaration *pDecl = NULL;
     HRESULT hr;
-    IWineD3DVertexDeclaration* pDecl = NULL;
     int p, low, high; /* deliberately signed */
     struct FvfToDecl *convertedDecls = This->decls;
 
@@ -5675,9 +5674,9 @@ IWineD3DVertexDeclaration *ddraw_find_decl(IDirectDrawImpl *This, DWORD fvf)
         int grow = max(This->declArraySize / 2, 8);
         convertedDecls = HeapReAlloc(GetProcessHeap(), 0, convertedDecls,
                                      sizeof(convertedDecls[0]) * (This->numConvertedDecls + grow));
-        if(!convertedDecls) {
-            /* This will destroy it */
-            IWineD3DVertexDeclaration_Release(pDecl);
+        if (!convertedDecls)
+        {
+            wined3d_vertex_declaration_decref(pDecl);
             return NULL;
         }
         This->decls = convertedDecls;
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index cb12faf..30b36bd 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -90,7 +90,7 @@ extern DWORD force_refresh_rate DECLSPEC_HIDDEN;
 struct FvfToDecl
 {
     DWORD fvf;
-    IWineD3DVertexDeclaration *decl;
+    struct wined3d_vertex_declaration *decl;
 };
 
 struct IDirectDrawImpl
@@ -182,7 +182,7 @@ void DDRAW_Convert_DDSCAPS_1_To_2(const DDSCAPS *pIn, DDSCAPS2 *pOut) DECLSPEC_H
 void DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(const DDDEVICEIDENTIFIER2 *pIn, DDDEVICEIDENTIFIER *pOut) DECLSPEC_HIDDEN;
 HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf,
         DDSURFACEDESC2 *desc, void *Context) DECLSPEC_HIDDEN;
-IWineD3DVertexDeclaration *ddraw_find_decl(IDirectDrawImpl *This, DWORD fvf) DECLSPEC_HIDDEN;
+struct wined3d_vertex_declaration *ddraw_find_decl(IDirectDrawImpl *This, DWORD fvf) DECLSPEC_HIDDEN;
 
 /* The default surface type */
 extern WINED3DSURFTYPE DefaultSurfaceType DECLSPEC_HIDDEN;
@@ -579,7 +579,7 @@ struct IDirect3DVertexBufferImpl
 
     /*** WineD3D and ddraw links ***/
     IWineD3DBuffer *wineD3DVertexBuffer;
-    IWineD3DVertexDeclaration *wineD3DVertexDeclaration;
+    struct wined3d_vertex_declaration *wineD3DVertexDeclaration;
     IDirectDrawImpl *ddraw;
 
     /*** Storage for D3D7 specific things ***/
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 0efa5ab..df303d0 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -366,9 +366,9 @@ static ULONG WINAPI ddraw_surface7_Release(IDirectDrawSurface7 *iface)
                 IWineD3DDevice_SetIndexBuffer(ddraw->wineD3DDevice, NULL, WINED3DFMT_UNKNOWN);
                 IWineD3DDevice_SetDepthStencilSurface(ddraw->wineD3DDevice, NULL);
                 IWineD3DDevice_SetVertexDeclaration(ddraw->wineD3DDevice, NULL);
-                for(i = 0; i < ddraw->numConvertedDecls; i++)
+                for (i = 0; i < ddraw->numConvertedDecls; ++i)
                 {
-                    IWineD3DVertexDeclaration_Release(ddraw->decls[i].decl);
+                    wined3d_vertex_declaration_decref(ddraw->decls[i].decl);
                 }
                 HeapFree(GetProcessHeap(), 0, ddraw->decls);
                 ddraw->numConvertedDecls = 0;
diff --git a/dlls/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c
index dc12dc2..b16a963 100644
--- a/dlls/ddraw/vertexbuffer.c
+++ b/dlls/ddraw/vertexbuffer.c
@@ -163,7 +163,7 @@ IDirect3DVertexBufferImpl_Release(IDirect3DVertexBuffer7 *iface)
             IWineD3DBuffer_Release(curVB); /* For the GetStreamSource */
         }
 
-        IWineD3DVertexDeclaration_Release(This->wineD3DVertexDeclaration);
+        wined3d_vertex_declaration_decref(This->wineD3DVertexDeclaration);
         IWineD3DBuffer_Release(This->wineD3DVertexBuffer);
         LeaveCriticalSection(&ddraw_cs);
         HeapFree(GetProcessHeap(), 0, This);
@@ -595,7 +595,7 @@ HRESULT d3d_vertex_buffer_init(IDirect3DVertexBufferImpl *buffer,
 
         return DDERR_INVALIDPARAMS;
     }
-    IWineD3DVertexDeclaration_AddRef(buffer->wineD3DVertexDeclaration);
+    wined3d_vertex_declaration_incref(buffer->wineD3DVertexDeclaration);
 
     LeaveCriticalSection(&ddraw_cs);
 
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a63959a..74023e1 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3296,8 +3296,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetVertexDeclaration(IWineD3DDevice* if
 
     TRACE("(%p) : pDecl=%p\n", This, pDecl);
 
-    if (pDecl) IWineD3DVertexDeclaration_AddRef(pDecl);
-    if (oldDecl) IWineD3DVertexDeclaration_Release(oldDecl);
+    if (pDecl)
+        wined3d_vertex_declaration_incref(pDecl);
+    if (oldDecl)
+        wined3d_vertex_declaration_decref(oldDecl);
 
     This->updateStateBlock->state.vertex_declaration = (IWineD3DVertexDeclarationImpl *)pDecl;
     This->updateStateBlock->changed.vertexDecl = TRUE;
@@ -3321,7 +3323,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetVertexDeclaration(IWineD3DDevice* if
     TRACE("(%p) : ppDecl=%p\n", This, ppDecl);
 
     *ppDecl = (IWineD3DVertexDeclaration *)This->stateBlock->state.vertex_declaration;
-    if (*ppDecl) IWineD3DVertexDeclaration_AddRef(*ppDecl);
+    if (*ppDecl)
+        wined3d_vertex_declaration_incref(*ppDecl);
+
     return WINED3D_OK;
 }
 
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index dd3fd93..170b11e 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -477,7 +477,7 @@ ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
         int counter;
 
         if (stateblock->state.vertex_declaration)
-            IWineD3DVertexDeclaration_Release((IWineD3DVertexDeclaration *)stateblock->state.vertex_declaration);
+            wined3d_vertex_declaration_incref(stateblock->state.vertex_declaration);
 
         for (counter = 0; counter < MAX_COMBINED_SAMPLERS; counter++)
         {
@@ -729,9 +729,9 @@ HRESULT CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
                 stateblock->state.vertex_declaration, src_state->vertex_declaration);
 
         if (src_state->vertex_declaration)
-                IWineD3DVertexDeclaration_AddRef((IWineD3DVertexDeclaration *)src_state->vertex_declaration);
+                wined3d_vertex_declaration_incref(src_state->vertex_declaration);
         if (stateblock->state.vertex_declaration)
-                IWineD3DVertexDeclaration_Release((IWineD3DVertexDeclaration *)stateblock->state.vertex_declaration);
+                wined3d_vertex_declaration_decref(stateblock->state.vertex_declaration);
         stateblock->state.vertex_declaration = src_state->vertex_declaration;
     }
 
diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c
index 59219f0..9b04e5e 100644
--- a/dlls/wined3d/vertexdeclaration.c
+++ b/dlls/wined3d/vertexdeclaration.c
@@ -37,53 +37,36 @@ static void dump_wined3dvertexelement(const WINED3DVERTEXELEMENT *element) {
     TRACE("  usage_idx: %u\n", element->usage_idx);
 }
 
-/* *******************************************
-   IWineD3DVertexDeclaration IUnknown parts follow
-   ******************************************* */
-static HRESULT WINAPI IWineD3DVertexDeclarationImpl_QueryInterface(IWineD3DVertexDeclaration *iface, REFIID riid, LPVOID *ppobj)
+ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration)
 {
-    IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface;
-    TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj);
-    if (IsEqualGUID(riid, &IID_IUnknown)
-        || IsEqualGUID(riid, &IID_IWineD3DBase)
-        || IsEqualGUID(riid, &IID_IWineD3DVertexDeclaration)){
-        IUnknown_AddRef(iface);
-        *ppobj = This;
-        return S_OK;
-    }
-    *ppobj = NULL;
-    return E_NOINTERFACE;
-}
+    ULONG refcount = InterlockedIncrement(&declaration->ref);
+
+    TRACE("%p increasing refcount to %u.\n", declaration, refcount);
 
-static ULONG WINAPI IWineD3DVertexDeclarationImpl_AddRef(IWineD3DVertexDeclaration *iface) {
-    IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface;
-    TRACE("(%p) : AddRef increasing from %d\n", This, This->ref);
-    return InterlockedIncrement(&This->ref);
+    return refcount;
 }
 
-static ULONG WINAPI IWineD3DVertexDeclarationImpl_Release(IWineD3DVertexDeclaration *iface) {
-    IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface;
-    ULONG ref;
-    TRACE("(%p) : Releasing from %d\n", This, This->ref);
-    ref = InterlockedDecrement(&This->ref);
-    if (!ref)
+ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)
+{
+    ULONG refcount = InterlockedDecrement(&declaration->ref);
+
+    TRACE("%p decreasing refcount to %u.\n", declaration, refcount);
+
+    if (!refcount)
     {
-        HeapFree(GetProcessHeap(), 0, This->elements);
-        This->parent_ops->wined3d_object_destroyed(This->parent);
-        HeapFree(GetProcessHeap(), 0, This);
+        HeapFree(GetProcessHeap(), 0, declaration->elements);
+        declaration->parent_ops->wined3d_object_destroyed(declaration->parent);
+        HeapFree(GetProcessHeap(), 0, declaration);
     }
-    return ref;
-}
 
-/* *******************************************
-   IWineD3DVertexDeclaration parts follow
-   ******************************************* */
+    return refcount;
+}
 
-static void * WINAPI IWineD3DVertexDeclarationImpl_GetParent(IWineD3DVertexDeclaration *iface)
+void * CDECL wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration)
 {
-    TRACE("iface %p.\n", iface);
+    TRACE("declaration %p.\n", declaration);
 
-    return ((IWineD3DVertexDeclarationImpl *)iface)->parent;
+    return declaration->parent;
 }
 
 static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element)
@@ -174,16 +157,6 @@ static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element)
     }
 }
 
-static const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl =
-{
-    /* IUnknown */
-    IWineD3DVertexDeclarationImpl_QueryInterface,
-    IWineD3DVertexDeclarationImpl_AddRef,
-    IWineD3DVertexDeclarationImpl_Release,
-    /* IWineD3DVertexDeclaration */
-    IWineD3DVertexDeclarationImpl_GetParent,
-};
-
 HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWineD3DDeviceImpl *device,
         const WINED3DVERTEXELEMENT *elements, UINT element_count,
         void *parent, const struct wined3d_parent_ops *parent_ops)
@@ -200,7 +173,6 @@ HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWine
         }
     }
 
-    declaration->lpVtbl = &IWineD3DVertexDeclaration_Vtbl;
     declaration->ref = 1;
     declaration->parent = parent;
     declaration->parent_ops = parent_ops;
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 491aa97..bc93908 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -18,11 +18,15 @@
 @ cdecl wined3d_get_device_caps(ptr long long ptr)
 @ cdecl wined3d_get_parent(ptr)
 @ cdecl wined3d_incref(ptr)
-@ cdecl wined3d_register_software_device(ptr ptr);
+@ cdecl wined3d_register_software_device(ptr ptr)
 
-@ cdecl wined3d_device_create(ptr long long ptr long ptr ptr);
+@ cdecl wined3d_device_create(ptr long long ptr long ptr ptr)
 
 @ cdecl wined3d_stateblock_apply(ptr)
 @ cdecl wined3d_stateblock_capture(ptr)
 @ cdecl wined3d_stateblock_decref(ptr)
 @ cdecl wined3d_stateblock_incref(ptr)
+
+@ cdecl wined3d_vertex_declaration_decref(ptr)
+@ cdecl wined3d_vertex_declaration_get_parent(ptr)
+@ cdecl wined3d_vertex_declaration_incref(ptr)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6af34e1..7fb3571 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -59,6 +59,8 @@ typedef struct IWineD3DSwapChainImpl  IWineD3DSwapChainImpl;
 struct IWineD3DBaseShaderImpl;
 struct IWineD3DBaseTextureImpl;
 struct IWineD3DResourceImpl;
+typedef struct wined3d_vertex_declaration IWineD3DVertexDeclaration;
+typedef struct wined3d_vertex_declaration IWineD3DVertexDeclarationImpl;
 
 /* Texture format fixups */
 
@@ -2296,10 +2298,6 @@ void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *surface, BYTE table[256][4], BO
 
 BOOL palette9_changed(IWineD3DSurfaceImpl *This) DECLSPEC_HIDDEN;
 
-/*****************************************************************************
- * IWineD3DVertexDeclaration implementation structure
- */
-
 struct wined3d_vertex_declaration_element
 {
     const struct wined3d_format *format;
@@ -2312,11 +2310,9 @@ struct wined3d_vertex_declaration_element
     BYTE usage_idx;
 };
 
-typedef struct IWineD3DVertexDeclarationImpl {
-    /* IUnknown  Information */
-    const IWineD3DVertexDeclarationVtbl *lpVtbl;
-    LONG                    ref;
-
+struct wined3d_vertex_declaration
+{
+    LONG ref;
     void *parent;
     const struct wined3d_parent_ops *parent_ops;
     IWineD3DDeviceImpl *device;
@@ -2328,7 +2324,7 @@ typedef struct IWineD3DVertexDeclarationImpl {
     UINT                    num_streams;
     BOOL                    position_transformed;
     BOOL                    half_float_conv_needed;
-} IWineD3DVertexDeclarationImpl;
+};
 
 HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWineD3DDeviceImpl *device,
         const WINED3DVERTEXELEMENT *elements, UINT element_count,
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index b3b5238..76b41a3 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -2112,6 +2112,7 @@ interface IWineD3DSwapChain;
 interface IWineD3DDevice;
 struct wined3d;
 struct wined3d_stateblock;
+struct wined3d_vertex_declaration;
 
 [
     object,
@@ -2521,15 +2522,6 @@ interface IWineD3DVolumeTexture : IWineD3DBaseTexture
 [
     object,
     local,
-    uuid(7cd55be6-6f30-11d9-c687-00046142c14f)
-]
-interface IWineD3DVertexDeclaration : IWineD3DBase
-{
-}
-
-[
-    object,
-    local,
     uuid(905ddbac-6f30-11d9-c687-00046142c14f)
 ]
 interface IWineD3DQuery : IUnknown
@@ -2775,13 +2767,13 @@ interface IWineD3DDevice : IUnknown
         [in] UINT element_count,
         [in] void *parent,
         [in] const struct wined3d_parent_ops *parent_ops,
-        [out] IWineD3DVertexDeclaration **declaration
+        [out] struct wined3d_vertex_declaration **declaration
     );
     HRESULT CreateVertexDeclarationFromFVF(
         [in] DWORD fvf,
         [in] void *parent,
         [in] const struct wined3d_parent_ops *parent_ops,
-        [out] IWineD3DVertexDeclaration **declaration
+        [out] struct wined3d_vertex_declaration **declaration
     );
     HRESULT CreateVertexShader(
         [in] const DWORD *function,
@@ -3083,10 +3075,10 @@ interface IWineD3DDevice : IUnknown
         [out] WINED3DMATRIX *matrix
     );
     HRESULT SetVertexDeclaration(
-        [in] IWineD3DVertexDeclaration *declaration
+        [in] struct wined3d_vertex_declaration *declaration
     );
     HRESULT GetVertexDeclaration(
-        [out] IWineD3DVertexDeclaration **declaration
+        [out] struct wined3d_vertex_declaration **declaration
     );
     HRESULT SetVertexShader(
         [in] IWineD3DVertexShader *shader
@@ -3141,7 +3133,7 @@ interface IWineD3DDevice : IUnknown
         [in] UINT dst_idx,
         [in] UINT vertex_count,
         [in] IWineD3DBuffer *dest_buffer,
-        [in] IWineD3DVertexDeclaration *declaration,
+        [in] struct wined3d_vertex_declaration *declaration,
         [in] DWORD flags,
         [in] DWORD DestFVF
     );
@@ -3310,3 +3302,7 @@ HRESULT __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateb
 HRESULT __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock);
 ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock);
 ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock);
+
+ULONG __cdecl wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration);
+void * __cdecl wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration);
+ULONG __cdecl wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration);
-- 
1.7.3.4




More information about the wine-patches mailing list