diff options
author | Samuel Pitoiset <[email protected]> | 2018-12-10 13:00:33 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-12-13 09:21:14 +0100 |
commit | 74cf3b627c20f2df545a66ba81fa92fee8d57c72 (patch) | |
tree | 66af42204322c9fc47447eb7cf9fe2cbebbdb35d /src/amd | |
parent | 3a5adc2879fc21d86b21532f0dabbe1bccdb4734 (diff) |
radv: allow to skip DCC decompressions with the new predicate
Feral games aren't affected because they don't decompress DCC.
F1 2018 has one DCC decompression per frame, but I don't see
any performance improvements. This new predicate will be
probably more useful for DCC/MSAA.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_meta_fast_clear.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/amd/vulkan/radv_meta_fast_clear.c b/src/amd/vulkan/radv_meta_fast_clear.c index 481c432513f..8f97c1a8f15 100644 --- a/src/amd/vulkan/radv_meta_fast_clear.c +++ b/src/amd/vulkan/radv_meta_fast_clear.c @@ -551,13 +551,14 @@ radv_device_init_meta_fast_clear_flush_state(struct radv_device *device, bool on static void radv_emit_set_predication_state_from_image(struct radv_cmd_buffer *cmd_buffer, - struct radv_image *image, bool value) + struct radv_image *image, + uint64_t pred_offset, bool value) { uint64_t va = 0; if (value) { va = radv_buffer_get_va(image->bo) + image->offset; - va += image->fce_pred_offset; + va += pred_offset; } si_emit_set_predication_state(cmd_buffer, true, va); @@ -600,10 +601,13 @@ radv_emit_color_decompress(struct radv_cmd_buffer *cmd_buffer, pipeline = cmd_buffer->device->meta_state.fast_clear_flush.cmask_eliminate_pipeline; } - if (!decompress_dcc && radv_image_has_dcc(image)) { + if (radv_image_has_dcc(image)) { + uint64_t pred_offset = decompress_dcc ? image->dcc_pred_offset : + image->fce_pred_offset; + old_predicating = cmd_buffer->state.predicating; - radv_emit_set_predication_state_from_image(cmd_buffer, image, true); + radv_emit_set_predication_state_from_image(cmd_buffer, image, pred_offset, true); cmd_buffer->state.predicating = true; } @@ -688,10 +692,13 @@ radv_emit_color_decompress(struct radv_cmd_buffer *cmd_buffer, &cmd_buffer->pool->alloc); } - if (!decompress_dcc && radv_image_has_dcc(image)) { + if (radv_image_has_dcc(image)) { + uint64_t pred_offset = decompress_dcc ? image->dcc_pred_offset : + image->fce_pred_offset; + cmd_buffer->state.predicating = old_predicating; - radv_emit_set_predication_state_from_image(cmd_buffer, image, false); + radv_emit_set_predication_state_from_image(cmd_buffer, image, pred_offset, false); if (cmd_buffer->state.predication_type != -1) { /* Restore previous conditional rendering user state. */ |