diff options
author | Marek Olšák <marek.olsak@amd.com> | 2014-05-06 13:44:27 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2014-06-02 12:58:22 +0200 |
commit | fe98bfb2615ff6e57cd66f4fc34dc0d45f6dd7e2 (patch) | |
tree | e58c0e3dfe91cfad5d8a6686126f59f2e5b1db2a /src/gallium/drivers/radeon | |
parent | 3aed75c8592e76de05f310118134cfc7cddf4360 (diff) | |
download | external_mesa3d-fe98bfb2615ff6e57cd66f4fc34dc0d45f6dd7e2.zip external_mesa3d-fe98bfb2615ff6e57cd66f4fc34dc0d45f6dd7e2.tar.gz external_mesa3d-fe98bfb2615ff6e57cd66f4fc34dc0d45f6dd7e2.tar.bz2 |
radeon: add basic register setup for per-sample shading
Only for Cayman, SI, CIK.
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/cayman_msaa.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600d_common.h | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/cayman_msaa.c b/src/gallium/drivers/radeon/cayman_msaa.c index fa7deb6..8727f3e 100644 --- a/src/gallium/drivers/radeon/cayman_msaa.c +++ b/src/gallium/drivers/radeon/cayman_msaa.c @@ -191,6 +191,8 @@ void cayman_emit_msaa_config(struct radeon_winsys_cs *cs, int nr_samples, }; unsigned log_samples = util_logbase2(nr_samples); + unsigned log_ps_iter_samples = + util_logbase2(util_next_power_of_two(ps_iter_samples)); r600_write_context_reg_seq(cs, CM_R_028BDC_PA_SC_LINE_CNTL, 2); radeon_emit(cs, S_028BDC_LAST_PIXEL(1) | @@ -201,11 +203,13 @@ void cayman_emit_msaa_config(struct radeon_winsys_cs *cs, int nr_samples, r600_write_context_reg(cs, CM_R_028804_DB_EQAA, S_028804_MAX_ANCHOR_SAMPLES(log_samples) | - S_028804_PS_ITER_SAMPLES(log_samples) | + S_028804_PS_ITER_SAMPLES(log_ps_iter_samples) | S_028804_MASK_EXPORT_NUM_SAMPLES(log_samples) | S_028804_ALPHA_TO_MASK_NUM_SAMPLES(log_samples) | S_028804_HIGH_QUALITY_INTERSECTIONS(1) | S_028804_STATIC_ANCHOR_ASSOCIATIONS(1)); + r600_write_context_reg(cs, EG_R_028A4C_PA_SC_MODE_CNTL_1, + EG_S_028A4C_PS_ITER_SAMPLE(ps_iter_samples > 1)); } else { r600_write_context_reg_seq(cs, CM_R_028BDC_PA_SC_LINE_CNTL, 2); radeon_emit(cs, S_028BDC_LAST_PIXEL(1)); /* CM_R_028BDC_PA_SC_LINE_CNTL */ @@ -214,5 +218,6 @@ void cayman_emit_msaa_config(struct radeon_winsys_cs *cs, int nr_samples, r600_write_context_reg(cs, CM_R_028804_DB_EQAA, S_028804_HIGH_QUALITY_INTERSECTIONS(1) | S_028804_STATIC_ANCHOR_ASSOCIATIONS(1)); + r600_write_context_reg(cs, EG_R_028A4C_PA_SC_MODE_CNTL_1, 0); } } diff --git a/src/gallium/drivers/radeon/r600d_common.h b/src/gallium/drivers/radeon/r600d_common.h index 1172af0..fa6131f 100644 --- a/src/gallium/drivers/radeon/r600d_common.h +++ b/src/gallium/drivers/radeon/r600d_common.h @@ -160,6 +160,9 @@ #define G_028B98_STREAM_3_BUFFER_EN(x) (((x) >> 12) & 0x0F) #define C_028B98_STREAM_3_BUFFER_EN 0xFFFF0FFF +#define EG_R_028A4C_PA_SC_MODE_CNTL_1 0x028A4C +#define EG_S_028A4C_PS_ITER_SAMPLE(x) (((x) & 0x1) << 16) + #define CM_R_028804_DB_EQAA 0x00028804 #define S_028804_MAX_ANCHOR_SAMPLES(x) (((x) & 0x7) << 0) #define S_028804_PS_ITER_SAMPLES(x) (((x) & 0x7) << 4) |