Module: Mesa Branch: master Commit: 1d751655012c7b8aafbeb90d02e5314a8eedc890 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1d751655012c7b8aafbeb90d02e5314a8eedc890
Author: Brian Paul <[email protected]> Date: Wed Oct 14 09:35:53 2015 -0600 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]> --- src/mesa/main/blend.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 14742d0..d225f3d 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; _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
