From f7cc8cca79ee3ccd63ad900cdb4a1c5d38b00f74 Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Tue, 10 Dec 2024 15:13:35 +0100 Subject: [PATCH] Fix rendering via bitmap adapter (#45) --- rendercanvas/utils/bitmappresentadapter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rendercanvas/utils/bitmappresentadapter.py b/rendercanvas/utils/bitmappresentadapter.py index 3275906..12704e1 100644 --- a/rendercanvas/utils/bitmappresentadapter.py +++ b/rendercanvas/utils/bitmappresentadapter.py @@ -36,7 +36,8 @@ def present_bitmap(self, bitmap): self._texture_helper.set_texture_data(bitmap) if not self._context_is_configured: - self._context.configure(device=self._device, format="rgba8unorm") + format = self._context.get_preferred_format(self._device.adapter) + self._context.configure(device=self._device, format=format) target = self._context.get_current_texture().create_view() command_encoder = self._device.create_command_encoder()