Skip to content

Commit a9d6ad7

Browse files
jenshannoschwalmTurboGit
authored andcommitted
Fix check for OpenCL blend feather device fitting
As we use 4ch images in this algo we must properly test for the maximum allowed buffer size.
1 parent 8df821c commit a9d6ad7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/common/guided_filter.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,7 @@ int guided_filter_cl(int devid,
630630
assert(ch >= 3);
631631
assert(w >= 1);
632632

633-
// estimate required memory for OpenCL code path with a safety factor of 1.25
634-
const gboolean fits = dt_opencl_image_fits_device(devid, width, height, sizeof(float), 18.0f * 1.25f, 0);
633+
const gboolean fits = dt_opencl_image_fits_device(devid, width, height, sizeof(float) * ch, 18.0f * 0.25f + 2.5f, 0);
635634

636635
cl_int err = DT_OPENCL_DEFAULT_ERROR;
637636
if(fits)

0 commit comments

Comments
 (0)