Module: Mesa
Branch: master
Commit: ea81889ea436c2de7e3f3937f95f96e71d4c50ad
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ea81889ea436c2de7e3f3937f95f96e71d4c50ad

Author: Yevhenii Kolesnikov <[email protected]>
Date:   Wed Oct 28 16:56:19 2020 +0200

nir/large_constants: only search for constant duplicates

Fixes: b6d47535684 ("nir/large_constants: De-duplicate constants")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3706
Signed-off-by: Yevhenii Kolesnikov <[email protected]>
Reviewed-by: Rhys Perry <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7350>

---

 src/compiler/nir/nir_opt_large_constants.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_opt_large_constants.c 
b/src/compiler/nir/nir_opt_large_constants.c
index b1d90be8336..3ee67b60159 100644
--- a/src/compiler/nir/nir_opt_large_constants.c
+++ b/src/compiler/nir/nir_opt_large_constants.c
@@ -50,7 +50,9 @@ var_info_cmp(const void *_a, const void *_b)
    uint32_t a_size = a->constant_data_size;
    uint32_t b_size = b->constant_data_size;
 
-   if (a_size < b_size) {
+   if (a->is_constant != b->is_constant) {
+      return (int)a->is_constant - (int)b->is_constant;
+   } else if (a_size < b_size) {
       return -1;
    } else if (a_size > b_size) {
       return 1;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to