summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_state_blend.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-08-23 07:38:41 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-08-29 09:21:41 +0100
commit635c37e118bbf51fc8c93a2c999281ee817a93e1 (patch)
treecc0420dd94e281eaf3c8a4dd11360748a89747fb /src/gallium/drivers/llvmpipe/lp_state_blend.c
parentc022e15d1e56ba3a9c6b74eef6556d6063e2e322 (diff)
llvmpipe: Pass the alpha ref value and blend color in the jit context.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_blend.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_blend.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_blend.c b/src/gallium/drivers/llvmpipe/lp_state_blend.c
index ebde41c099..3f03bd0057 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_blend.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_blend.c
@@ -69,11 +69,15 @@ void llvmpipe_set_blend_color( struct pipe_context *pipe,
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
unsigned i, j;
- for (i = 0; i < 4; ++i)
- for (j = 0; j < 16; ++j)
- llvmpipe->blend_color[i][j] = float_to_ubyte(blend_color->color[i]);
+ memcpy(&llvmpipe->blend_color, blend_color, sizeof *blend_color);
- llvmpipe->dirty |= LP_NEW_BLEND;
+ if(!llvmpipe->jit_context.blend_color)
+ llvmpipe->jit_context.blend_color = align_malloc(4 * 16, 16);
+ for (i = 0; i < 4; ++i) {
+ uint8_t c = float_to_ubyte(blend_color->color[i]);
+ for (j = 0; j < 16; ++j)
+ llvmpipe->jit_context.blend_color[i*4 + j] = c;
+ }
}
@@ -97,6 +101,9 @@ llvmpipe_bind_depth_stencil_state(struct pipe_context *pipe,
llvmpipe->depth_stencil = (const struct pipe_depth_stencil_alpha_state *)depth_stencil;
+ if(llvmpipe->depth_stencil)
+ llvmpipe->jit_context.alpha_ref_value = llvmpipe->depth_stencil->alpha.ref_value;
+
llvmpipe->dirty |= LP_NEW_DEPTH_STENCIL_ALPHA;
}