Force settings.h to match main
Some checks failed
eden-license / license-header (pull_request) Failing after 20s

This commit is contained in:
MaranBr 2025-08-24 02:05:38 +02:00 committed by Allison Cunha
parent e59065b542
commit 713725fe86
4 changed files with 57 additions and 10 deletions

View file

@ -538,12 +538,12 @@ struct Values {
SwitchableSetting<u8, true> dyna_state{linkage,
#if defined (_WIN32)
3,
#elif defined(__FreeBSD__)
#elif defined (__FreeBSD__)
3,
#elif defined(__unix__)
2,
#else
#elif defined (ANDROID)
0,
#else
2,
#endif
0,
3,

View file

@ -53,6 +53,35 @@ class DrawManager;
class Maxwell3D final : public EngineInterface {
public:
//TEMP: skips problematic lighting blend detected in ninja gaiden ragebound
//TODO: fix blending properly. seek (iterated_blend, FCSM_TR)
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;
}
explicit Maxwell3D(Core::System& system, MemoryManager& memory_manager);
~Maxwell3D();

View file

@ -1143,12 +1143,19 @@ void RasterizerOpenGL::SyncBlendState() {
return;
}
glEnable(GL_BLEND);
glBlendFuncSeparate(MaxwellToGL::BlendFunc(regs.blend.color_source),
MaxwellToGL::BlendFunc(regs.blend.color_dest),
MaxwellToGL::BlendFunc(regs.blend.alpha_source),
MaxwellToGL::BlendFunc(regs.blend.alpha_dest));
glBlendEquationSeparate(MaxwellToGL::BlendEquation(regs.blend.color_op),
//TEMP: skips problematic lighting blend detected in ninja gaiden ragebound
//TODO: fix blending properly. seek (iterated_blend, FCSM_TR)
if (IsUnimplementedBlend(regs, 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),
MaxwellToGL::BlendFunc(regs.blend.color_dest),
MaxwellToGL::BlendFunc(regs.blend.alpha_source),
MaxwellToGL::BlendFunc(regs.blend.alpha_dest));
glBlendEquationSeparate(MaxwellToGL::BlendEquation(regs.blend.color_op),
MaxwellToGL::BlendEquation(regs.blend.alpha_op));
}
return;
}

View file

@ -1550,7 +1550,18 @@ void RasterizerVulkan::UpdateBlending(Tegra::Engines::Maxwell3D::Regs& regs) {
host_blend.alphaBlendOp = MaxwellToVK::BlendEquation(guest_blend.alpha_op);
};
if (!regs.blend_per_target_enabled) {
blend_setup(regs.blend);
//TEMP: skips problematic lighting blend detected in ninja gaiden ragebound
//TODO: fix blending properly. seek (iterated_blend, FCSM_TR)
if (isUnimplementedBlend(regs, 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);
}
continue;
}
blend_setup(regs.blend_per_target[index]);