You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed a lot of confusion around GS PSM. To begin, let's first understand what "PSM" stands for. PSM means Pixel Storage Mode and used to define the pixel format (RGBA8 vs RGB5A1) in addition to how it's stored (packed vs unpacked) and how it is swizzled.
The following table defines what which component of the PSM name stands for:
Component
Meaning
CT
Denotes full color (non-palleted) format. CT stands for "Color Texture".
T
Indexed color. The T simply stands for "Texture".
S
A CT16 or Z16 texture which is compatible with Z32, Z24, CT32 and CT24 (respectively) storage inside a shared page buffer. The S stands for "Swizzling". Despite common intuition it does not stand for "Signed".
Z
Z swizzling which allows it to share a page buffer with color formats. It is entirely possible to treat a Z format as a color format when drawing or sampling.
H
Unpacked 8 bit format which aligns with the alpha channel of CT32.
HH
Unpacked 4 bit format which aligns to the upper 4 bits of the alpha channel of CT32.
HL
Unpacked 4 bit format which aligns to the lower 4 bits of the alpha channel of CT32.
32, 24, 16, 8, and 4
Denotes the pixel format by bit depth which are RGBA8, RGB8, RGB5A1, IDTEX8 and IDTEX4 respectively. For Z it simply denotes the size of the unsigned integer in bits (in which case 8 and 4 are not supported).
CT24 and Z24 are always aligned to CT32 but with an unused alpha channel. CT16, CT16S, Z16 and Z16S are always packed into 2 pixels inside a CT32 pixel. T8 and T4 are always packed to 4 and 8 indices inside a CT32 pixel respectively unless otherwise denoted with the H, HH and HL components. T8, CT32 and CT24 share the same block ordering. T4 shares it's block ordering with CT16. CT16S and Z16S use a different block ordering to CT16 and Z16 which splits the cache vertically instead of horizontally allowing them to be compatible with CT32, CT24, Z32 and Z24 as the framebuffer cache must share both depth and color 1.
All formats are unsigned integer formats. The GS has no support for signed or floating point formats.
Footnotes
There are exceptions to these rules but they rely on undefined behavior. ↩
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
PSM Names
I've noticed a lot of confusion around GS PSM. To begin, let's first understand what "PSM" stands for. PSM means Pixel Storage Mode and used to define the pixel format (RGBA8 vs RGB5A1) in addition to how it's stored (packed vs unpacked) and how it is swizzled.
The following table defines what which component of the PSM name stands for:
CT24 and Z24 are always aligned to CT32 but with an unused alpha channel. CT16, CT16S, Z16 and Z16S are always packed into 2 pixels inside a CT32 pixel. T8 and T4 are always packed to 4 and 8 indices inside a CT32 pixel respectively unless otherwise denoted with the H, HH and HL components. T8, CT32 and CT24 share the same block ordering. T4 shares it's block ordering with CT16. CT16S and Z16S use a different block ordering to CT16 and Z16 which splits the cache vertically instead of horizontally allowing them to be compatible with CT32, CT24, Z32 and Z24 as the framebuffer cache must share both depth and color 1.
All formats are unsigned integer formats. The GS has no support for signed or floating point formats.
Footnotes
There are exceptions to these rules but they rely on undefined behavior. ↩
Beta Was this translation helpful? Give feedback.
All reactions