diff options
author | Marek Olšák <[email protected]> | 2017-01-24 23:37:56 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-01-30 17:45:29 +0100 |
commit | f8bc628b2ceb13c8d1ddfa28b81dbef4159928b6 (patch) | |
tree | a23068949cce37fcd4add2409bc149596253aea0 /src/gallium/drivers/radeon | |
parent | 75c425e511104136e564efbae5afc41c05ac5d57 (diff) |
gallium/radeon: merge dirty_fb_counter and dirty_tex_descriptor_counter
to simplify things in draw_vbo a little
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 21 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_texture.c | 18 |
2 files changed, 13 insertions, 26 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index fb5bf75df15..6eff9aaf095 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -431,12 +431,14 @@ struct r600_common_screen { /* Performance counters. */ struct r600_perfcounters *perfcounters; - /* If pipe_screen wants to re-emit the framebuffer state of all - * contexts, it should atomically increment this. Each context will - * compare this with its own last known value of the counter before - * drawing and re-emit the framebuffer state accordingly. + /* If pipe_screen wants to recompute and re-emit the framebuffer, + * sampler, and image states of all contexts, it should atomically + * increment this. + * + * Each context will compare this with its own last known value of + * the counter before drawing and re-emit the states accordingly. */ - unsigned dirty_fb_counter; + unsigned dirty_tex_counter; /* Atomically increment this counter when an existing texture's * metadata is enabled or disabled in a way that requires changing @@ -444,12 +446,6 @@ struct r600_common_screen { */ unsigned compressed_colortex_counter; - /* Atomically increment this counter when an existing texture's - * backing buffer or tile mode parameters have changed that requires - * recomputation of shader descriptors. - */ - unsigned dirty_tex_descriptor_counter; - struct { /* Context flags to set so that all writes from earlier jobs * in the CP are seen by L2 clients. @@ -568,9 +564,8 @@ struct r600_common_context { unsigned num_gfx_cs_flushes; unsigned initial_gfx_cs_size; unsigned gpu_reset_counter; - unsigned last_dirty_fb_counter; + unsigned last_dirty_tex_counter; unsigned last_compressed_colortex_counter; - unsigned last_dirty_tex_descriptor_counter; struct u_upload_mgr *uploader; struct u_suballocator *allocator_zeroed_memory; diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c index 0b77c829490..55c8e6f7842 100644 --- a/src/gallium/drivers/radeon/r600_texture.c +++ b/src/gallium/drivers/radeon/r600_texture.c @@ -298,11 +298,6 @@ static void r600_texture_init_metadata(struct r600_texture *rtex, metadata->scanout = (surface->flags & RADEON_SURF_SCANOUT) != 0; } -static void r600_dirty_all_framebuffer_states(struct r600_common_screen *rscreen) -{ - p_atomic_inc(&rscreen->dirty_fb_counter); -} - static void r600_eliminate_fast_color_clear(struct r600_common_context *rctx, struct r600_texture *rtex) { @@ -341,7 +336,7 @@ static void r600_texture_discard_cmask(struct r600_common_screen *rscreen, r600_resource_reference(&rtex->cmask_buffer, NULL); /* Notify all contexts about the change. */ - r600_dirty_all_framebuffer_states(rscreen); + p_atomic_inc(&rscreen->dirty_tex_counter); p_atomic_inc(&rscreen->compressed_colortex_counter); } @@ -365,7 +360,7 @@ static bool r600_texture_discard_dcc(struct r600_common_screen *rscreen, rtex->dcc_offset = 0; /* Notify all contexts about the change. */ - r600_dirty_all_framebuffer_states(rscreen); + p_atomic_inc(&rscreen->dirty_tex_counter); return true; } @@ -480,8 +475,7 @@ static void r600_degrade_tile_mode_to_linear(struct r600_common_context *rctx, r600_texture_reference(&new_tex, NULL); - r600_dirty_all_framebuffer_states(rctx->screen); - p_atomic_inc(&rctx->screen->dirty_tex_descriptor_counter); + p_atomic_inc(&rctx->screen->dirty_tex_counter); } static boolean r600_texture_get_handle(struct pipe_screen* screen, @@ -1419,8 +1413,7 @@ static void r600_texture_invalidate_storage(struct r600_common_context *rctx, rtex->cmask.base_address_reg = (rtex->resource.gpu_address + rtex->cmask.offset) >> 8; - r600_dirty_all_framebuffer_states(rscreen); - p_atomic_inc(&rscreen->dirty_tex_descriptor_counter); + p_atomic_inc(&rscreen->dirty_tex_counter); rctx->num_alloc_tex_transfer_bytes += rtex->size; } @@ -2403,8 +2396,7 @@ static void si_set_optimal_micro_tile_mode(struct r600_common_screen *rscreen, rtex->surface.micro_tile_mode = rtex->last_msaa_resolve_target_micro_mode; - p_atomic_inc(&rscreen->dirty_fb_counter); - p_atomic_inc(&rscreen->dirty_tex_descriptor_counter); + p_atomic_inc(&rscreen->dirty_tex_counter); } void evergreen_do_fast_color_clear(struct r600_common_context *rctx, |