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
Conversation
5231619
to
09881e9
Compare
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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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. |
This looks really great, thanks so much for taking over this patch! |
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 |
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. |
@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.
1d46ab2
to
1d23c2c
Compare
GPU: Only load the relevant color components upon writes to the tev color registers
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.