blend_per_rt(const struct gl_context *ctx)
{
if (ctx->Color.BlendEnabled &&
- (ctx->Color.BlendEnabled != ((1 << ctx->Const.MaxDrawBuffers) - 1))) {
+ (ctx->Color.BlendEnabled != ((1U << ctx->Const.MaxDrawBuffers) - 1))) {
/* This can only happen if GL_EXT_draw_buffers2 is enabled */
return GL_TRUE;
}
blend->dither = ctx->Color.DitherFlag;
- if (ctx->Multisample.Enabled) {
- /* unlike in gallium/d3d10 these operations are only performed
- if msaa is enabled */
+ if (ctx->Multisample.Enabled &&
+ ctx->DrawBuffer->Visual.sampleBuffers > 0 &&
+ !(ctx->DrawBuffer->_IntegerBuffers & 0x1)) {
+ /* Unlike in gallium/d3d10 these operations are only performed
+ * if both msaa is enabled and we have a multisample buffer.
+ */
blend->alpha_to_coverage = ctx->Multisample.SampleAlphaToCoverage;
blend->alpha_to_one = ctx->Multisample.SampleAlphaToOne;
}
const struct st_tracked_state st_update_blend = {
- "st_update_blend", /* name */
- { /* dirty */
- (_NEW_COLOR | _NEW_MULTISAMPLE), /* XXX _NEW_BLEND someday? */ /* mesa */
- 0, /* st */
- },
update_blend, /* update */
};