Title: core image custom kernel not working
Tags: ios;glsl;cikernel
Question: I am stuck on a very weird issue.
I have the following very simple kernel, but everytime I run it, I get the "unrecognized selector sent to instance" error.
kernel vec4 test (sampler source_image)
vec2 a = vec2(100.0, 200.0);
vec4 pixValue = sample(source_image, a);
return pixValue;
If I add samplerTransform, I still get the same error.
kernel vec4 test (sampler source_image)
vec2 a = vec2(100.0, 200.0);
vec4 pixValue = sample(source_image, samplerTransform(source_image, a));
return pixValue;
However, if I change the kernel to the following, everything works fine and I get returned the source image. This goes to show that the rest of my objective-c code is working just fine. So the issue must be in the kernel codes in the above samples somewhere.
kernel vec4 test (sampler source_image)
vec2 a = vec2(100.0, 200.0);
vec4 pixValue = sample(source_image, samplerCoord(source_image));
return pixValue;
Any idea what the issue might be?
Comment: My usage of `samplerTransform` is with an *offset* of `samplerCoord`. And to be honest, that's all I've ever seen. My best guess is that a simple `vec2` won't work. Be it because of ROI (region of interest) or something else.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2018:00:02/05/18', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<ios><glsl><cikernel>', 'Title': 'core image custom kernel not working', 'ViewCount': 79, 'id': 48615746, 'user_AboutMe': None, 'user_AccountId': 3187899.0, 'user_DisplayName': 'Arpit', 'user_Reputation': 11.0, 'user_Views': 9.0, 'user_id': 2693018.0}}