From ff5de35127d788584be56b047cb609effca5c80b Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 11 Feb 2020 07:52:17 -0600 Subject: [PATCH] anv: Mark max_push_range UNUSED and simplify the code The compiler should be smart enough to figure out that it's unused on Gen11 and earlier and delete the code which calculates. Us adding an `if (GEN_GEN >= 12)` check is unnecessary and just dirties the code. Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 22d4f79d28d..122bc9aa91c 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -3092,7 +3092,7 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer, anv_foreach_stage(stage, dirty_stages) { unsigned buffer_count = 0; flushed |= mesa_to_vk_shader_stage(stage); - uint32_t max_push_range = 0; + UNUSED uint32_t max_push_range = 0; if (anv_pipeline_has_stage(pipeline, stage)) { const struct anv_pipeline_bind_map *bind_map = @@ -3102,8 +3102,7 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer, const struct anv_push_range *range = &bind_map->push_ranges[i]; if (range->length > 0) { buffer_count++; - if (GEN_GEN >= 12 && range->length > max_push_range) - max_push_range = range->length; + max_push_range = MAX2(max_push_range, range->length); } } } -- 2.30.2