aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_blend.c
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2007-09-14 04:08:58 -0400
committerZack Rusin <[email protected]>2007-09-18 06:31:22 -0400
commit9780327c5d95586a88fce94d7b47342355ead118 (patch)
tree9007ea135504d8fd90b49a391a43fa579b9374b5 /src/mesa/state_tracker/st_atom_blend.c
parentffacb1c12a77d71613e8171e31ffc348959881e4 (diff)
First stab at immutable state objects (create/bind/delete)
We want our state objects to be immutable, handled via the create/bind/delete calls instead of struct propagation. Only implementing the blend state to see how it would look like and work.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_blend.c')
-rw-r--r--src/mesa/state_tracker/st_atom_blend.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c
index afd21a6141c..d007d50ad39 100644
--- a/src/mesa/state_tracker/st_atom_blend.c
+++ b/src/mesa/state_tracker/st_atom_blend.c
@@ -36,6 +36,7 @@
#include "st_atom.h"
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
+#include "cso_cache/cso_cache.h"
/**
@@ -209,10 +210,14 @@ update_blend( struct st_context *st )
if (st->ctx->Color.DitherFlag)
blend.dither = 1;
- if (memcmp(&blend, &st->state.blend, sizeof(blend)) != 0) {
+ struct pipe_blend_state *real_blend =
+ cso_cached_blend_state(st, &blend);
+
+ if (st->state.blend != real_blend) {
/* state has changed */
- st->state.blend = blend; /* struct copy */
- st->pipe->set_blend_state(st->pipe, &blend); /* set new state */
+ st->state.blend = real_blend;
+ /* bind new state */
+ st->pipe->bind_blend_state(st->pipe, real_blend);
}
if (memcmp(st->ctx->Color.BlendColor, &st->state.blend_color, 4 * sizeof(GLfloat)) != 0) {