How do I get multiple image inputs to an OpenCL kernel program?
I want to convert pixels of one image into a vertex array, and sample color information from another image to create an array of colour float4s. Both images will have the same dimensions.

I currently have the following code:

Code :
__kernel void read_rgba8888(__rd image2d_t GeometryImg, float displacement, float Aspect, __global float4 *mesh, __global float4 *colors)
{
	int	tid_x = get_global_id(0),
		tid_y = get_global_id(1),
		indx = tid_y * get_global_size(0) + tid_x;
 
	float4 color, vertex;
	int2   pos = (int2)(tid_x, tid_y);
	sampler_t smp = CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;
 
	color = read_imagef(GeometryImg, smp, (int2)(tid_x, tid_y));
	colors[indx] = color;
 
	// Vertex Position
	float4 vPos;
	vPos.x = (float)pos.x / get_global_size(0);
	vPos.x = (fmod((float)pos.y, (float)2.0) < 1.0) ? 1.0 - vPos.x : vPos.x;
	vPos.x -= 0.5;
	vPos.x *= Aspect;
 
	vPos.y = 1.0 - (float)pos.y / get_global_size(1) - 0.5;
	// Displacement is determined by the displacement amount * the "length" of the color vector (ie brightness)
	vPos.z = displacement * length(color.xyzw) - 0.5;
	vPos.w = 1.0;
 
	vertex = vPos;
	mesh[indx] = vertex;
}

Any tips on optimising the above much appreciated, too.

Cheers guys,

a|x
http://machinesdontcare.wordpress.com