wined3d: Do the ffp_valid check before even trying to use the element.

This commit is contained in:
Henri Verbeet 2009-03-25 10:12:28 +01:00 committed by Alexandre Julliard
parent 4469fbd43d
commit 25b60e168a
1 changed files with 23 additions and 15 deletions

View File

@ -162,10 +162,23 @@ void primitiveDeclarationConvertToStridedData(
TRACE("Offset %d Stream %d UsageIndex %d\n", element->Offset, element->Stream, element->UsageIndex); TRACE("Offset %d Stream %d UsageIndex %d\n", element->Offset, element->Stream, element->UsageIndex);
if (useVertexShaderFunction) if (useVertexShaderFunction)
{
stride_used = vshader_get_input(This->stateBlock->vertexShader, stride_used = vshader_get_input(This->stateBlock->vertexShader,
element->Usage, element->UsageIndex, &idx); element->Usage, element->UsageIndex, &idx);
}
else else
{
if (!vertexDeclaration->ffp_valid[i])
{
WARN("Skipping unsupported fixed function element of type %s and usage %s\n",
debug_d3ddecltype(element->Type), debug_d3ddeclusage(element->Usage));
stride_used = FALSE;
}
else
{
stride_used = fixed_get_input(element->Usage, element->UsageIndex, &idx); stride_used = fixed_get_input(element->Usage, element->UsageIndex, &idx);
}
}
if (stride_used) { if (stride_used) {
TRACE("Load %s array %u [usage=%s, usage_idx=%u, " TRACE("Load %s array %u [usage=%s, usage_idx=%u, "
@ -174,10 +187,6 @@ void primitiveDeclarationConvertToStridedData(
debug_d3ddeclusage(element->Usage), element->UsageIndex, debug_d3ddeclusage(element->Usage), element->UsageIndex,
element->Stream, element->Offset, stride, debug_d3ddecltype(element->Type), streamVBO); element->Stream, element->Offset, stride, debug_d3ddecltype(element->Type), streamVBO);
if (!useVertexShaderFunction && !vertexDeclaration->ffp_valid[i]) {
WARN("Skipping unsupported fixed function element of type %s and usage %s\n",
debug_d3ddecltype(element->Type), debug_d3ddeclusage(element->Usage));
} else {
strided->u.input[idx].lpData = data; strided->u.input[idx].lpData = data;
strided->u.input[idx].dwType = element->Type; strided->u.input[idx].dwType = element->Type;
strided->u.input[idx].dwStride = stride; strided->u.input[idx].dwStride = stride;
@ -190,7 +199,6 @@ void primitiveDeclarationConvertToStridedData(
strided->use_map |= 1 << idx; strided->use_map |= 1 << idx;
} }
} }
}
/* Now call PreLoad on all the vertex buffers. In the very rare case /* Now call PreLoad on all the vertex buffers. In the very rare case
* that the buffers stopps converting PreLoad will dirtify the VDECL again. * that the buffers stopps converting PreLoad will dirtify the VDECL again.
* The vertex buffer can now use the strided structure in the device instead of finding its * The vertex buffer can now use the strided structure in the device instead of finding its