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

Author: Timothy Arceri <t_arc...@yahoo.com.au>
Date:   Thu Jan 26 13:50:41 2017 +1100

i965: fix up asserts in brw_inst_set_jip()

We are casting from a signed 32bit int to an unsigned 16bit int
so shift 15 bits rather than 16.

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_inst.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_inst.h 
b/src/mesa/drivers/dri/i965/brw_inst.h
index 13fce97..bcb6786 100644
--- a/src/mesa/drivers/dri/i965/brw_inst.h
+++ b/src/mesa/drivers/dri/i965/brw_inst.h
@@ -283,8 +283,8 @@ brw_inst_set_jip(const struct gen_device_info *devinfo,
    if (devinfo->gen >= 8) {
       brw_inst_set_bits(inst, 127, 96, (uint32_t)value);
    } else {
-      assert(value <= (1 << 16) - 1);
-      assert(value > -(1 << 16));
+      assert(value <= (1 << 15) - 1);
+      assert(value >= -(1 << 15));
       brw_inst_set_bits(inst, 111, 96, (uint16_t)value);
    }
 }

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to