[gegl] opacity: Check PREMULTIPLIED flag to select the right OpenCL kernel.
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] opacity: Check PREMULTIPLIED flag to select the right OpenCL kernel.
- Date: Mon, 6 May 2019 11:46:11 +0000 (UTC)
commit d82e2896aa1a7366af14eb3c70230d991c9e4f41
Author: Jan Vesely <jano vesely gmail com>
Date: Sun May 5 01:22:17 2019 -0400
opacity: Check PREMULTIPLIED flag to select the right OpenCL kernel.
Fixes clones.xml on nVidia OpenCL and Intel beignet.
Signed-off-by: Jan Vesely <jano vesely gmail com>
operations/common/opacity.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/operations/common/opacity.c b/operations/common/opacity.c
index 5af58ba9e..e314f544e 100644
--- a/operations/common/opacity.c
+++ b/operations/common/opacity.c
@@ -207,6 +207,7 @@ cl_process (GeglOperation *op,
cl_int cl_err = 0;
int kernel;
gfloat value;
+ const Babl *fmt;
if (!cl_data)
{
@@ -215,9 +216,10 @@ cl_process (GeglOperation *op,
}
if (!cl_data) return TRUE;
+ fmt = gegl_operation_get_format(op, "input");
value = GEGL_PROPERTIES (op)->value;
- kernel = (GEGL_PROPERTIES (op)->user_data == NULL)? 0 : 1;
+ kernel = ((babl_get_model_flags(fmt) & BABL_MODEL_FLAG_PREMULTIPLIED) == 0)? 1 : 0;
cl_err = gegl_clSetKernelArg(cl_data->kernel[kernel], 0, sizeof(cl_mem), (void*)&in_tex);
CL_CHECK;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]