summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/blend.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-10-14 09:35:53 -0600
committerBrian Paul <[email protected]>2015-10-15 07:21:07 -0600
commit1d751655012c7b8aafbeb90d02e5314a8eedc890 (patch)
tree73868a86f89636f77dad69c5ed9437bbaa732350 /src/mesa/main/blend.c
parent34de3c4c1635a42c884da3321fc35ef07be34a6e (diff)
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 <[email protected]>
Diffstat (limited to 'src/mesa/main/blend.c')
-rw-r--r--src/mesa/main/blend.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 14742d0bb6a..d225f3d171c 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -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;