wined3d: Don't check for a "representative" in the MarkStateDirty() functions.

States without representative should never be called. Arguably they shouldn't
exist in the first place, but allowing them simplifies the state table.
This commit is contained in:
Henri Verbeet 2009-08-21 09:12:28 +02:00 committed by Alexandre Julliard
parent b2e543b22f
commit 4ec2b09d8f
3 changed files with 4 additions and 8 deletions

View File

@ -794,7 +794,7 @@ static void Context_MarkStateDirty(struct wined3d_context *context, DWORD state,
DWORD idx;
BYTE shift;
if(!rep || isStateDirty(context, rep)) return;
if (isStateDirty(context, rep)) return;
context->dirtyArray[context->numDirtyEntries++] = rep;
idx = rep >> 5;
@ -851,7 +851,8 @@ static struct wined3d_context *AddContextToArray(IWineD3DDeviceImpl *This,
/* Mark all states dirty to force a proper initialization of the states on the first use of the context
*/
for(state = 0; state <= STATE_HIGHEST; state++) {
Context_MarkStateDirty(This->contexts[This->numContexts], state, This->StateTable);
if (This->StateTable[state].representative)
Context_MarkStateDirty(This->contexts[This->numContexts], state, This->StateTable);
}
This->numContexts++;

View File

@ -7686,7 +7686,6 @@ void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) {
BYTE shift;
UINT i;
if(!rep) return;
for(i = 0; i < This->numContexts; i++) {
context = This->contexts[i];
if(isStateDirty(context, rep)) continue;

View File

@ -56,11 +56,7 @@ static void state_nogl(DWORD state, IWineD3DStateBlockImpl *stateblock, struct w
static void state_undefined(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
/* Print a WARN, this allows the stateblock code to loop over all states to generate a display
* list without causing confusing terminal output. Deliberately no special debug name here
* because its undefined.
*/
WARN("undefined state %d\n", state);
ERR("Undefined state.\n");
}
static void state_fillmode(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)