Module: wine Branch: master Commit: b8dd5839efe0d40d1e85a826f127f5034b800135 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b8dd5839efe0d40d1e85a826f1...
Author: Stefan Dösinger stefan@codeweavers.com Date: Mon Jul 30 12:35:33 2007 +0200
wined3d: Store the position_transformed flag in the vdecl.
---
dlls/wined3d/drawprim.c | 11 +++-------- dlls/wined3d/vertexdeclaration.c | 12 ++++++++---- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 98cc4ec..c35ce69 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -160,14 +160,9 @@ void primitiveDeclarationConvertToStridedData( DWORD *streams = vertexDeclaration->streams;
/* Check for transformed vertices, disable vertex shader if present */ - strided->u.s.position_transformed = FALSE; - for (i = 0; i < vertexDeclaration->declarationWNumElements - 1; ++i) { - element = vertexDeclaration->pDeclarationWine + i; - - if (element->Usage == WINED3DDECLUSAGE_POSITIONT) { - strided->u.s.position_transformed = TRUE; - useVertexShaderFunction = FALSE; - } + strided->u.s.position_transformed = vertexDeclaration->position_transformed; + if(vertexDeclaration->position_transformed) { + useVertexShaderFunction = FALSE; }
/* Translate the declaration into strided data */ diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c index 2bbca7d..292f1f0 100644 --- a/dlls/wined3d/vertexdeclaration.c +++ b/dlls/wined3d/vertexdeclaration.c @@ -143,14 +143,18 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte
/* Do some static analysis on the elements to make reading the declaration more comfortable * for the drawing code - * - * First, find the Streams used in the declaration. The vertex buffers have to be loaded - * when drawing. */ This->num_streams = 0; + This->position_transformed = FALSE; for (i = 0; i < element_count; ++i) {
- /* Filter tesselation pseudo streams*/ + if(This->pDeclarationWine[i].Usage == WINED3DDECLUSAGE_POSITIONT) { + This->position_transformed = TRUE; + } + + /* Find the Streams used in the declaration. The vertex buffers have to be loaded + * when drawing, but filter tesselation pseudo streams + */ if(This->pDeclarationWine[i].Stream >= MAX_STREAMS) continue;
if(!isPreLoaded[This->pDeclarationWine[i].Stream]) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 240dca5..83915ff 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1228,6 +1228,7 @@ typedef struct IWineD3DVertexDeclarationImpl {
DWORD streams[MAX_STREAMS]; UINT num_streams; + BOOL position_transformed; } IWineD3DVertexDeclarationImpl;
extern const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl;