summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Steckelmacher <steckdenis@yahoo.fr>2011-08-12 18:43:46 +0200
committerDenis Steckelmacher <steckdenis@yahoo.fr>2011-08-12 18:43:46 +0200
commitbdc0d13727254f09a4a2dd284d0f759d71e04a3a (patch)
tree7e6bbf23ce6a232e6836a7000911ab965318d254
parentd138ae4dc14621d01e6d9a25491b7c2bbf3c8c09 (diff)
Fix a mistake when converting from float to int16.
-rw-r--r--src/runtime/stdlib.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/runtime/stdlib.c b/src/runtime/stdlib.c
index 2b12727..1433a93 100644
--- a/src/runtime/stdlib.c
+++ b/src/runtime/stdlib.c
@@ -159,10 +159,10 @@ void OVERLOAD write_imagef(image3d_t image, int4 coord, float4 color)
short4 data;
// Denormalize
- data.x = (color.x * 127.0f);
- data.y = (color.y * 127.0f);
- data.z = (color.z * 127.0f);
- data.w = (color.w * 127.0f);
+ data.x = (color.x * 32767.0f);
+ data.y = (color.y * 32767.0f);
+ data.z = (color.z * 32767.0f);
+ data.w = (color.w * 32767.0f);
SWIZZLE(order, target, data)
break;
@@ -172,10 +172,10 @@ void OVERLOAD write_imagef(image3d_t image, int4 coord, float4 color)
ushort4 *target = v_target;
ushort4 data;
- data.x = (color.x * 255.0f);
- data.y = (color.y * 255.0f);
- data.z = (color.z * 255.0f);
- data.w = (color.w * 255.0f);
+ data.x = (color.x * 65535.0f);
+ data.y = (color.y * 65535.0f);
+ data.z = (color.z * 65535.0f);
+ data.w = (color.w * 65535.0f);
SWIZZLE(order, target, data)
break;