Skip to content

opencl: move the image2d_t bilinear resampler into bilinear.cl - #22046

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
da-phil:pl/move_image2d_bilinear_resampler_into_common_bilinear_opencl_program
Aug 30, 2026
Merged

opencl: move the image2d_t bilinear resampler into bilinear.cl#22046
TurboGit merged 1 commit into
darktable-org:masterfrom
da-phil:pl/move_image2d_bilinear_resampler_into_common_bilinear_opencl_program

Conversation

@da-phil

@da-phil da-phil commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

The guided-laplacian highlight reconstruction carried its own copy of a bilinear resampling kernel in basic.cl, duplicating the buffer variants that now live in bilinear.cl. Move it there as bilinear_image and expose it through dt_interpolate_bilinear_image_cl(), so all bilinear resamplers share one home and highlights no longer keeps a private kernel handle.

The kernel body is unchanged, image and buffer variants stay separate because OpenCL C cannot express one kernel over both image2d_t and global buffers.

No functional change. Tested locally against with a couple of images. But will follow-up with a full integration test run.

Disclaimer: this change was co-created with Claude.

The guided-laplacian highlight reconstruction carried its own copy of a
bilinear resampling kernel in basic.cl, duplicating the buffer variants
that now live in bilinear.cl. Move it there as bilinear_image and expose
it through dt_interpolate_bilinear_image_cl(), so all bilinear
resamplers share one home and highlights no longer keeps a private
kernel handle.

The kernel body is unchanged, image and buffer variants stay separate
because OpenCL C cannot express one kernel over both image2d_t and
global buffers. No functional change.
@da-phil

da-phil commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Given that bilinear resampling is also a "basic" operation, we could also move all of them to data/kernels/basic.cl and keep this 3756 lines-of-code file growing instead of adding another OpenCL program file. But because I like modularization, I think it makes sense to keep a seperate OpenCL program for those operations.

@TurboGit TurboGit added this to the 5.8 milestone Aug 30, 2026
@TurboGit TurboGit added scope: codebase making darktable source code easier to manage OpenCL Related to darktable OpenCL code ai:generated labels Aug 30, 2026
@TurboGit
TurboGit merged commit abf7dcd into darktable-org:master Aug 30, 2026
6 checks passed
@da-phil
da-phil deleted the pl/move_image2d_bilinear_resampler_into_common_bilinear_opencl_program branch August 30, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:generated OpenCL Related to darktable OpenCL code scope: codebase making darktable source code easier to manage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants