H. Verbeet : d3d8: IDirect3DDevice8Impl_GetVertexShaderDeclaration gets passed a handle instead of a pointer .

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jan 8 06:35:15 CST 2007


Module: wine
Branch: master
Commit: d73e5d6fc8e7bc5ae9f90a476f983680d85d62ea
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d73e5d6fc8e7bc5ae9f90a476f983680d85d62ea

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Sat Jan  6 18:04:01 2007 +0100

d3d8: IDirect3DDevice8Impl_GetVertexShaderDeclaration gets passed a handle instead of a pointer.

---

 dlls/d3d8/device.c |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 1f8bb6e..b6fde8f 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -1290,13 +1290,29 @@ static HRESULT WINAPI IDirect3DDevice8Im
     return IWineD3DDevice_GetVertexShaderConstantF(This->WineD3DDevice, Register, (float *)pConstantData, ConstantCount);
 }
 
+/* FIXME: There currently isn't a proper way to retrieve the declaration from
+ * the wined3d shader. However, rather than simply adding this, the relation
+ * between d3d8 and wined3d shaders should be fixed. A d3d8 vertex shader
+ * should contain both a wined3d vertex shader and a wined3d vertex
+ * declaration, and eg. SetVertexShader in d3d8 should set both of them in
+ * wined3d. This would also allow us to get rid of the vertexDeclaration field
+ * in IWineD3DVertexShaderImpl */
 static HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderDeclaration(LPDIRECT3DDEVICE8 iface, DWORD pVertexShader, void* pData, DWORD* pSizeOfData) {
-    IDirect3DVertexShader8Impl *This = (IDirect3DVertexShader8Impl *)pVertexShader;
+    IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
+    IDirect3DVertexShader8Impl *shader = NULL;
 
-    TRACE("(%p) : Relay\n", This);
-/*    return IWineD3DVertexShader_GetDeclaration(This->wineD3DVertexShader, pData, (UINT *)pSizeOfData); */
+    TRACE("(%p) : pVertexShader %#x, pData %p, pSizeOfData %p\n", This, pVertexShader, pData, pSizeOfData);
+
+    if (pVertexShader <= VS_HIGHESTFIXEDFXF || This->allocated_shader_handles <= pVertexShader - (VS_HIGHESTFIXEDFXF + 1)) {
+        ERR("Passed an invalid shader handle.\n");
+        return D3DERR_INVALIDCALL;
+    }
+
+    shader = This->shader_handles[pVertexShader - (VS_HIGHESTFIXEDFXF + 1)];
+    FIXME("Unimplemented, returning D3DERR_INVALIDCALL\n");
     return D3DERR_INVALIDCALL;
 }
+
 static HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderFunction(LPDIRECT3DDEVICE8 iface, DWORD pVertexShader, void* pData, DWORD* pSizeOfData) {
     IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
     IDirect3DVertexShader8Impl *shader = NULL;




More information about the wine-cvs mailing list