temp fix for ng ragebound stage 4-1 problem
All checks were successful
eden-license / license-header (pull_request) Successful in 20s
All checks were successful
eden-license / license-header (pull_request) Successful in 20s
This commit is contained in:
parent
4ea9664ff4
commit
719cde1ddb
3 changed files with 51 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
@ -3131,6 +3131,31 @@ public:
|
||||||
void ProcessCBData(u32 value);
|
void ProcessCBData(u32 value);
|
||||||
void ProcessCBMultiData(const u32* start_base, u32 amount);
|
void ProcessCBMultiData(const u32* start_base, u32 amount);
|
||||||
|
|
||||||
|
//TEMP: skips problematic lighting blend detected in ninja gaiden ragebound
|
||||||
|
//TODO: fix blending properly. clue is FCSM_TR (src\shader_recompiler\frontend\ir\ir_emitter.cpp)
|
||||||
|
enum class UnimplementedBlendID : u32 {
|
||||||
|
NGR_00 = 0
|
||||||
|
};
|
||||||
|
inline static bool IsUnimplementedBlend(const Maxwell3D::Regs& _regs, UnimplementedBlendID id) {
|
||||||
|
using Blend = Maxwell3D::Regs::Blend;
|
||||||
|
bool result = true;
|
||||||
|
auto eq = [](u32 v, u32 a, u32 b) { return v == a || v == b; };
|
||||||
|
if (id == UnimplementedBlendID::NGR_00) {
|
||||||
|
result &= !_regs.blend_per_target_enabled;
|
||||||
|
result &= _regs.blend.enable[0];
|
||||||
|
result &= eq(static_cast<u32>(_regs.blend.color_source), static_cast<u32>(Blend::Factor::One_D3D), static_cast<u32>(Blend::Factor::One_GL));
|
||||||
|
result &= eq(static_cast<u32>(_regs.blend.color_dest), static_cast<u32>(Blend::Factor::Zero_D3D), static_cast<u32>(Blend::Factor::Zero_GL));
|
||||||
|
result &= eq(static_cast<u32>(_regs.blend.alpha_source), static_cast<u32>(Blend::Factor::One_D3D), static_cast<u32>(Blend::Factor::One_GL));
|
||||||
|
result &= eq(static_cast<u32>(_regs.blend.alpha_dest), static_cast<u32>(Blend::Factor::OneMinusSourceAlpha_D3D), static_cast<u32>(Blend::Factor::OneMinusSourceAlpha_GL));
|
||||||
|
result &= eq(static_cast<u32>(_regs.blend.color_op), static_cast<u32>(Blend::Equation::Add_D3D), static_cast<u32>(Blend::Equation::Add_GL));
|
||||||
|
result &= eq(static_cast<u32>(_regs.blend.alpha_op), static_cast<u32>(Blend::Equation::Add_D3D), static_cast<u32>(Blend::Equation::Add_GL));
|
||||||
|
result &= _regs.iterated_blend.enable;
|
||||||
|
result &= (_regs.iterated_blend.pass_count > 0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void InitializeRegisterDefaults();
|
void InitializeRegisterDefaults();
|
||||||
|
|
||||||
|
|
|
@ -1143,12 +1143,19 @@ void RasterizerOpenGL::SyncBlendState() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
//TEMP: skips problematic lighting blend detected in ninja gaiden ragebound
|
||||||
|
//TODO: fix blending properly. clue is FCSM_TR (src\shader_recompiler\frontend\ir\ir_emitter.cpp)
|
||||||
|
if (Tegra::Engines::Maxwell3D::IsUnimplementedBlend(regs, Tegra::Engines::Maxwell3D::UnimplementedBlendID::NGR_00)) {
|
||||||
|
glBlendFuncSeparate(GL_ONE, GL_ONE, GL_ONE_MINUS_SRC_COLOR, GL_ZERO);
|
||||||
|
glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD);
|
||||||
|
} else {
|
||||||
glBlendFuncSeparate(MaxwellToGL::BlendFunc(regs.blend.color_source),
|
glBlendFuncSeparate(MaxwellToGL::BlendFunc(regs.blend.color_source),
|
||||||
MaxwellToGL::BlendFunc(regs.blend.color_dest),
|
MaxwellToGL::BlendFunc(regs.blend.color_dest),
|
||||||
MaxwellToGL::BlendFunc(regs.blend.alpha_source),
|
MaxwellToGL::BlendFunc(regs.blend.alpha_source),
|
||||||
MaxwellToGL::BlendFunc(regs.blend.alpha_dest));
|
MaxwellToGL::BlendFunc(regs.blend.alpha_dest));
|
||||||
glBlendEquationSeparate(MaxwellToGL::BlendEquation(regs.blend.color_op),
|
glBlendEquationSeparate(MaxwellToGL::BlendEquation(regs.blend.color_op),
|
||||||
MaxwellToGL::BlendEquation(regs.blend.alpha_op));
|
MaxwellToGL::BlendEquation(regs.blend.alpha_op));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1550,7 +1550,18 @@ void RasterizerVulkan::UpdateBlending(Tegra::Engines::Maxwell3D::Regs& regs) {
|
||||||
host_blend.alphaBlendOp = MaxwellToVK::BlendEquation(guest_blend.alpha_op);
|
host_blend.alphaBlendOp = MaxwellToVK::BlendEquation(guest_blend.alpha_op);
|
||||||
};
|
};
|
||||||
if (!regs.blend_per_target_enabled) {
|
if (!regs.blend_per_target_enabled) {
|
||||||
|
//TEMP: skips problematic lighting blend detected in ninja gaiden ragebound
|
||||||
|
//TODO: fix blending properly. clue is FCSM_TR (src\shader_recompiler\frontend\ir\ir_emitter.cpp)
|
||||||
|
if (Tegra::Engines::Maxwell3D::IsUnimplementedBlend(regs, Tegra::Engines::Maxwell3D::UnimplementedBlendID::NGR_00)) {
|
||||||
|
setup_blends[index].srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
|
||||||
|
setup_blends[index].dstColorBlendFactor = VK_BLEND_FACTOR_ONE;
|
||||||
|
setup_blends[index].colorBlendOp = VK_BLEND_OP_ADD;
|
||||||
|
setup_blends[index].srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR;
|
||||||
|
setup_blends[index].dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO;
|
||||||
|
setup_blends[index].alphaBlendOp = VK_BLEND_OP_ADD;
|
||||||
|
} else {
|
||||||
blend_setup(regs.blend);
|
blend_setup(regs.blend);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
blend_setup(regs.blend_per_target[index]);
|
blend_setup(regs.blend_per_target[index]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue