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

GPU: Only load the relevant color components upon writes to the tev color registers #1102

Merged
merged 2 commits into from Sep 21, 2014

Conversation

neobrain
Copy link
Member

The other two components need not be valid upon write, hence loading them results in glitches.

Fixes https://code.google.com/p/dolphin-emu/issues/detail?id=6783.

Also cleaned up the whole mess that surrounded these registers.

@neobrain
Copy link
Member Author

Awaiting further feedback from testing before merging.

@@ -265,8 +280,8 @@ void PixelShaderManager::SetFogRangeAdjustChanged()

void PixelShaderManager::DoState(PointerWrap &p)
{
p.Do(constants);
p.Do(dirty);
p.DoArray(s_tev_color, 4);

This comment was marked as off-topic.

This comment was marked as off-topic.

@JMC47
Copy link
Contributor

JMC47 commented Sep 17, 2014

I tested through this, and everything looks to be fine. Savestates work, do not cause any new glitches, Metroid Prime 3 blue screen no longer happens.

Is there anything special I need to test?

@@ -74,7 +74,8 @@ static void BPWritten(const BPCmd& bp)
bp.address == BPMEM_LOADTLUT1 ||
bp.address == BPMEM_TEXINVALIDATE ||
bp.address == BPMEM_PRELOAD_MODE ||
bp.address == BPMEM_CLEAR_PIXEL_PERF))
bp.address == BPMEM_CLEAR_PIXEL_PERF/* ||
(bp.address >= BPMEM_TEV_COLOR_RA && bp.address <= BPMEM_TEV_COLOR_BG + 6)*/))

This comment was marked as off-topic.

This comment was marked as off-topic.

@degasus
Copy link
Member

degasus commented Sep 17, 2014

LGTM

@@ -15,12 +15,20 @@
static bool s_bFogRangeAdjustChanged;
static bool s_bViewPortChanged;

// These colors aren't available from global BP state,

This comment was marked as off-topic.

This comment was marked as off-topic.

@MayImilae
Copy link
Contributor

Tested Metroid Prime Trilogy and Metroid Prime 3 in D3D and OpenGL. Even tried Metroid Prime 2 (GC) for the hell of it. All work fine!

LGTM.

@FioraAeterna
Copy link
Contributor

This looks really great, thanks so much for taking over this patch!

@neobrain
Copy link
Member Author

If this version looks okay to everyone, I'll rebase it for merging.

Note that I had to add a new DoArray overload to PointerWrap for easier state handling for std::array objects. I guess this change is small enough that I can just stuff it into this PR instead of opening a separate one.

@RachelBryk
Copy link
Member

As long as you are stuffing in small changes, would you mind also deleting lines 789-791 from Movie.cpp? I'd rather avoid making a separate commit so as to not unnecessarily break save state compatibility any more than we need to.

@neobrain
Copy link
Member Author

@RachelBryk That doesn't look related at all to this branch though. The ChunkFile fix is at least a bit related, because the way I had to implement DoState without that DoArray overload was too ugly(tm).

This is inconsistent with how other containers are used (i.e. with Do()), but making std::array be used with Do() seems rather confusing when there's also a DoArray available.
…olor registers.

The other two components need not be valid upon write, hence loading them results in glitches.

Fixes issue 6783.
neobrain added a commit that referenced this pull request Sep 21, 2014
GPU: Only load the relevant color components upon writes to the tev color registers
@neobrain neobrain merged commit 124df2e into dolphin-emu:master Sep 21, 2014
@neobrain neobrain deleted the tevreg_loading branch September 21, 2014 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
9 participants