cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

bubu
Adept II

no __global __read_only image2d_t?

Can I only pass images as function parameters?

Can't I do this?

 

__global __read_only image2d_t myImg;

__constant sampler_t mySampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;

float4 myFunc ()

{

    int2 uv = ....;

    return read_imagef ( myImg, mySampler, uv ) + 0.1f;

}

 

???

0 Likes
4 Replies
nou
Exemplar

non constatnt variables in global scope is ilegal

0 Likes

Originally posted by: nou non constatnt variables in global scope is ilegal

 

 

And if I declare a contant in global scope... how can I set them? With clSetKernelArgs even if they aren't past in the kernel's arguments?

0 Likes

__constant float var[] = {1, 2, 3, 4, 5, 6, 7};

0 Likes

Originally posted by: nou __constant float var[] = {1, 2, 3, 4, 5, 6, 7};

 

And a uniform buffer/constant block?

0 Likes