mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
r600g: implement set_active_query_state for pausing occlusion queries
Use ZPASS_INCREMENT_DISABLE everywhere. Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
5248676f87
commit
e90fe60b72
7 changed files with 24 additions and 9 deletions
|
|
@ -1802,12 +1802,15 @@ static void evergreen_emit_db_misc_state(struct r600_context *rctx, struct r600_
|
|||
S_02800C_FORCE_HIS_ENABLE0(V_02800C_FORCE_DISABLE) |
|
||||
S_02800C_FORCE_HIS_ENABLE1(V_02800C_FORCE_DISABLE);
|
||||
|
||||
if (rctx->b.num_occlusion_queries > 0) {
|
||||
if (rctx->b.num_occlusion_queries > 0 &&
|
||||
!a->occlusion_queries_disabled) {
|
||||
db_count_control |= S_028004_PERFECT_ZPASS_COUNTS(1);
|
||||
if (rctx->b.chip_class == CAYMAN) {
|
||||
db_count_control |= S_028004_SAMPLE_RATE(a->log_samples);
|
||||
}
|
||||
db_render_override |= S_02800C_NOOP_CULL_DISABLE(1);
|
||||
} else {
|
||||
db_count_control |= S_028004_ZPASS_INCREMENT_DISABLE(1);
|
||||
}
|
||||
|
||||
/* This is to fix a lockup when hyperz and alpha test are enabled at
|
||||
|
|
|
|||
|
|
@ -1735,7 +1735,7 @@
|
|||
#define S_028000_COPY_SAMPLE(x) (((x) & 0x7) << 8)
|
||||
#define S_028000_COLOR_DISABLE(x) (((x) & 0x1) << 12)
|
||||
#define R_028004_DB_COUNT_CONTROL 0x00028004
|
||||
#define S_028004_ZPASS_INCREMENT_DISABLE (((x) & 0x1) << 0)
|
||||
#define S_028004_ZPASS_INCREMENT_DISABLE(x) (((x) & 0x1) << 0)
|
||||
#define S_028004_PERFECT_ZPASS_COUNTS(x) (((x) & 0x1) << 1)
|
||||
#define S_028004_SAMPLE_RATE(x) (((x) & 0x7) << 4) /* cayman only */
|
||||
#define R_028008_DB_DEPTH_VIEW 0x00028008
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ struct r600_db_state {
|
|||
|
||||
struct r600_db_misc_state {
|
||||
struct r600_atom atom;
|
||||
bool occlusion_queries_disabled;
|
||||
bool flush_depthstencil_through_cb;
|
||||
bool flush_depth_inplace;
|
||||
bool flush_stencil_inplace;
|
||||
|
|
|
|||
|
|
@ -1644,12 +1644,16 @@ static void r600_emit_db_misc_state(struct r600_context *rctx, struct r600_atom
|
|||
}
|
||||
}
|
||||
|
||||
if (rctx->b.num_occlusion_queries > 0) {
|
||||
if (rctx->b.num_occlusion_queries > 0 &&
|
||||
!a->occlusion_queries_disabled) {
|
||||
if (rctx->b.chip_class >= R700) {
|
||||
db_render_control |= S_028D0C_R700_PERFECT_ZPASS_COUNTS(1);
|
||||
}
|
||||
db_render_override |= S_028D10_NOOP_CULL_DISABLE(1);
|
||||
} else {
|
||||
db_render_control |= S_028D0C_ZPASS_INCREMENT_DISABLE(1);
|
||||
}
|
||||
|
||||
if (rctx->db_state.rsurf && rctx->db_state.rsurf->db_htile_surface) {
|
||||
/* FORCE_OFF means HiZ/HiS are determined by DB_SHADER_CONTROL */
|
||||
db_render_override |= S_028D10_FORCE_HIZ_ENABLE(V_028D10_FORCE_OFF);
|
||||
|
|
|
|||
|
|
@ -2860,6 +2860,17 @@ static void r600_invalidate_buffer(struct pipe_context *ctx, struct pipe_resourc
|
|||
}
|
||||
}
|
||||
|
||||
static void r600_set_active_query_state(struct pipe_context *ctx, boolean enable)
|
||||
{
|
||||
struct r600_context *rctx = (struct r600_context*)ctx;
|
||||
|
||||
/* Occlusion queries. */
|
||||
if (rctx->db_misc_state.occlusion_queries_disabled != !enable) {
|
||||
rctx->db_misc_state.occlusion_queries_disabled = !enable;
|
||||
r600_mark_atom_dirty(rctx, &rctx->db_misc_state.atom);
|
||||
}
|
||||
}
|
||||
|
||||
static void r600_set_occlusion_query_state(struct pipe_context *ctx, bool enable)
|
||||
{
|
||||
struct r600_context *rctx = (struct r600_context*)ctx;
|
||||
|
|
@ -2914,6 +2925,7 @@ void r600_init_common_state_functions(struct r600_context *rctx)
|
|||
rctx->b.b.sampler_view_destroy = r600_sampler_view_destroy;
|
||||
rctx->b.b.texture_barrier = r600_texture_barrier;
|
||||
rctx->b.b.set_stream_output_targets = r600_set_streamout_targets;
|
||||
rctx->b.b.set_active_query_state = r600_set_active_query_state;
|
||||
rctx->b.b.draw_vbo = r600_draw_vbo;
|
||||
rctx->b.invalidate_buffer = r600_invalidate_buffer;
|
||||
rctx->b.set_occlusion_query_state = r600_set_occlusion_query_state;
|
||||
|
|
|
|||
|
|
@ -781,6 +781,7 @@
|
|||
#define S_028D0C_DEPTH_COMPRESS_DISABLE(x) (((x) & 0x1) << 6)
|
||||
#define S_028D0C_COPY_CENTROID(x) (((x) & 0x1) << 7)
|
||||
#define S_028D0C_COPY_SAMPLE(x) (((x) & 0x03) << 8)
|
||||
#define S_028D0C_ZPASS_INCREMENT_DISABLE(x) (((x) & 0x1) << 11)
|
||||
#define S_028D0C_R700_PERFECT_ZPASS_COUNTS(x) (((x) & 0x1) << 15)
|
||||
#define S_028D0C_CONSERVATIVE_Z_EXPORT(x) (((x) & 0x03) << 13)
|
||||
#define G_028D0C_CONSERVATIVE_Z_EXPORT(x) (((x) >> 13) & 0x03)
|
||||
|
|
|
|||
|
|
@ -1261,11 +1261,6 @@ static int r600_get_driver_query_group_info(struct pipe_screen *screen,
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
r600_set_active_query_state(struct pipe_context *pipe, boolean enable)
|
||||
{
|
||||
}
|
||||
|
||||
void r600_query_init(struct r600_common_context *rctx)
|
||||
{
|
||||
rctx->b.create_query = r600_create_query;
|
||||
|
|
@ -1274,7 +1269,6 @@ void r600_query_init(struct r600_common_context *rctx)
|
|||
rctx->b.begin_query = r600_begin_query;
|
||||
rctx->b.end_query = r600_end_query;
|
||||
rctx->b.get_query_result = r600_get_query_result;
|
||||
rctx->b.set_active_query_state = r600_set_active_query_state;
|
||||
rctx->render_cond_atom.emit = r600_emit_query_predication;
|
||||
|
||||
if (((struct r600_common_screen*)rctx->b.screen)->info.num_render_backends > 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue