[gegl] opencl: make color conversions work with OpenCL1.0
- From: Massimo Valentini <mvalentini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] opencl: make color conversions work with OpenCL1.0
- Date: Wed, 21 Nov 2012 18:04:01 +0000 (UTC)
commit 45a2775ebd0c68e6de2ab4779643d0daac6136cb
Author: Massimo Valentini <mvalentini src gnome org>
Date: Wed Nov 21 11:06:42 2012 +0100
opencl: make color conversions work with OpenCL1.0
using the runtime preprocessor
gegl/opencl/gegl-cl-color-kernel.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gegl/opencl/gegl-cl-color-kernel.h b/gegl/opencl/gegl-cl-color-kernel.h
index 72e9f34..bae5024 100644
--- a/gegl/opencl/gegl-cl-color-kernel.h
+++ b/gegl/opencl/gegl-cl-color-kernel.h
@@ -269,9 +269,15 @@ static const char* kernel_color_source =
" float4 in_v = in[gid]; \n"
" float4 out_v; \n"
" \n"
+"#if (__OPENCL_VERSION__ != CL_VERSION_1_0) \n"
" float3 rgb = (float3)(linear_to_gamma_2_2(in_v.x), \n"
" linear_to_gamma_2_2(in_v.y), \n"
" linear_to_gamma_2_2(in_v.z)); \n"
+"#else \n"
+" float4 rgb = (float4)(linear_to_gamma_2_2(in_v.x), \n"
+" linear_to_gamma_2_2(in_v.y), \n"
+" linear_to_gamma_2_2(in_v.z), 1.0f); \n"
+"#endif \n"
" \n"
" out_v = (float4)( 0.299f * rgb.x + 0.587f * rgb.y + 0.114f * rgb.z, \n"
" -0.168736f * rgb.x - 0.331264f * rgb.y + 0.5f * rgb.z, \n"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]