mesa: move validate_blend_factors() call after no-change check

A redundant call to glBlendFuncSeparateiARB() is more likely than getting
invalid values, so do the no-op check first.

Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Brian Paul
2015-10-14 09:35:53 -06:00
parent 34de3c4c16
commit 1d75165501
+6 -6
View File
@@ -296,18 +296,18 @@ _mesa_BlendFuncSeparateiARB(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
return;
}
if (!validate_blend_factors(ctx, "glBlendFuncSeparatei",
sfactorRGB, dfactorRGB,
sfactorA, dfactorA)) {
return;
}
if (ctx->Color.Blend[buf].SrcRGB == sfactorRGB &&
ctx->Color.Blend[buf].DstRGB == dfactorRGB &&
ctx->Color.Blend[buf].SrcA == sfactorA &&
ctx->Color.Blend[buf].DstA == dfactorA)
return; /* no change */
if (!validate_blend_factors(ctx, "glBlendFuncSeparatei",
sfactorRGB, dfactorRGB,
sfactorA, dfactorA)) {
return;
}
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.Blend[buf].SrcRGB = sfactorRGB;