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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user