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

Simplify synchronization in VulkanRenderManager #16090

Merged
merged 8 commits into from
Sep 24, 2022

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Sep 23, 2022

This simplifies thread synchronization in the Vulkan rendering backend, making it easier to reason about and debug, and very slightly faster. Tested the GE debugger, seems fine.

Now uses a queue where we tell the render thread what to do, instead of maintaining a separate frame counter.

Also there's an issue when stuffing the queue, it's not allowed to wait on a fence if the submission that is going to trigger it is currently happening on another thread, I missed that. And using a regular mutex easily deadlocks (working on it).

@hrydgard hrydgard added Vulkan Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. labels Sep 23, 2022
@hrydgard hrydgard added this to the v1.14.0 milestone Sep 23, 2022
@hrydgard
Copy link
Owner Author

OK, had to reintroduce one frame-specific cond-var.

Still, this actually provides a very small but measurable speedup (600 fps to 610 fps on a GoW title screen).

Will test some more before merge.

@hrydgard hrydgard marked this pull request as ready for review September 23, 2022 18:49
@hrydgard
Copy link
Owner Author

I think this is pretty much ready to go now.

Copy link
Collaborator

@unknownbrackets unknownbrackets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good but it's still breaking in the disassembly as it was before (note: not the GE debugger.)

Reproduction:

  1. Start a game.
  2. Open Disassembly.
  3. Hit Break.
  4. Hit Go.

Always crashes. Anyway, this doesn't make that any worse than before and seems better. I tried a couple runs and haven't gotten the readyForFences error or any other failures/deadlocks.

-[Unknown]

@unknownbrackets unknownbrackets merged commit b56bd0d into master Sep 24, 2022
@unknownbrackets unknownbrackets deleted the more-vulkan-cleanup-work branch September 24, 2022 00:24
@unknownbrackets
Copy link
Collaborator

Found and added a fix/workaround for the crash here: #16092.

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. Vulkan
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants