diff options
author | Nanley Chery <nanley.g.chery@intel.com> | 2017-01-19 10:21:38 -0800 |
---|---|---|
committer | Nanley Chery <nanley.g.chery@intel.com> | 2017-02-03 09:23:13 -0800 |
commit | 93b819154f625c4bf2fe369af35f1d9f93ebf8ce (patch) | |
tree | 95c43187fa99751911a399c2bc57d2c382e3cbe4 /src | |
parent | 3f064e9a4076eac01cf7a59d0f30300ef0638aae (diff) |
anv/cmd_buffer: Don't temporarily enable CCS_E within a render pass
Compressing a render target and decompressing it in the same
single-subpass render pass may waste bandwidth. While this may be
beneficial in some circumstances, it does not help in all. Reclaims
about 1.95% FPS for Dota 2 on some configurations.
v2 (Jason Ekstrand):
- Provide a more thorough comment
- Enable CCS_D for input attachments
v3 (Jason Ekstrand):
- Provide performance numbers
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 20c9b15728..8db26e9912 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -266,12 +266,23 @@ color_attachment_compute_aux_usage(struct anv_device *device, att_state->fast_clear = false; } - if (isl_format_supports_ccs_e(&device->info, iview->isl.format)) { + /** + * TODO: Consider using a heuristic to determine if temporarily enabling + * CCS_E for this image view would be beneficial. + * + * While fast-clear resolves and partial resolves are fairly cheap in the + * case where you render to most of the pixels, full resolves are not + * because they potentially involve reading and writing the entire + * framebuffer. If we can't texture with CCS_E, we should leave it off and + * limit ourselves to fast clears. + */ + if (iview->image->aux_usage == ISL_AUX_USAGE_CCS_E) { att_state->aux_usage = ISL_AUX_USAGE_CCS_E; att_state->input_aux_usage = ISL_AUX_USAGE_CCS_E; } else if (att_state->fast_clear) { att_state->aux_usage = ISL_AUX_USAGE_CCS_D; - if (GEN_GEN >= 9) { + if (GEN_GEN >= 9 && + !isl_format_supports_ccs_e(&device->info, iview->isl.format)) { /* From the Sky Lake PRM, RENDER_SURFACE_STATE::AuxiliarySurfaceMode: * * "If Number of Multisamples is MULTISAMPLECOUNT_1, AUX_CCS_D |