]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/pipelinestate.cpp
Add color write mask to blend state
[libs/gl.git] / source / core / pipelinestate.cpp
index 97f353dcee8b572c835e1ac5569ca9769489b246..262dd26b596b95fb600aea40d5995d0fe08fd56e 100644 (file)
@@ -322,9 +322,14 @@ void PipelineState::apply(unsigned mask) const
                        glBlendEquation(get_gl_blend_equation(blend->equation));
                        glBlendFunc(get_gl_blend_factor(blend->src_factor), get_gl_blend_factor(blend->dst_factor));
                        glBlendColor(blend->constant.r, blend->constant.g, blend->constant.b, blend->constant.a);
+                       ColorWriteMask cw = blend->write_mask;
+                       glColorMask((cw&WRITE_RED)!=0, (cw&WRITE_GREEN)!=0, (cw&WRITE_BLUE)!=0, (cw&WRITE_ALPHA)!=0);
                }
                else
+               {
                        glDisable(GL_BLEND);
+                       glColorMask(true, true, true, true);
+               }
        }
 
        last_applied = this;