diff options
author | Grigori Goronzy <[email protected]> | 2013-09-11 01:41:40 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-09-20 20:35:55 +0200 |
commit | edbbfac6cfc634e697d7f981155a5072c52d77ac (patch) | |
tree | 9c04a73fc8b27b2f02bc167b71048c3546314a51 /src/gallium/drivers/r600/evergreen_state.c | |
parent | 56d9a397aa2dbee6b12e1bbe56be39f426e1e34d (diff) |
r600g: fast color clears for single-sample buffers
Allocate a CMASK on demand and use it to fast clear single-sample
colorbuffers. Both FBOs and window system colorbuffers are fast
cleared. Expand as needed when colorbuffers are mapped or displayed
on screen.
v2: cosmetics, move transfer expansion into dma_blit
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_state.c')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 469b3a326e1..42274720df2 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -3567,6 +3567,17 @@ void *evergreen_create_decompress_blend(struct r600_context *rctx) return evergreen_create_blend_state_mode(&rctx->b.b, &blend, mode); } +void *evergreen_create_fastclear_blend(struct r600_context *rctx) +{ + struct pipe_blend_state blend; + unsigned mode = V_028808_CB_ELIMINATE_FAST_CLEAR; + + memset(&blend, 0, sizeof(blend)); + blend.independent_blend_enable = true; + blend.rt[0].colormask = 0xf; + return evergreen_create_blend_state_mode(&rctx->b.b, &blend, mode); +} + void *evergreen_create_db_flush_dsa(struct r600_context *rctx) { struct pipe_depth_stencil_alpha_state dsa = {{0}}; @@ -3755,6 +3766,12 @@ boolean evergreen_dma_blit(struct pipe_context *ctx, if (src->format != dst->format) { return FALSE; } + if (rdst->dirty_level_mask != 0) { + return FALSE; + } + if (rsrc->dirty_level_mask) { + ctx->flush_resource(ctx, src); + } src_x = util_format_get_nblocksx(src->format, src_box->x); dst_x = util_format_get_nblocksx(src->format, dst_x); |