Commit 7823679e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Properly check if an attribute is used in state_colormat().

parent c1c58f85
......@@ -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],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment