From bda89180e15c861ce64993fceefcef85737b8000 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 25 Aug 2009 08:17:11 +0200 Subject: [PATCH] wined3d: Properly check if an attribute is used in streamsrc(). --- dlls/wined3d/state.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 0bbd917c3b..8e05464086 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4426,18 +4426,23 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wi device->useDrawStridedSlow = FALSE; } } - else if (fixup || (!dataLocations->elements[WINED3D_FFP_PSIZE].data - && !dataLocations->position_transformed - && (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) - || (!dataLocations->elements[WINED3D_FFP_DIFFUSE].data - && !dataLocations->elements[WINED3D_FFP_SPECULAR].data)))) + else { - /* Load the vertex data using named arrays */ - load_named = TRUE; - device->useDrawStridedSlow = FALSE; - } else { - TRACE("Not loading vertex data\n"); - device->useDrawStridedSlow = TRUE; + WORD slow_mask = (1 << WINED3D_FFP_PSIZE); + slow_mask |= -!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) & ((1 << WINED3D_FFP_DIFFUSE) | (1 << WINED3D_FFP_SPECULAR)); + + if (fixup || (!dataLocations->position_transformed + && !(dataLocations->use_map & slow_mask))) + { + /* Load the vertex data using named arrays */ + load_named = TRUE; + device->useDrawStridedSlow = FALSE; + } + else + { + TRACE("Not loading vertex data\n"); + device->useDrawStridedSlow = TRUE; + } } if (context->numberedArraysLoaded && !load_numbered)