diff options
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_blend.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_blend.c | 15 |
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; } |