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

DolphinQt: Rework TAS input threading #11622

Merged
merged 3 commits into from Mar 9, 2023

Conversation

JosJuice
Copy link
Member

@JosJuice JosJuice commented Mar 4, 2023

This gets rid of a blocking operation, improving performance and fixing https://bugs.dolphin-emu.org/issues/12893.

This also makes us no longer directly access the state of certain UI elements from the CPU thread, which probably wasn't thread-safe but doesn't seem to have caused any observable issues so far.

This is an alternative to PR #11620.

@JosJuice
Copy link
Member Author

JosJuice commented Mar 4, 2023

This PR isn't quite finished yet – the new approach is fully implemented for buttons, but hasn't been implemented for analog controls. I've opened the PR early to get feedback on whether my threading model is a good approach.

@Dentomologist
Copy link
Contributor

The threading model seems fine to me.

On master, holding a controller button and unchecking the box in the TAS window will result in the controller input and checkbox staying pressed. In this PR, the checkbox (and actual input sent to the game) will become unpressed. Is that change intentional?

@JosJuice
Copy link
Member Author

JosJuice commented Mar 6, 2023

Yes, though the main reason I did it was so it would be consistent with how analog inputs worked so I could simplify the code.

@JosJuice JosJuice marked this pull request as ready for review March 7, 2023 19:08
@JosJuice
Copy link
Member Author

JosJuice commented Mar 7, 2023

Alright, this should be ready to go now.

This gets rid of a blocking operation, improving performance and fixing
https://bugs.dolphin-emu.org/issues/12893.

This also makes us no longer directly access the state of certain UI
elements from the CPU thread, which probably wasn't thread-safe but
doesn't seem to have caused any observable issues so far.
IIRC we needed this before the input override system was added.
@AdmiralCurtiss AdmiralCurtiss merged commit 234c5dd into dolphin-emu:master Mar 9, 2023
14 checks passed
@JosJuice JosJuice deleted the tas-input-nonblocking branch March 9, 2023 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants