mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
pan/mdg: Implement condense_writemask for 8-bit
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>
This commit is contained in:
parent
f768cb04ed
commit
ca48143ec4
1 changed files with 11 additions and 2 deletions
|
|
@ -56,8 +56,17 @@ static inline unsigned
|
|||
condense_writemask(unsigned expanded_mask,
|
||||
unsigned bits_per_component)
|
||||
{
|
||||
if (bits_per_component == 8)
|
||||
unreachable("XXX TODO: sort out how 8-bit constant encoding works");
|
||||
if (bits_per_component == 8) {
|
||||
/* Duplicate every bit to go from 8 to 16-channel wrmask */
|
||||
unsigned omask = 0;
|
||||
|
||||
for (unsigned i = 0; i < 8; ++i) {
|
||||
if (expanded_mask & (1 << i))
|
||||
omask |= (3 << (2 * i));
|
||||
}
|
||||
|
||||
return omask;
|
||||
}
|
||||
|
||||
unsigned slots_per_component = bits_per_component / 16;
|
||||
unsigned max_comp = (16 * 8) / bits_per_component;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue