Hi
I'm a beginner at using Metal.
in my tutorial i have a kernel function for select color in Video:
ernel void image_LAB(constant MBELABHSVParameters ¶ms [[buffer(7)]],
texture2d<half, access::read> sourceTexture [[texture(7)]],
texture2d<half, access::write> destTexture [[texture(8)]],
sampler samp [[sampler(7)]],
device PositionVertex *inPosition [[buffer(9)]],
device PositionVertex *outPosition [[buffer(10)]],
uint2 gridPosition [[thread_position_in_grid]])
{
//method for select color
//return:
colorReturn = rgba;
destTexture.write(colorReturn, gridPosition);
uint2 sourceCoord = uint2(gridPosition);
half2 coordinate = normalize(sourceTexture.read(sourceCoord).xy);
}how make to convert the coordinate of the pixel in position
of the vertex to be used in a subsequent Command Encoder.
Maybe what I'm doing is not accurate, as the best way forward to achieve the position of the vertex ?