[PATCH 5/5] wined3d: Properly check if an attribute is used in state_colormat().
Henri Verbeet
hverbeet at codeweavers.com
Mon Aug 24 02:27:55 CDT 2009
---
dlls/wined3d/state.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 8b4eb8f..0bbd917 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],
--
1.6.0.6
More information about the wine-patches
mailing list