#include "pipe/p_defines.h"
#include "cso_cache/cso_context.h"
+#include "main/macros.h"
/**
* Convert GLenum blend tokens to pipe tokens.
}
/* Colormask - maybe reverse these bits? */
- if (st->ctx->Color.ColorMask[0])
+ if (st->ctx->Color.ColorMask[0][0])
blend->colormask |= PIPE_MASK_R;
- if (st->ctx->Color.ColorMask[1])
+ if (st->ctx->Color.ColorMask[0][1])
blend->colormask |= PIPE_MASK_G;
- if (st->ctx->Color.ColorMask[2])
+ if (st->ctx->Color.ColorMask[0][2])
blend->colormask |= PIPE_MASK_B;
- if (st->ctx->Color.ColorMask[3])
+ if (st->ctx->Color.ColorMask[0][3])
blend->colormask |= PIPE_MASK_A;
if (st->ctx->Color.DitherFlag)
cso_set_blend(st->cso_context, blend);
- if (memcmp(st->ctx->Color.BlendColor, &st->state.blend_color, 4 * sizeof(GLfloat)) != 0) {
- /* state has changed */
- st->state.blend_color.color[0] = st->ctx->Color.BlendColor[0];
- st->state.blend_color.color[1] = st->ctx->Color.BlendColor[1];
- st->state.blend_color.color[2] = st->ctx->Color.BlendColor[2];
- st->state.blend_color.color[3] = st->ctx->Color.BlendColor[3];
- st->pipe->set_blend_color(st->pipe, (struct pipe_blend_color *) st->ctx->Color.BlendColor);
+ {
+ struct pipe_blend_color bc;
+ COPY_4FV(bc.color, st->ctx->Color.BlendColor);
+ cso_set_blend_color(st->cso_context, &bc);
}
}
const struct st_tracked_state st_update_blend = {
- .name = "st_update_blend",
- .dirty = {
- .mesa = (_NEW_COLOR), /* XXX _NEW_BLEND someday? */
- .st = 0,
+ "st_update_blend", /* name */
+ { /* dirty */
+ (_NEW_COLOR), /* XXX _NEW_BLEND someday? */ /* mesa */
+ 0, /* st */
},
- .update = update_blend
+ update_blend, /* update */
};
-
-
-
-
-