aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/evergreen_hw_context.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-02-24 21:26:37 +0100
committerMarek Olšák <[email protected]>2012-03-05 14:22:20 +0100
commit734792e83fdc526623d8fe0a60479648c936bd53 (patch)
tree4af1c851e9e25d481af89fd7bae5eb284534dc13 /src/gallium/drivers/r600/evergreen_hw_context.c
parentca78a47b056b5a4589933492db364f6e418abb0f (diff)
r600g: rework rasterizer discard for evergreen
Implement it right using STRMOUT_CONFIG.RAST_STREAM. This fixes rasterizer discard with points and lines. This also adds another derived state. It's a combination of rasterizer discard and streamout enable. Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_hw_context.c')
-rw-r--r--src/gallium/drivers/r600/evergreen_hw_context.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gallium/drivers/r600/evergreen_hw_context.c b/src/gallium/drivers/r600/evergreen_hw_context.c
index 352aeb8b4a1..161709cc233 100644
--- a/src/gallium/drivers/r600/evergreen_hw_context.c
+++ b/src/gallium/drivers/r600/evergreen_hw_context.c
@@ -829,18 +829,16 @@ void evergreen_flush_vgt_streamout(struct r600_context *ctx)
void evergreen_set_streamout_enable(struct r600_context *ctx, unsigned buffer_enable_bit)
{
struct radeon_winsys_cs *cs = ctx->cs;
+ bool enable = buffer_enable_bit != 0;
- if (buffer_enable_bit) {
- cs->buf[cs->cdw++] = PKT3(PKT3_SET_CONTEXT_REG, 1, 0);
- cs->buf[cs->cdw++] = (R_028B94_VGT_STRMOUT_CONFIG - EVERGREEN_CONTEXT_REG_OFFSET) >> 2;
- cs->buf[cs->cdw++] = S_028B94_STREAMOUT_0_EN(1);
+ if (enable != ctx->atom_eg_strmout_config.stream0_enable) {
+ ctx->atom_eg_strmout_config.stream0_enable = enable;
+ r600_emit_atom(ctx, &ctx->atom_eg_strmout_config.atom);
+ }
+ if (buffer_enable_bit) {
cs->buf[cs->cdw++] = PKT3(PKT3_SET_CONTEXT_REG, 1, 0);
cs->buf[cs->cdw++] = (R_028B98_VGT_STRMOUT_BUFFER_CONFIG - EVERGREEN_CONTEXT_REG_OFFSET) >> 2;
cs->buf[cs->cdw++] = S_028B98_STREAM_0_BUFFER_EN(buffer_enable_bit);
- } else {
- cs->buf[cs->cdw++] = PKT3(PKT3_SET_CONTEXT_REG, 1, 0);
- cs->buf[cs->cdw++] = (R_028B94_VGT_STRMOUT_CONFIG - EVERGREEN_CONTEXT_REG_OFFSET) >> 2;
- cs->buf[cs->cdw++] = S_028B94_STREAMOUT_0_EN(0);
}
}