From 0dd89dacf232769a7e2dd03bd259211fadb5c2d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 31 Jan 2023 17:56:44 +0100 Subject: [PATCH] mesa/st: Handle all 10 bpc types in st_choose_format Only GL_UNSIGNED_INT_2_10_10_10_REV was handled, add GL_UNSIGNED_INT_10_10_10_2 & GL_UNSIGNED_INT_10_10_10_2_OES. This makes sure that if the Gallium driver doesn't support the exact corresponding format, another 10 bpc format is tried before an 8 bpc one as a fallback. Fixes the mutter test cogl-test-offscreen-texture-formats with iris. Part-of: --- src/mesa/state_tracker/st_format.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index db4c2db8f67..18036622c3a 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -1210,7 +1210,9 @@ st_choose_format(struct st_context *st, GLenum internalFormat, * formats are not color-renderable. Mesa's check for making those * non-color-renderable is based on our chosen format being 2101010. */ - if (type == GL_UNSIGNED_INT_2_10_10_10_REV) { + if (type == GL_UNSIGNED_INT_2_10_10_10_REV || + type == GL_UNSIGNED_INT_10_10_10_2 || + type == GL_UNSIGNED_INT_10_10_10_2_OES) { if (internalFormat == GL_RGB) internalFormat = GL_RGB10; else if (internalFormat == GL_RGBA)