diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2013-02-20 13:06:18 +0100 |
---|---|---|
committer | Andreas Boll <andreas.boll.dev@gmail.com> | 2013-04-17 12:33:29 +0200 |
commit | 3afe7bb70f8f5989c526c7be975c71cbb2e8859b (patch) | |
tree | 545746caeb530761131c9ae25670aa775142b891 | |
parent | 1d4044ba294bc5f47486b59ec7ff7a925df8a1cf (diff) |
r600g/Cayman: Fix blending using destination alpha factor but non-alpha dest
Only compile tested, but should fix at least some piglit fbo-blending tests.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 73bf626713f7efc43164f7649fc143f4a94299cb)
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index a17ba175a3..fc83dbec56 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1320,10 +1320,15 @@ void evergreen_init_color_surface(struct r600_context *rctx, S_028C74_NON_DISP_TILING_ORDER(tile_type) | S_028C74_FMASK_BANK_HEIGHT(fmask_bankh); - if (rctx->chip_class == CAYMAN && rtex->resource.b.b.nr_samples > 1) { - unsigned log_samples = util_logbase2(rtex->resource.b.b.nr_samples); - color_attrib |= S_028C74_NUM_SAMPLES(log_samples) | - S_028C74_NUM_FRAGMENTS(log_samples); + if (rctx->chip_class == CAYMAN) { + color_attrib |= S_028C74_FORCE_DST_ALPHA_1(desc->swizzle[3] == + UTIL_FORMAT_SWIZZLE_1); + + if (rtex->resource.b.b.nr_samples > 1) { + unsigned log_samples = util_logbase2(rtex->resource.b.b.nr_samples); + color_attrib |= S_028C74_NUM_SAMPLES(log_samples) | + S_028C74_NUM_FRAGMENTS(log_samples); + } } ntype = V_028C70_NUMBER_UNORM; |