PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

ARGB xs XRGB

Hi,

Can anyone tell me what is the difference between the ARGB and XRGB color format? I know ARGB is RGB + alpha, but the X I know not what it is.

I tried to look into the DirectX docs, but I couldn't find an explanation for this.

Thanks!

--Eric
A fake alpha format then ;) I suppose some drivers require/expects that format for certain surfaces or something similar...

Thanks a lot!

--Eric
XRGB means that RGB is stored in 32 bits with 8 unused bits.

the advantage over 24 bits is that 32 bits can be faster addressed and loaded. the disadvantage is that 33% of memory space are wasted.

DANIEL
Thanks, I updated my code to simply drop the unused byte.

--Eric
Only 25% is wasted. It requires 33% more.
Digby wrote:Only 25% is wasted. It requires 33% more.


But then again you can use that extra byte for something else =)
yes, you're right. of course it's only 25% wasted, but 33% more.

i have to admit, that i did not have a situation yet, where storing pixels using 8 bits per component makes sense on the PPC - especially considering that RGBX8888 takes twice the memory and bandwidth of RGB565...

i could be useful if lots of blending is used, but then it still takes a lot of performance.

DANIEL
drgoldie wrote:i have to admit, that i did not have a situation yet, where storing pixels using 8 bits per component makes sense on the PPC - especially considering that RGBX8888 takes twice the memory and bandwidth of RGB565...


Yep... Bandwidth to the RAM is a big bottleneck on the PPC and you absolutely want to minimize that.
It's also useful for loading 32 bits XRGB and ARGB BMP files ;)

--Eric
drgoldie wrote:yes, you're right. of course it's only 25% wasted, but 33% more.

i have to admit, that i did not have a situation yet, where storing pixels using 8 bits per component makes sense on the PPC - especially considering that RGBX8888 takes twice the memory and bandwidth of RGB565...

i could be useful if lots of blending is used, but then it still takes a lot of performance.

DANIEL


I agree. It sounds counter-intuitive, but you are better off unpacking and packing RGB565 using some fast shifts / ands, than handling twice the memory. On top of better performance you consume half the RAM, which is icing on the cake.

Dan East