From 494e2edb90d06f645e09b10d2c3f6b8d274d4dba Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Sun, 13 Nov 2022 16:19:48 -0800 Subject: [PATCH] intel/compiler: Fix missing tie-breaker in brw_nir_analyze_ubo_ranges() ordering code Per Ken suggestion, use ascending order for the start offset. Fixes: 6d28c6e52cf ("i965: Select ranges of UBO data to be uploaded as push constants.") Reviewed-by: Kenneth Graunke Part-of: --- src/intel/compiler/brw_nir_analyze_ubo_ranges.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/intel/compiler/brw_nir_analyze_ubo_ranges.c b/src/intel/compiler/brw_nir_analyze_ubo_ranges.c index 3ab618ee123..aec74c7a3de 100644 --- a/src/intel/compiler/brw_nir_analyze_ubo_ranges.c +++ b/src/intel/compiler/brw_nir_analyze_ubo_ranges.c @@ -67,16 +67,16 @@ cmp_ubo_range_entry(const void *va, const void *vb) const struct ubo_range_entry *a = va; const struct ubo_range_entry *b = vb; - /* Rank based on scores */ + /* Rank based on scores, descending order */ int delta = score(b) - score(a); - /* Then use the UBO block index as a tie-breaker */ + /* Then use the UBO block index as a tie-breaker, descending order */ if (delta == 0) delta = b->range.block - a->range.block; - /* Finally use the UBO offset as a second tie-breaker */ + /* Finally use the start offset as a second tie-breaker, ascending order */ if (delta == 0) - delta = b->range.block - a->range.block; + delta = a->range.start - b->range.start; return delta; }