diff options
author | Julian Adams <[email protected]> | 2011-04-06 21:04:08 +0200 |
---|---|---|
committer | Henri Verbeet <[email protected]> | 2011-04-06 21:16:40 +0200 |
commit | 3f8455d07b129062885f58237516ae0d1aa339ea (patch) | |
tree | d648e9690e7b49745c6a4321c5b669bf6c08ad43 /src/gallium/drivers/r600/r600_state.c | |
parent | 122275760dcc9dfa6b2e377cae657aeeb121556a (diff) |
r600g: Fix non-independent blend state.
This fixes piglit fbo/fbo-drawbuffers-blend-add.
Signed-off-by: Henri Verbeet <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_state.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index e202056ef5d..7ab6965c92e 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -161,16 +161,19 @@ static void *r600_create_blend_state(struct pipe_context *ctx, color_control, 0xFFFFFFFD, NULL); for (int i = 0; i < 8; i++) { - unsigned eqRGB = state->rt[i].rgb_func; - unsigned srcRGB = state->rt[i].rgb_src_factor; - unsigned dstRGB = state->rt[i].rgb_dst_factor; + /* state->rt entries > 0 only written if independent blending */ + const int j = state->independent_blend_enable ? i : 0; - unsigned eqA = state->rt[i].alpha_func; - unsigned srcA = state->rt[i].alpha_src_factor; - unsigned dstA = state->rt[i].alpha_dst_factor; + unsigned eqRGB = state->rt[j].rgb_func; + unsigned srcRGB = state->rt[j].rgb_src_factor; + unsigned dstRGB = state->rt[j].rgb_dst_factor; + + unsigned eqA = state->rt[j].alpha_func; + unsigned srcA = state->rt[j].alpha_src_factor; + unsigned dstA = state->rt[j].alpha_dst_factor; uint32_t bc = 0; - if (!state->rt[i].blend_enable) + if (!state->rt[j].blend_enable) continue; bc |= S_028804_COLOR_COMB_FCN(r600_translate_blend_function(eqRGB)); |