diff options
author | Neil Roberts <[email protected]> | 2015-11-25 12:14:37 +0100 |
---|---|---|
committer | Neil Roberts <[email protected]> | 2015-12-11 18:05:56 +0000 |
commit | 583a5778f46aa6a18d7ec52178ebf1fb82c6daa8 (patch) | |
tree | 9fae7d619c403f3c3a8e385cb25c90daaa816687 /src | |
parent | 0033c8134401cd4c42845a8e33c001ec62612015 (diff) |
i965/gen9: Don't do fast clears when GL_FRAMEBUFFER_SRGB is enabled
When GL_FRAMEBUFFER_SRGB is enabled any single-sampled renderbuffers
are resolved in intel_update_state because the hardware can't cope
with fast clears on SRGB buffers. In that case it's pointless to do a
fast clear because it will just be immediately resolved.
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_meta_fast_clear.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c index a8b16b6d79e..735d82495d8 100644 --- a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c +++ b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c @@ -603,6 +603,17 @@ brw_meta_fast_clear(struct brw_context *brw, struct gl_framebuffer *fb, brw->render_target_format[irb->mt->format]) clear_type = REP_CLEAR; + /* Gen9 doesn't support fast clear on single-sampled SRGB buffers. When + * GL_FRAMEBUFFER_SRGB is enabled any color renderbuffers will be + * resolved in intel_update_state. In that case it's pointless to do a + * fast clear because it's very likely to be immediately resolved. + */ + if (brw->gen >= 9 && + irb->mt->num_samples <= 1 && + brw->ctx.Color.sRGBEnabled && + _mesa_get_srgb_format_linear(irb->mt->format) != irb->mt->format) + clear_type = REP_CLEAR; + if (irb->mt->fast_clear_state == INTEL_FAST_CLEAR_STATE_NO_MCS) clear_type = REP_CLEAR; |