[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gtk4: Mipmap tests fail 16/32-bit pixel format conversions due to memory alignment issues



Hi,

upstream has fixed this issue now [1]. I'm attaching their patch.

Could you include this patch in the next upload?

Adrian

> [1] https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/9085

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
From 5139eebd189602c9938b837386db7f54ef84861d Mon Sep 17 00:00:00 2001
From: Gregor Riepl <onitake@gmail.com>
Date: Mon, 27 Oct 2025 08:50:19 +0100
Subject: [PATCH] testsuite: Fix alignment handling in testutils

We need to respect gdk_memory_alignment() when creating fudged buffers,
because we use internal APIs to access those buffers and those internal
APIs require the alignment.

For public API usage this already happens because we copy the memory if
necessary.

This broke the mipmap test on sparc64.

Fixes #7801

Part-of: <https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/9085>
---
 testsuite/gdk/gdktestutils.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/testsuite/gdk/gdktestutils.c b/testsuite/gdk/gdktestutils.c
index 91ec99af5ef..02e901bf37f 100644
--- a/testsuite/gdk/gdktestutils.c
+++ b/testsuite/gdk/gdktestutils.c
@@ -658,8 +658,11 @@ texture_builder_init (TextureBuilder  *builder,
                       int              width,
                       int              height)
 {
-  gdk_memory_layout_init (&builder->layout, format, width, height, 1);
-  gdk_memory_layout_fudge (&builder->layout, 1);
+  gsize align;
+
+  align = gdk_memory_format_alignment (format);
+  gdk_memory_layout_init (&builder->layout, format, width, height, align);
+  gdk_memory_layout_fudge (&builder->layout, align);
   builder->pixels = g_malloc0 (builder->layout.size);
 }
 
-- 
GitLab


Reply to: