diff options
author | Brian Paul <brianp@vmware.com> | 2014-09-24 10:42:42 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2014-09-26 07:17:00 -0600 |
commit | fea903d963e5dfba2619eb213b08b02b9064ac5c (patch) | |
tree | 5c707a04b9c94dc6f0dc45136ffe88572ad483b1 /tests/general | |
parent | e83517216470471146b0baff33880ff99b5830d2 (diff) |
draw-pixels: update BYTE_TO_FLOAT() macro to match Mesa
Use Mesa's BYTE_TO_FLOAT_TEX() arithmetic. This lets Mesa pass the
test. No regression with nvidia's driver either.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Diffstat (limited to 'tests/general')
-rw-r--r-- | tests/general/draw-pixels.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/general/draw-pixels.c b/tests/general/draw-pixels.c index 27b16755a..65f512266 100644 --- a/tests/general/draw-pixels.c +++ b/tests/general/draw-pixels.c @@ -37,7 +37,7 @@ #define UBYTE_TO_FLOAT(u) ((float) u / 255.0F) /** Convert GLbyte in [-128,127] to GLfloat in [-1.0,1.0] */ -#define BYTE_TO_FLOAT(B) ((2.0F * (B) + 1.0F) * (1.0F/255.0F)) +#define BYTE_TO_FLOAT(B) ((B) == -128 ? -1.0F : (B) * (1.0F/127.0F)) /** Convert GLushort in [0,65535] to GLfloat in [0.0,1.0] */ #define USHORT_TO_FLOAT(S) ((GLfloat) (S) * (1.0F / 65535.0F)) |