mesa/src/gallium/frontends
Ahmed Hesham e145579956 rusticl: fix flag validation when creating an image
From the OpenCL specification:
    `CL_MEM_KERNEL_READ_AND_WRITE`: This flag is only used by
    clGetSupportedImageFormats to query image formats that may be both
    read from and written to by the same kernel instance. To create a
    memory object that may be read from and written to use
    CL_MEM_READ_WRITE.

If an application follows the instructions above, i.e. query a list of
supported image formats, using `CL_MEM_KERNEL_READ_AND_WRITE` as
input, and then attempts to create an image using one of the supported
image formats, by calling `clCreateImage` and passing
`CL_MEM_READ_WRITE`, the call to the image creation entry point should
succeed. This instead fails on Mali devices with the error
`CL_IMAGE_FORMAT_NOT_SUPPORTED`.

Rusticl fails when validating the image format against its supported
flags. Formats that support `PIPE_BIND_SHADER_IMAGE` have their
supported flags set as `CL_MEM_WRITE_ONLY` and
`CL_MEM_KERNEL_READ_AND_WRITE`.

This changes the supported CL flags to be `CL_MEM_WRITE_ONLY` for
`PIPE_BIND_SHADER_IMAGE` and `CL_MEM_READ_WRTE |
CL_MEM_KERNEL_READ_AND_WRITE` for `PIPE_BIND_SAMPLER_VIEW |
PIPE_BIND_SHADER_IMAGE`.

Fixes: 3386e142 (rusticl: support read_write images)

Fixes OpenCL-CTS test: `test_image_streams` on Mali. Invocation:
```
test_image_streams write 1D CL_RGB CL_SIGNED_INT8
```

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
(cherry picked from commit e77c984cef)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40979>
2026-04-14 15:27:44 +02:00
..
d3d10umd d3d10umd: Add missing dependency on u_formats codegen. 2025-09-17 12:04:37 -07:00
dri dri: Fix "cosmetic" undefined behaviour warning for RGB[A]16_UNORM formats. 2026-04-01 11:45:35 +02:00
glx/xlib mesa: replace most occurrences of getenv() with os_get_option() 2025-11-06 04:36:13 +00:00
hgl mesa: remove inc_mapi 2025-08-06 20:35:26 +00:00
lavapipe lavapipe: fix mesh property exports 2026-03-17 18:59:21 +01:00
mediafoundation mediafoundation: set rc mode in GetCodecPrivateData for 2 pass rc mode 2026-01-20 12:02:03 +00:00
rusticl rusticl: fix flag validation when creating an image 2026-04-14 15:27:44 +02:00
teflon teflon: List all supported operations on tflite_builtin_op_name() 2026-01-10 14:05:48 +00:00
va frontends/va: Fix leaks when create_video_codec fails 2026-04-01 11:45:31 +02:00
wgl mesa: add force_explicit_uniform_loc_zero workaround 2026-04-01 11:45:30 +02:00