xf86-video-ati: Branch 'master'
Alex Deucher
agd5f at kemper.freedesktop.org
Thu Mar 12 15:51:20 PDT 2009
src/r600_shader.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 1fe0dcfe98dfe30499ba53c1f208c4ef10bef001
Author: Yang Zhao <yang at yangman.ca>
Date: Thu Mar 12 18:50:32 2009 -0400
R6xx/R7xx shader: Fix OFFSET_[XYZ] macro for TEX_DWORD2 to accept floats
Values for OFFSET_[XYZ] are 5-bits two's-complement fixed-point with
one-bit after decimal point. Values in [-8.0, 7.5] are valid. Inputs
that do not exactly land on 0.5 increments are rounded towards 0 to the
nearest increment.
diff --git a/src/r600_shader.h b/src/r600_shader.h
index ffb50c3..67b64ff 100644
--- a/src/r600_shader.h
+++ b/src/r600_shader.h
@@ -326,9 +326,9 @@
#define COORD_TYPE_W(x) (x)
#define TEX_UNNORMALIZED 0
#define TEX_NORMALIZED 1
-#define OFFSET_X(x) (x)
-#define OFFSET_Y(x) (x)
-#define OFFSET_Z(x) (x)
+#define OFFSET_X(x) (((int)(x) * 2) & 0x1f) /* 4:1-bits 2's-complement fixed-point: [-8.0..7.5] */
+#define OFFSET_Y(x) (((int)(x) * 2) & 0x1f)
+#define OFFSET_Z(x) (((int)(x) * 2) & 0x1f)
#define SAMPLER_ID(x) (x)
// R7xx has an additional parameter ALT_CONST. We always expose it, but ALT_CONST is R7xx only
More information about the xorg-commit
mailing list