diff options
author | Brian Paul <[email protected]> | 2015-10-14 10:08:18 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2015-10-15 07:21:08 -0600 |
commit | dfbd62e772d4373f4ab7553b556931085a70488a (patch) | |
tree | fc1c5a5b2c1f45134a9e43c87b619c2b1fb1c8f1 /src/mesa/main/blend.c | |
parent | d21e17f48f8e155918de9420378a3b233e4ca98c (diff) |
mesa: optimize _UsesDualSrc blend flag setting
For glBlendFunc and glBlendFuncSeparate(), the _UsesDualSrc flag
will be the same for all buffers, so no need to compute it N times.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/blend.c')
-rw-r--r-- | src/mesa/main/blend.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index a7b7c5b7e8a..9dec2d41408 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -255,8 +255,13 @@ _mesa_BlendFuncSeparate( GLenum sfactorRGB, GLenum dfactorRGB, ctx->Color.Blend[buf].DstRGB = dfactorRGB; ctx->Color.Blend[buf].SrcA = sfactorA; ctx->Color.Blend[buf].DstA = dfactorA; - update_uses_dual_src(ctx, buf); } + + update_uses_dual_src(ctx, 0); + for (buf = 1; buf < numBuffers; buf++) { + ctx->Color.Blend[buf]._UsesDualSrc = ctx->Color.Blend[0]._UsesDualSrc; + } + ctx->Color._BlendFuncPerBuffer = GL_FALSE; if (ctx->Driver.BlendFuncSeparate) { |