diff options
author | Jerome Glisse <jglisse@redhat.com> | 2010-09-26 12:06:46 -0400 |
---|---|---|
committer | Jerome Glisse <jglisse@redhat.com> | 2010-09-26 12:06:46 -0400 |
commit | a852615946b98de2d832d4907f09649803577db7 (patch) | |
tree | 2d5def85d8c6c573d9f839cbf28673e24783fb7a /src/gallium/winsys/r600/drm/evergreen_state.c | |
parent | 6f16e497af9bf5938541d2088e91cc79f1641a19 (diff) |
r600g: disable early cull optimization when occlusion query running
When occlusion query are running we want to have accurate
fragment count thus disable any early culling optimization
GPU has.
Based on work from Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'src/gallium/winsys/r600/drm/evergreen_state.c')
-rw-r--r-- | src/gallium/winsys/r600/drm/evergreen_state.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/winsys/r600/drm/evergreen_state.c b/src/gallium/winsys/r600/drm/evergreen_state.c index f2038638d6..860c836e85 100644 --- a/src/gallium/winsys/r600/drm/evergreen_state.c +++ b/src/gallium/winsys/r600/drm/evergreen_state.c @@ -75,6 +75,7 @@ static const struct r600_reg evergreen_reg_list[] = { {0, 0, R_009100_SPI_CONFIG_CNTL}, {0, 0, R_00913C_SPI_CONFIG_CNTL_1}, {0, 0, R_028000_DB_RENDER_CONTROL}, + {0, 0, R_028004_DB_COUNT_CONTROL}, {0, 0, R_028008_DB_DEPTH_VIEW}, {0, 0, R_02800C_DB_RENDER_OVERRIDE}, {0, 0, R_028010_DB_RENDER_OVERRIDE2}, @@ -589,6 +590,18 @@ void evergreen_context_draw(struct r600_context *ctx, const struct r600_draw *dr } } + /* queries need some special values */ + if (ctx->num_query_running) { + r600_context_reg(ctx, R600_GROUP_CONTEXT, + R_028004_DB_COUNT_CONTROL, + S_028004_PERFECT_ZPASS_COUNTS(1), + S_028004_PERFECT_ZPASS_COUNTS(1)); + r600_context_reg(ctx, R600_GROUP_CONTEXT, + R_02800C_DB_RENDER_OVERRIDE, + S_02800C_NOOP_CULL_DISABLE(1), + S_02800C_NOOP_CULL_DISABLE(1)); + } + if ((ctx->pm4_dirty_cdwords + ndwords + ctx->pm4_cdwords) > ctx->pm4_ndwords) { /* need to flush */ r600_context_flush(ctx); |