rsx: Make BX2 flag respect constant overrides
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux-aarch64.sh, gcc, rpcs3/rpcs3-ci-jammy-aarch64:1.8, ubuntu-24.04-arm) (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.8, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.8, ubuntu-24.04-arm) (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.8, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / RPCS3 Mac ${{ matrix.name }} (0, 51ae32f468089a8169aaf1567de355ff4a3e0842, rpcs3/rpcs3-binaries-mac, Intel) (push) Has been cancelled
Build RPCS3 / RPCS3 Mac ${{ matrix.name }} (1, 8e21bdbc40711a3fccd18fbf17b742348b0f4281, rpcs3/rpcs3-binaries-mac-arm64, Apple Silicon) (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang ${{ matrix.arch }} (aarch64, clang, clangarm64, ARM64, windows-11-arm) (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang ${{ matrix.arch }} (x86_64, clang, clang64, X64, windows-2025) (push) Has been cancelled
Build RPCS3 / RPCS3 FreeBSD (push) Has been cancelled

This commit is contained in:
kd-11 2026-02-15 18:15:42 +03:00 committed by kd-11
parent 8a1b323749
commit b30a44c136
2 changed files with 15 additions and 4 deletions

View file

@ -34,7 +34,7 @@ R"(
#define _enable_texture_expand(index) \
do { \
if (_test_bit(TEX_PARAM(index).flags, FORMAT_FEATURE_BIASED_RENORMALIZATION_BIT)) { \
_texture_flag_override = SIGN_EXPAND_MASK; \
_texture_flag_override = SIGN_EXPAND_MASK & (_get_bits(TEX_PARAM(index).remap, 16, 4) << EXPAND_A_BIT); \
_texture_flag_erase = GAMMA_CTRL_MASK; \
_texture_bx2_active = true; \
} \

View file

@ -2366,15 +2366,19 @@ namespace rsx
if (format_features & RSX_FORMAT_FEATURE_GAMMA_CORRECTION)
{
// Tests show this is applied post-readout. It's a property of the final value stored in the register and is not remapped. It overwrites even constant channels (REMAP_ZERO | REMAP_ONE)
// Tests show this is applied post-readout. It's a property of the final value stored in the register and is not remapped.
// NOTE: GAMMA correction has no algorithmic effect on constants (0 and 1) so we need not mask it out for correctness.
gamma = tex.gamma() & ~(argb8_signed);
}
if (format_features & RSX_FORMAT_FEATURE_BIASED_NORMALIZATION)
{
// The renormalization flag applies to all channels. It is weaker than the other flags.
unsigned_remap = (tex.unsigned_remap() == CELL_GCM_TEXTURE_UNSIGNED_REMAP_NORMAL) ? 0u : 0xF;
unsigned_remap &= ~(argb8_signed | gamma);
// This applies on input and is subject to remap overrides
if (tex.unsigned_remap() == CELL_GCM_TEXTURE_UNSIGNED_REMAP_BIASED)
{
unsigned_remap = remap_channel_bits(texture_remap, 0xF) & ~(argb8_signed | gamma);
}
}
u32 argb8_convert = gamma;
@ -2390,6 +2394,13 @@ namespace rsx
texture_control |= argb8_convert;
texture_control |= format_features << texture_control_bits::FORMAT_FEATURES_OFFSET;
if (current_fp_metadata.has_tex_bx2_conv)
{
const u32 remap_hi = remap_channel_bits(texture_remap, 0xFu);
current_fragment_program.texture_params[i].remap &= ~(0xFu << 16u);
current_fragment_program.texture_params[i].remap |= (remap_hi << 16u);
}
}
current_fragment_program.texture_params[i].control = texture_control;