From 544025290b7ea9d320b290eeec7a1608ebd76788 Mon Sep 17 00:00:00 2001 From: Alessandro Proto Date: Sat, 8 Apr 2023 19:31:21 +0200 Subject: [PATCH] Add alpha channel support to GPUBuffer --- Capy64/Runtime/Objects/GPUBufferMeta.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Capy64/Runtime/Objects/GPUBufferMeta.cs b/Capy64/Runtime/Objects/GPUBufferMeta.cs index c83d670..a8aa7f0 100644 --- a/Capy64/Runtime/Objects/GPUBufferMeta.cs +++ b/Capy64/Runtime/Objects/GPUBufferMeta.cs @@ -137,8 +137,9 @@ public class GPUBufferMeta : IComponent var value = buffer.Buffer[key]; - // ABGR to RGB + // ABGR to ARGB value = + (value & 0xFF_00_00_00U) | ((value & 0x00_00_00_FFU) << 16) | // move R (value & 0x00_00_FF_00U) | // move G ((value & 0x00_FF_00_00U) >> 16); // move B @@ -173,13 +174,12 @@ public class GPUBufferMeta : IComponent var value = (uint)L.ToInteger(3); value = GetColor(value); - // RGB to ABGR + // ARGB to ABGR value = + (value & 0xFF_00_00_00U) | ((value & 0x00_FF_00_00U) >> 16) | // move R (value & 0x00_00_FF_00U) | // move G - ((value & 0x00_00_00_FFU) << 16) | // move B - 0xFF_00_00_00U; - + ((value & 0x00_00_00_FFU) << 16); // move B buffer.Buffer[key] = value;