int local_x = get_local_id(0);
int local_y = get_local_id(1);
shared_input[pos] = 255.f * read_imagef(input, sampler, (int2) (x, y));
if (local_x == 0)
{
shared_input[pos - 1] = 255.f * read_imagef(input, sampler, (int2) (x - 1, y));
if (local_y == 0)
shared_input[pos - 10 - 1] = 255.f * read_imagef(input, sampler, (int2) (x - 1, y - 1));
}
if (local_y == 0)
{
shared_input[pos - 10] = 255.f * read_imagef(input, sampler, (int2) (x, y));
if (local_x == 7)
shared_input[pos - 10 + 1] = 255.f * read_imagef(input, sampler, (int2) (x + 1, y - 1));
}
if (local_x == 7)
{
shared_input[pos + 1] = 255.f * read_imagef(input, sampler, (int2) (x + 1, y));
if (local_y == 7)
shared_input[pos + 10 + 1] = 255.f * read_imagef(input, sampler, (int2) (x + 1, y + 1));
}
if (local_y == 7)
{
shared_input[pos + 10] = 255.f * read_imagef(input, sampler, (int2) (x, y + 1));
if (local_x == 0)
shared_input[pos + 10 - 1] = 255.f * read_imagef(input, sampler, (int2) (x - 1, y + 1));
}