[GPU/DXBC] Fix signed round bias breaking memexport

Write the bias into round_bias_temp as intended in both packed 8/16/32bpp path and 16_16_16_16.

The copysign rounding bias was targeted the eM register, and destroying the scaled value, then added round_bias_temp, which nothing had written.
This commit is contained in:
goldislead
2026-08-02 03:37:31 -07:00
committed by Radosław Gliński
parent 7010c86fb1
commit da47dfaacf

View File

@@ -195,8 +195,9 @@ void DxbcShaderTranslator::ExportToMemory(uint8_t export_eM) {
while (xe::bit_scan_forward(eM_remaining, &eM_index)) {
eM_remaining &= ~(uint8_t(1) << eM_index);
uint32_t eM = system_temps_memexport_data_[eM_index];
a_.OpBFI(dxbc::Dest::R(eM, components), dxbc::Src::LU(31),
dxbc::Src::LU(0), dxbc::Src::LF(0.5f), dxbc::Src::R(eM));
a_.OpBFI(dxbc::Dest::R(round_bias_temp, components),
dxbc::Src::LU(31), dxbc::Src::LU(0), dxbc::Src::LF(0.5f),
dxbc::Src::R(eM));
a_.OpAdd(dxbc::Dest::R(eM, components), dxbc::Src::R(eM),
dxbc::Src::R(round_bias_temp));
a_.OpFToI(dxbc::Dest::R(eM, components), dxbc::Src::R(eM));
@@ -421,8 +422,8 @@ void DxbcShaderTranslator::ExportToMemory(uint8_t export_eM) {
while (xe::bit_scan_forward(eM_remaining, &eM_index)) {
eM_remaining &= ~(uint8_t(1) << eM_index);
uint32_t eM = system_temps_memexport_data_[eM_index];
a_.OpBFI(dxbc::Dest::R(eM), dxbc::Src::LU(31), dxbc::Src::LU(0),
dxbc::Src::LF(0.5f), dxbc::Src::R(eM));
a_.OpBFI(dxbc::Dest::R(round_bias_temp), dxbc::Src::LU(31),
dxbc::Src::LU(0), dxbc::Src::LF(0.5f), dxbc::Src::R(eM));
a_.OpAdd(dxbc::Dest::R(eM), dxbc::Src::R(eM),
dxbc::Src::R(round_bias_temp));
a_.OpFToI(dxbc::Dest::R(eM), dxbc::Src::R(eM));