mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
Add alpha channel support to GPUBuffer
This commit is contained in:
parent
4b21daa095
commit
544025290b
1 changed files with 5 additions and 5 deletions
|
@ -137,8 +137,9 @@ public class GPUBufferMeta : IComponent
|
||||||
|
|
||||||
var value = buffer.Buffer[key];
|
var value = buffer.Buffer[key];
|
||||||
|
|
||||||
// ABGR to RGB
|
// ABGR to ARGB
|
||||||
value =
|
value =
|
||||||
|
(value & 0xFF_00_00_00U) |
|
||||||
((value & 0x00_00_00_FFU) << 16) | // move R
|
((value & 0x00_00_00_FFU) << 16) | // move R
|
||||||
(value & 0x00_00_FF_00U) | // move G
|
(value & 0x00_00_FF_00U) | // move G
|
||||||
((value & 0x00_FF_00_00U) >> 16); // move B
|
((value & 0x00_FF_00_00U) >> 16); // move B
|
||||||
|
@ -173,13 +174,12 @@ public class GPUBufferMeta : IComponent
|
||||||
var value = (uint)L.ToInteger(3);
|
var value = (uint)L.ToInteger(3);
|
||||||
value = GetColor(value);
|
value = GetColor(value);
|
||||||
|
|
||||||
// RGB to ABGR
|
// ARGB to ABGR
|
||||||
value =
|
value =
|
||||||
|
(value & 0xFF_00_00_00U) |
|
||||||
((value & 0x00_FF_00_00U) >> 16) | // move R
|
((value & 0x00_FF_00_00U) >> 16) | // move R
|
||||||
(value & 0x00_00_FF_00U) | // move G
|
(value & 0x00_00_FF_00U) | // move G
|
||||||
((value & 0x00_00_00_FFU) << 16) | // move B
|
((value & 0x00_00_00_FFU) << 16); // move B
|
||||||
0xFF_00_00_00U;
|
|
||||||
|
|
||||||
|
|
||||||
buffer.Buffer[key] = value;
|
buffer.Buffer[key] = value;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue