Skip to content

Instantly share code, notes, and snippets.

@JoshuaSullivan
Created January 26, 2016 19:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
A confusing issue with the CIKernel's sample() method. Assigning the result of samplerTransform() to a variable and then using it in the sample() method breaks everything.
// This works.
kernel vec4 simpleFilter(sampler p)
{
vec2 dc = destCoord();
return sample(p, samplerTransform(p, dc));
}
// This does not. It produces [0, 0, 0, 255] for the first 255 pixels and then [0, 0, 0, 0] thereafter.
kernel vec4 simpleFilter(sampler p)
{
vec2 dc = destCoord();
vec2 tc = samplerTransform(p, dc);
return sample(p, tc);
}
@matt-curtis
Copy link

Seeing the same, many years later :))))) 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment