From d64000dbb390d85965bfd3833514ad941e62c54d Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Wed, 1 Feb 2023 18:46:47 +0100 Subject: [PATCH] anv/blorp: use existing function to convert the op to a string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rohan Garg Reviewed-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_blorp.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index faf0d036589..34a6cc88c3b 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -1768,23 +1768,11 @@ anv_image_ccs_op(struct anv_cmd_buffer *cmd_buffer, if (clear_value) surf.clear_color = *clear_value; - char *flush_reason = NULL; - switch (ccs_op) { - case ISL_AUX_OP_FAST_CLEAR: - flush_reason = "ccs op start: fast clear"; - break; - case ISL_AUX_OP_FULL_RESOLVE: - flush_reason = "ccs op start: full resolve"; - break; - case ISL_AUX_OP_PARTIAL_RESOLVE: - flush_reason = "ccs op start: partial resolve"; - break; - case ISL_AUX_OP_AMBIGUATE: - flush_reason = "ccs op start: ambiguate"; - break; - default: - unreachable("Unsupported CCS operation"); - } + char flush_reason[64]; + int ret = + snprintf(flush_reason, sizeof(flush_reason), + "ccs op start: %s", isl_aux_op_to_name(ccs_op)); + assert(ret < sizeof(flush_reason)); /* From the Sky Lake PRM Vol. 7, "Render Target Fast Clear": *