For more than 6 years I didn't touched my old unfinished (but partly working) project. Yesterday I tried it again (on the same old hardware - HD7970), but found it doesn't work at all. I tried to "debug" it and found out, that it can't work on the last Radeon drivers (tried both Adrenaline 21.5.2 and Pro 21.Q1.2). The deeper investigation snown a weird behaviour of read_imageui: when it takes int2 coordinates (for __read_only image2d_t), it returns pixel data, that was stored not at x but at x * 2 (strange though, when x == 1, it correctly returns from coordinate 1). The image was created with CL_MEM_READ_ONLY | CL_MEM_USE_PERSISTENT_MEM_AMD using this parameters:
imageFormat.image_channel_data_type = CL_UNSIGNED_INT8;
imageFormat.image_channel_order = CL_RGBA;
imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
All attempts to work around this problem gave nothing. However, CL_MEM_OBJECT_IMAGE1D and CL_MEM_OBJECT_IMAGE3D give out data properly, so I was forced to use the last one istead of CL_MEM_OBJECT_IMAGE2D.
Please, fix it. Windows 10 Pro 21H1.