summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorAndre Maasikas <amaasikas@gmail.com>2010-09-14 18:56:39 +0300
committerAndre Maasikas <amaasikas@gmail.com>2010-09-14 19:00:35 +0300
commitb0bc026c12042405357ae65585812ca11786837f (patch)
tree1687bd4171d6003e77267b65e015c95e0acaf6f2 /src/mesa
parent79ab394cd2ca3f88ad854503b95e886a6c5d47d5 (diff)
r600c: fix setting negative values to bitfields
when setting negative integers to bitfields we could overwrite other parts of it. So mask the value to be written correctly. This is used quite often in the driver - hope it doesnt affect performace or uncover behaviour relied before... fixes strange effects when setting negative lodbias on evergreen
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/r600/r700_chip.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r600/r700_chip.h b/src/mesa/drivers/dri/r600/r700_chip.h
index ebf1840a79..0ca237b1fe 100644
--- a/src/mesa/drivers/dri/r600/r700_chip.h
+++ b/src/mesa/drivers/dri/r600/r700_chip.h
@@ -38,7 +38,7 @@
#include "r700_chipoffset.h"
-#define SETfield(x, val, shift, mask) ( (x) = ((x) & ~(mask)) | ((val) << (shift)) ) /* u32All */
+#define SETfield(x, val, shift, mask) ( (x) = ((x) & ~(mask)) | (((val) << (shift)) & (mask)) )/* u32All */
#define CLEARfield(x, mask) ( (x) &= ~(mask) )
#define SETbit(x, bit) ( (x) |= (bit) )
#define CLEARbit(x, bit) ( (x) &= ~(bit) )