From 6afd97cc9f15e211f6cf81d15630ce3b450645cf Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 26 Mar 2009 10:43:39 +0100 Subject: [PATCH] wined3d: Remove unused attributes from WineDirect3DVertexStridedData. These are essentially unused, and mostly just complicate the code. --- dlls/wined3d/device.c | 8 ------ dlls/wined3d/drawprim.c | 56 ---------------------------------------- dlls/wined3d/state.c | 22 ---------------- include/wine/wined3d.idl | 9 ------- 4 files changed, 95 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 9c7e6ca8744..73d1ac879f8 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4703,14 +4703,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface, for(i = 0; i < WINED3DDP_MAXTEXCOORD; i++) { FIXSRC(texCoords[i]); } - FIXSRC(position2); - FIXSRC(normal2); - FIXSRC(tangent); - FIXSRC(binormal); - FIXSRC(tessFactor); - FIXSRC(fog); - FIXSRC(depth); - FIXSRC(sample); #undef FIXSRC } diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 3f61b8a2793..e40869637a9 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -57,22 +57,6 @@ static BOOL fixed_get_input( *regnum = 6; else if (usage == WINED3DDECLUSAGE_TEXCOORD && usage_idx < WINED3DDP_MAXTEXCOORD) *regnum = 7 + usage_idx; - else if ((usage == WINED3DDECLUSAGE_POSITION || usage == WINED3DDECLUSAGE_POSITIONT) && usage_idx == 1) - *regnum = 7 + WINED3DDP_MAXTEXCOORD; - else if (usage == WINED3DDECLUSAGE_NORMAL && usage_idx == 1) - *regnum = 8 + WINED3DDP_MAXTEXCOORD; - else if (usage == WINED3DDECLUSAGE_TANGENT && usage_idx == 0) - *regnum = 9 + WINED3DDP_MAXTEXCOORD; - else if (usage == WINED3DDECLUSAGE_BINORMAL && usage_idx == 0) - *regnum = 10 + WINED3DDP_MAXTEXCOORD; - else if (usage == WINED3DDECLUSAGE_TESSFACTOR && usage_idx == 0) - *regnum = 11 + WINED3DDP_MAXTEXCOORD; - else if (usage == WINED3DDECLUSAGE_FOG && usage_idx == 0) - *regnum = 12 + WINED3DDP_MAXTEXCOORD; - else if (usage == WINED3DDECLUSAGE_DEPTH && usage_idx == 0) - *regnum = 13 + WINED3DDP_MAXTEXCOORD; - else if (usage == WINED3DDECLUSAGE_SAMPLE && usage_idx == 0) - *regnum = 14 + WINED3DDP_MAXTEXCOORD; if (*regnum == -1) { FIXME("Unsupported input stream [usage=%s, usage_idx=%u]\n", @@ -742,46 +726,6 @@ static inline void remove_vbos(IWineD3DDeviceImpl *This, WineDirect3DVertexStrid s->u.s.texCoords[i].lpData = (BYTE *) ((unsigned long) s->u.s.texCoords[i].lpData + (unsigned long) vb->resource.allocatedMemory); } } - if(s->u.s.position2.VBO) { - vb = (struct wined3d_buffer *)This->stateBlock->streamSource[s->u.s.position2.streamNo]; - s->u.s.position2.VBO = 0; - s->u.s.position2.lpData = (BYTE *) ((unsigned long) s->u.s.position2.lpData + (unsigned long) vb->resource.allocatedMemory); - } - if(s->u.s.normal2.VBO) { - vb = (struct wined3d_buffer *)This->stateBlock->streamSource[s->u.s.normal2.streamNo]; - s->u.s.normal2.VBO = 0; - s->u.s.normal2.lpData = (BYTE *) ((unsigned long) s->u.s.normal2.lpData + (unsigned long) vb->resource.allocatedMemory); - } - if(s->u.s.tangent.VBO) { - vb = (struct wined3d_buffer *)This->stateBlock->streamSource[s->u.s.tangent.streamNo]; - s->u.s.tangent.VBO = 0; - s->u.s.tangent.lpData = (BYTE *) ((unsigned long) s->u.s.tangent.lpData + (unsigned long) vb->resource.allocatedMemory); - } - if(s->u.s.binormal.VBO) { - vb = (struct wined3d_buffer *)This->stateBlock->streamSource[s->u.s.binormal.streamNo]; - s->u.s.binormal.VBO = 0; - s->u.s.binormal.lpData = (BYTE *) ((unsigned long) s->u.s.binormal.lpData + (unsigned long) vb->resource.allocatedMemory); - } - if(s->u.s.tessFactor.VBO) { - vb = (struct wined3d_buffer *)This->stateBlock->streamSource[s->u.s.tessFactor.streamNo]; - s->u.s.tessFactor.VBO = 0; - s->u.s.tessFactor.lpData = (BYTE *) ((unsigned long) s->u.s.tessFactor.lpData + (unsigned long) vb->resource.allocatedMemory); - } - if(s->u.s.fog.VBO) { - vb = (struct wined3d_buffer *)This->stateBlock->streamSource[s->u.s.fog.streamNo]; - s->u.s.fog.VBO = 0; - s->u.s.fog.lpData = (BYTE *) ((unsigned long) s->u.s.fog.lpData + (unsigned long) vb->resource.allocatedMemory); - } - if(s->u.s.depth.VBO) { - vb = (struct wined3d_buffer *)This->stateBlock->streamSource[s->u.s.depth.streamNo]; - s->u.s.depth.VBO = 0; - s->u.s.depth.lpData = (BYTE *) ((unsigned long) s->u.s.depth.lpData + (unsigned long) vb->resource.allocatedMemory); - } - if(s->u.s.sample.VBO) { - vb = (struct wined3d_buffer *)This->stateBlock->streamSource[s->u.s.sample.streamNo]; - s->u.s.sample.VBO = 0; - s->u.s.sample.lpData = (BYTE *) ((unsigned long) s->u.s.sample.lpData + (unsigned long) vb->resource.allocatedMemory); - } } /* Routine common to the draw primitive and draw indexed primitive routines */ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 55f2ff49412..6035c715e76 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4243,14 +4243,6 @@ static inline void drawPrimitiveTraceDataLocations(const WineDirect3DVertexStrid TRACE_STRIDED((dataLocations), texCoords[5]); TRACE_STRIDED((dataLocations), texCoords[6]); TRACE_STRIDED((dataLocations), texCoords[7]); - TRACE_STRIDED((dataLocations), position2); - TRACE_STRIDED((dataLocations), normal2); - TRACE_STRIDED((dataLocations), tangent); - TRACE_STRIDED((dataLocations), binormal); - TRACE_STRIDED((dataLocations), tessFactor); - TRACE_STRIDED((dataLocations), fog); - TRACE_STRIDED((dataLocations), depth); - TRACE_STRIDED((dataLocations), sample); return; } @@ -4333,20 +4325,6 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo loadVertexData(stateblock, dataLocations); context->namedArraysLoaded = TRUE; } - -/* Generate some fixme's if unsupported functionality is being used */ -#define BUFFER_OR_DATA(_attribute) dataLocations->u.s._attribute.lpData - /* TODO: Either support missing functionality in fixupVertices or by creating a shader to replace the pipeline. */ - if (!useVertexShaderFunction && (BUFFER_OR_DATA(position2) || BUFFER_OR_DATA(normal2))) { - FIXME("Tweening is only valid with vertex shaders\n"); - } - if (!useVertexShaderFunction && BUFFER_OR_DATA(binormal)) { - FIXME("Binormal bump mapping is only valid with vertex shaders\n"); - } - if (!useVertexShaderFunction && (BUFFER_OR_DATA(tessFactor) || BUFFER_OR_DATA(fog) || BUFFER_OR_DATA(depth) || BUFFER_OR_DATA(sample))) { - FIXME("Extended attributes are only valid with vertex shaders\n"); - } -#undef BUFFER_OR_DATA } static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl index 5d502f1dfc0..4cf9159b714 100644 --- a/include/wine/wined3d.idl +++ b/include/wine/wined3d.idl @@ -1945,15 +1945,6 @@ typedef struct WineDirect3DVertexStridedData WineDirect3DStridedData diffuse; WineDirect3DStridedData specular; WineDirect3DStridedData texCoords[WINED3DDP_MAXTEXCOORD]; - WineDirect3DStridedData position2; /* tween data */ - WineDirect3DStridedData normal2; /* tween data */ - WineDirect3DStridedData tangent; - WineDirect3DStridedData binormal; - WineDirect3DStridedData tessFactor; - WineDirect3DStridedData fog; - WineDirect3DStridedData depth; - WineDirect3DStridedData sample; - /* Add fields here */ } s; WineDirect3DStridedData input[16]; /* Indexed by constants in D3DVSDE_REGISTER */