Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GS/HW: Use proper alpha min max for palettes when looking up a source, adjust dither on blend mix. #12081

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4553,7 +4553,8 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
// Disable dithering on blend mix if needed.
if (m_conf.ps.dither)
{
const bool can_dither = (m_conf.ps.blend_a == 0 && m_conf.ps.blend_b == 1 && alpha_eq_less_one);
// TODO: Either exclude BMIX1_ALPHA_HIGH_ONE case or allow alpha > 1.0 on dither adjust, case is currently disabled.
const bool can_dither = (m_conf.ps.blend_a == 0 && m_conf.ps.blend_b == 1) || (m_conf.ps.blend_a == 1 && m_conf.ps.blend_b == 0);
m_conf.ps.dither = can_dither;
m_conf.ps.dither_adjust = can_dither;
}
Expand Down
7 changes: 5 additions & 2 deletions pcsx2/GS/Renderers/HW/GSTextureCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1742,9 +1742,12 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const bool is_color, const
TEX0.TBP0, psm_s.pal > 0 ? TEX0.CBP : 0,
psm_str(TEX0.PSM));

// If it's from a target, we need to make sure the alpha information is up to date, especially in 16/24 bit formats where it can change draw to draw.
// If it's an old source made from target make sure it isn't a palette,
// alphas need to be used from the palette then.
// If it's from a target, we need to make sure the alpha information is up to date,
// especially in 16/24 bit formats where it can change draw to draw.
// Guard against merged targets which don't actually link.
if (src->m_target && src->m_from_target)
if (!src->m_palette && src->m_target && src->m_from_target)
{
src->m_valid_alpha_minmax = true;
if (src->m_target_direct)
Expand Down
Loading