summaryrefslogtreecommitdiff
path: root/opencl
diff options
context:
space:
mode:
authorDaniel Sabo <DanielSabo@gmail.com>2013-11-02 15:55:22 -0700
committerDaniel Sabo <DanielSabo@gmail.com>2013-11-02 17:39:03 -0700
commit059646e6609cc3ff32c51ec0c29f033858381747 (patch)
tree430c560ee9eb9e6f12af8e53ab50649b0f17556e /opencl
parent17cb1892c385bab207c46255a591a8a3e4811b5e (diff)
colors.cl: Fix clipping in RGBA float -> RaGaBaA float
Diffstat (limited to 'opencl')
-rw-r--r--opencl/colors.cl4
-rw-r--r--opencl/colors.cl.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/opencl/colors.cl b/opencl/colors.cl
index 4c4edffd..382cee9e 100644
--- a/opencl/colors.cl
+++ b/opencl/colors.cl
@@ -318,8 +318,8 @@ __kernel void rgbu8_to_rgbaf (__global const uchar * in,
out_v.xyz = convert_float3(in_v) / 255.0f;
out_v.w = 1.0f;
#else
- uchar4 in_v = (uchar4) (in[3 * gid], in[3 * gid + 1], in[3 * gid + 2], 255);
- float4 out_v = convert_float4 (in_v) / 255.0f;
+ float4 in_v = (float4) (in[3 * gid], in[3 * gid + 1], in[3 * gid + 2], 255.0f);
+ float4 out_v = in_v / (float4) (255.0f);
#endif
out[gid] = out_v;
}
diff --git a/opencl/colors.cl.h b/opencl/colors.cl.h
index 6bc293ae..1acbbc68 100644
--- a/opencl/colors.cl.h
+++ b/opencl/colors.cl.h
@@ -319,8 +319,8 @@ static const char* colors_cl_source =
" out_v.xyz = convert_float3(in_v) / 255.0f; \n"
" out_v.w = 1.0f; \n"
"#else \n"
-" uchar4 in_v = (uchar4) (in[3 * gid], in[3 * gid + 1], in[3 * gid + 2], 255);\n"
-" float4 out_v = convert_float4 (in_v) / 255.0f; \n"
+" float4 in_v = (float4) (in[3 * gid], in[3 * gid + 1], in[3 * gid + 2], 255.0f);\n"
+" float4 out_v = in_v / (float4) (255.0f); \n"
"#endif \n"
" out[gid] = out_v; \n"
"} \n"