Mesa (master): nir: Fix clamping of uints for image store lowering.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Dec 17 20:02:46 UTC 2018


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Dec 14 16:53:18 2018 -0800

nir: Fix clamping of uints for image store lowering.

I botched some copy-and-paste and clamped to signed int max instead of
uint max.  Fixes KHR-GL46.shader_image_load_store.multiple-uniforms on
skl.

Fixes: d3e046e76c06 ("nir: Pull some of intel's image load/store format
conversion to nir_format.h")
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/compiler/nir/nir_format_convert.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_format_convert.h b/src/compiler/nir/nir_format_convert.h
index 9c8d0d21e0..c5d69ba5a3 100644
--- a/src/compiler/nir/nir_format_convert.h
+++ b/src/compiler/nir/nir_format_convert.h
@@ -307,7 +307,7 @@ nir_format_clamp_uint(nir_builder *b, nir_ssa_def *f, const unsigned *bits)
    nir_const_value max;
    for (unsigned i = 0; i < f->num_components; i++) {
       assert(bits[i] < 32);
-      max.i32[i] = (1 << (bits[i] - 1)) - 1;
+      max.u32[i] = (1 << bits[i]) - 1;
    }
    return nir_umin(b, f, nir_build_imm(b, f->num_components, 32, max));
 }




More information about the mesa-commit mailing list