From: Matthias Clasen Date: Thu, 26 Oct 2023 01:39:52 +0000 (-0400) Subject: Fix swizzle values for some memory formats X-Git-Tag: archive/raspbian/4.12.4+ds-3+rpi1^2~21^2^2~20 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0bf68f1372cfd5b5076f752713e8cda886a7cbec;p=gtk4.git Fix swizzle values for some memory formats For opaque formats with 3 channels, we should use the default GL_ALPHA, but for opaque formats with an ignored 4th channel, we must use GL_ONE. --- diff --git a/gdk/gdkmemoryformat.c b/gdk/gdkmemoryformat.c index 3b21734c14..61ef3a5a42 100644 --- a/gdk/gdkmemoryformat.c +++ b/gdk/gdkmemoryformat.c @@ -423,7 +423,7 @@ static const GdkMemoryFormatDescription memory_formats[] = { G_ALIGNOF (guchar), GDK_MEMORY_U8, { 0, 0, 0, 0 }, - { GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, { GL_RED, GL_GREEN, GL_BLUE, GL_ONE } }, + { GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } }, r8g8b8_to_float, r8g8b8_from_float, }, @@ -433,7 +433,7 @@ static const GdkMemoryFormatDescription memory_formats[] = { G_ALIGNOF (guchar), GDK_MEMORY_U8, { 0, 0, G_MAXUINT, G_MAXUINT }, - { GL_RGB8, GL_BGR, GL_UNSIGNED_BYTE, { GL_RED, GL_GREEN, GL_BLUE, GL_ONE } }, + { GL_RGB8, GL_BGR, GL_UNSIGNED_BYTE, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } }, b8g8r8_to_float, b8g8r8_from_float, }, @@ -443,7 +443,7 @@ static const GdkMemoryFormatDescription memory_formats[] = { G_ALIGNOF (guint16), GDK_MEMORY_U16, { 0, 0, 3, 0 }, - { GL_RGB16, GL_RGB, GL_UNSIGNED_SHORT, { GL_RED, GL_GREEN, GL_BLUE, GL_ONE } }, + { GL_RGB16, GL_RGB, GL_UNSIGNED_SHORT, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } }, r16g16b16_to_float, r16g16b16_from_float, }, @@ -473,7 +473,7 @@ static const GdkMemoryFormatDescription memory_formats[] = { G_ALIGNOF (guint16), GDK_MEMORY_FLOAT16, { 0, 0, 3, 0 }, - { GL_RGB16F, GL_RGB, GL_HALF_FLOAT, { GL_RED, GL_GREEN, GL_BLUE, GL_ONE } }, + { GL_RGB16F, GL_RGB, GL_HALF_FLOAT, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } }, r16g16b16_float_to_float, r16g16b16_float_from_float, }, @@ -503,7 +503,7 @@ static const GdkMemoryFormatDescription memory_formats[] = { G_ALIGNOF (float), GDK_MEMORY_FLOAT32, { 0, 0, 3, 0 }, - { GL_RGB32F, GL_RGB, GL_FLOAT, { GL_RED, GL_GREEN, GL_BLUE, GL_ONE } }, + { GL_RGB32F, GL_RGB, GL_FLOAT, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } }, r32g32b32_float_to_float, r32g32b32_float_from_float, },