From 7823679e20ca38085196848e4c764599c6f2ba37 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 24 Aug 2009 09:27:55 +0200 Subject: [PATCH] wined3d: Properly check if an attribute is used in state_colormat(). --- dlls/wined3d/state.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 8b4eb8f8a51..0bbd917c3b1 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1177,8 +1177,6 @@ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, stru { IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; GLenum Parm = 0; - const struct wined3d_stream_info_element *diffuse = &device->strided_streams.elements[WINED3D_FFP_DIFFUSE]; - BOOL isDiffuseSupplied; /* Depends on the decoded vertex declaration to read the existence of diffuse data. * The vertex declaration will call this function if the fixed function pipeline is used. @@ -1188,10 +1186,10 @@ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, stru return; } - isDiffuseSupplied = diffuse->data || diffuse->buffer_object; - context->num_untracked_materials = 0; - if (isDiffuseSupplied && stateblock->renderState[WINED3DRS_COLORVERTEX]) { + if ((device->strided_streams.use_map & (1 << WINED3D_FFP_DIFFUSE)) + && stateblock->renderState[WINED3DRS_COLORVERTEX]) + { TRACE("diff %d, amb %d, emis %d, spec %d\n", stateblock->renderState[WINED3DRS_DIFFUSEMATERIALSOURCE], stateblock->renderState[WINED3DRS_AMBIENTMATERIALSOURCE],