mesa/src/gallium/frontends
Mario Kleiner af53a9bfbc dri: Fix "cosmetic" undefined behaviour warning for RGB[A]16_UNORM formats.
Ian Romanick reported some "undefined behaviour" warnings during some
not specified tests, relating to introduction of RGB[A}16_UNORM formats
in merge request
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38588

This due to overflowing the 32-bits masks[], and then during assignment
the red/green/blue/alphaMask fields in struct gl_config when using a 16
bpc format. Iow. the red/green/blue/alphaMask would not be usable.

Suppress this warning by setting masks[] to zero for unorm16 formats,
just as was previously done for is_float16, ie. fp16 formats.

16 bpc formats are only exposed for display on non-X11 WSI target
platforms like GBM+DRM, Wayland, surfaceless, and these platforms do
not use the info in red/green/blue/alphaMask at all, so the "undefined
behaviour" is meaningless.

Fixes: f2aaa9ce00 ("dri,gallium: Add support for RGB[A]16_UNORM display formats.")
Reported-by: Ian Romanick @idr
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit ab94515b0a)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:35 +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/mesa: only use resource_from_user_memory if the cap is advertised 2026-02-11 14:54:48 +00: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