Commit ebc77732 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Move the vertexblend support check to the template.

parent f981afd7
......@@ -2628,6 +2628,25 @@ static void transform_worldex(DWORD state, IWineD3DStateBlockImpl *stateblock, W
}
}
static void state_vertexblend_w(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
static BOOL once = FALSE;
switch(stateblock->renderState[WINED3DRS_VERTEXBLEND]) {
case WINED3DVBF_1WEIGHTS:
case WINED3DVBF_2WEIGHTS:
case WINED3DVBF_3WEIGHTS:
if(!once) {
once = TRUE;
/* TODO: Implement vertex blending in drawStridedSlow */
FIXME("Vertex blending enabled, but not supported by hardware\n");
}
break;
case WINED3DVBF_TWEENING:
WARN("Tweening not supported yet\n");
}
}
static void state_vertexblend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
WINED3DVERTEXBLENDFLAGS val = stateblock->renderState[WINED3DRS_VERTEXBLEND];
......@@ -2635,7 +2654,6 @@ static void state_vertexblend(DWORD state, IWineD3DStateBlockImpl *stateblock, W
case WINED3DVBF_1WEIGHTS:
case WINED3DVBF_2WEIGHTS:
case WINED3DVBF_3WEIGHTS:
if(GL_SUPPORT(ARB_VERTEX_BLEND)) {
glEnable(GL_VERTEX_BLEND_ARB);
checkGLcall("glEnable(GL_VERTEX_BLEND_ARB)");
......@@ -2653,24 +2671,12 @@ static void state_vertexblend(DWORD state, IWineD3DStateBlockImpl *stateblock, W
}
stateblock->wineD3DDevice->vertexBlendUsed = TRUE;
}
} else {
static BOOL once = FALSE;
if(!once) {
once = TRUE;
/* TODO: Implement vertex blending in drawStridedSlow */
FIXME("Vertex blending enabled, but not supported by hardware\n");
}
}
break;
case WINED3DVBF_DISABLE:
case WINED3DVBF_0WEIGHTS: /* for Indexed vertex blending - not supported */
if(GL_SUPPORT(ARB_VERTEX_BLEND)) {
glDisable(GL_VERTEX_BLEND_ARB);
checkGLcall("glDisable(GL_VERTEX_BLEND_ARB)");
} else {
TRACE("Vertex blending disabled\n");
}
break;
case WINED3DVBF_TWEENING:
......@@ -4330,7 +4336,8 @@ const struct StateEntryTemplate ffp_vertexstate_template[] = {
{ STATE_RENDER(WINED3DRS_SPECULARMATERIALSOURCE), { STATE_RENDER(WINED3DRS_COLORVERTEX), state_colormat }, 0 },
{ STATE_RENDER(WINED3DRS_AMBIENTMATERIALSOURCE), { STATE_RENDER(WINED3DRS_COLORVERTEX), state_colormat }, 0 },
{ STATE_RENDER(WINED3DRS_EMISSIVEMATERIALSOURCE), { STATE_RENDER(WINED3DRS_COLORVERTEX), state_colormat }, 0 },
{ STATE_RENDER(WINED3DRS_VERTEXBLEND), { STATE_RENDER(WINED3DRS_VERTEXBLEND), state_vertexblend }, 0 },
{ STATE_RENDER(WINED3DRS_VERTEXBLEND), { STATE_RENDER(WINED3DRS_VERTEXBLEND), state_vertexblend }, ARB_VERTEX_BLEND },
{ STATE_RENDER(WINED3DRS_VERTEXBLEND), { STATE_RENDER(WINED3DRS_VERTEXBLEND), state_vertexblend_w }, 0 },
{ STATE_RENDER(WINED3DRS_POINTSIZE), { STATE_RENDER(WINED3DRS_POINTSCALEENABLE), state_pscale }, 0 },
{ STATE_RENDER(WINED3DRS_POINTSIZE_MIN), { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), state_psizemin_arb }, ARB_POINT_PARAMETERS },
{ STATE_RENDER(WINED3DRS_POINTSIZE_MIN), { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), state_psizemin_ext }, EXT_POINT_PARAMETERS },
......
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