v2: just tell the compiler to assume the format will always be found, as it comes from the table itself to begin with.
CID: 1429516 Fixes: d32b23f3830099a328b91 "egl/wayland: Add bpp to visual map" Cc: Daniel Stone <dani...@collabora.com> Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com> --- src/egl/drivers/dri2/platform_wayland.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 20e47a5f6c15129d4fd8..cbe4a8edbc4b0486fffa 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -1294,6 +1294,8 @@ dri2_wl_swrast_get_stride_for_format(int format, int w) { int visual_idx = dri2_wl_visual_idx_from_shm_format(format); + assume(visual_idx != -1); + return w * (dri2_wl_visuals[visual_idx].bpp / 8); } -- Cheers, Eric _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev