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 <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3777>
This commit is contained in:
committed by
Marge Bot
parent
35ca2ad22e
commit
ff5de35127
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user