assembler/fs: TEX: swap a/rgb order in write mask

This commit is contained in:
Zack Buhman 2025-10-28 14:17:57 -05:00
parent e8da0190fc
commit 7f7011fd4d
2 changed files with 8 additions and 8 deletions

View File

@ -64,13 +64,13 @@ def validate_mask_swizzle(token) -> tuple[AlphaMask, RGBMask]:
(b"rb" , (AlphaMask.NONE, RGBMask.RB)),
(b"gb" , (AlphaMask.NONE, RGBMask.GB)),
(b"rgb" , (AlphaMask.NONE, RGBMask.RGB)),
(b"ar" , (AlphaMask.A, RGBMask.R)),
(b"ag" , (AlphaMask.A, RGBMask.G)),
(b"arg" , (AlphaMask.A, RGBMask.RG)),
(b"ab" , (AlphaMask.A, RGBMask.B)),
(b"arb" , (AlphaMask.A, RGBMask.RB)),
(b"agb" , (AlphaMask.A, RGBMask.GB)),
(b"argb" , (AlphaMask.A, RGBMask.RGB)),
(b"ra" , (AlphaMask.A, RGBMask.R)),
(b"ga" , (AlphaMask.A, RGBMask.G)),
(b"rga" , (AlphaMask.A, RGBMask.RG)),
(b"ba" , (AlphaMask.A, RGBMask.B)),
(b"rba" , (AlphaMask.A, RGBMask.RB)),
(b"gba" , (AlphaMask.A, RGBMask.GB)),
(b"rgba" , (AlphaMask.A, RGBMask.RGB)),
])
if token.lexeme not in argb_masks:
raise ValidatorError("invalid destination mask", token)

View File

@ -420,7 +420,7 @@ def disassemble_tex_dest(code):
a_wmask, a_wmask_str, _ = US_CMN_INST._ALPHA_WMASK(code)
wmask_bool = rgb_wmask != 0 or a_wmask != 0
rgba_wmask = (a_wmask_str if a_wmask else "") + (rgb_wmask_str if rgb_wmask else "")
rgba_wmask = (rgb_wmask_str if rgb_wmask else "") + (a_wmask_str if a_wmask else "")
temp_str = f"temp[{dst_addr}].{rgba_wmask.lower().ljust(4)} = " if wmask_bool else ""