From b5dcfb3431d767600fee6d5f3fa5d28dc862a944 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 29 Aug 2021 23:22:41 +0300 Subject: [PATCH] rsx: Rework gamma override mask from RGBA to ARGB to match other per-channel mask registers --- rpcs3/Emu/RSX/Program/GLSLCommon.h | 4 ++-- rpcs3/Emu/RSX/RSXTexture.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/Program/GLSLCommon.h b/rpcs3/Emu/RSX/Program/GLSLCommon.h index ff144d4a27..292912b063 100644 --- a/rpcs3/Emu/RSX/Program/GLSLCommon.h +++ b/rpcs3/Emu/RSX/Program/GLSLCommon.h @@ -9,10 +9,10 @@ namespace rsx // TODO: Move this somewhere else once more compilers are supported other than glsl enum texture_control_bits { - GAMMA_R = 0, + GAMMA_A = 0, + GAMMA_R, GAMMA_G, GAMMA_B, - GAMMA_A, ALPHAKILL, RENORMALIZE, EXPAND_A, diff --git a/rpcs3/Emu/RSX/RSXTexture.cpp b/rpcs3/Emu/RSX/RSXTexture.cpp index 7a3e054679..96e5b51a86 100644 --- a/rpcs3/Emu/RSX/RSXTexture.cpp +++ b/rpcs3/Emu/RSX/RSXTexture.cpp @@ -107,7 +107,9 @@ namespace rsx u8 fragment_texture::gamma() const { - return ((registers[NV4097_SET_TEXTURE_ADDRESS + (m_index * 8)] >> 20) & 0xf); + // Converts gamma mask from RGBA to ARGB for compatibility with other per-channel mask registers + const u32 rgba8_ctrl = ((registers[NV4097_SET_TEXTURE_ADDRESS + (m_index * 8)] >> 20) & 0xf); + return ((rgba8_ctrl << 1) & 0xF) | (rgba8_ctrl >> 3); } u8 fragment_texture::aniso_bias() const