How do write_image requests in OpenCL get clampped?-Collection of common programming errors
In OpenCL you need to define a sampler objected when doing image reads (read_image*), and in that sampler you specify how addresses are clamped (e.g. you can do CLK_ADDRESS_CLAMP_TO_EDGE). But there is no sampler for image writes (write_image*). So there is no clamping specified. What is supposed to happen to pixel addresses that exit the image boundry then? Is that just not specified and left up to the vendor? Looking on the web, it seems most OpenCL code that has write_images either does not use any clamping or people use their own clamping functions. I don’t understand why the clamping is unspecified for writes, but specified for reads. Am I missing something here? I’ve googled and double read the specs, there’s nothing explaining how writes are clamped.