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
Vulkan: Add workarounds for MoltenVK #4202
Conversation
Note: there seems to be an issue with the attachment format specialization, though it happened randomly after like 4 races in Mario Kart 8 Deluxe. I'm looking into it.
|
Ryujinx.Graphics.Gpu/Engine/Threed/SpecializationStateUpdater.cs
Outdated
Show resolved
Hide resolved
…for invalid/unknown guest formats
Intel and AMD GPUs on moltenvk report with the those vendors - only apple silicon reports with vendor 0x106B.
Might have caused the crash in MK8
Ryujinx.Graphics.Gpu/Engine/Threed/SpecializationStateUpdater.cs
Outdated
Show resolved
Hide resolved
@@ -515,12 +590,13 @@ private unsafe void PrintGpuInformation() | |||
|
|||
IsAmdWindows = Vendor == Vendor.Amd && RuntimeInformation.IsOSPlatform(OSPlatform.Windows); | |||
IsIntelWindows = Vendor == Vendor.Intel && RuntimeInformation.IsOSPlatform(OSPlatform.Windows); | |||
IsTBDR = IsMoltenVk || Vendor == Vendor.Qualcomm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't look right when desktop GPUs will also be included here (AMD, there's also integrated Intel which I think it's also not TBDR)? Also should we include ARM (Mali) GPUs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how Intel/AMD GPUs on macOS will behave in this situation, so the workaround was enabled there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I do think other TBDR gpus should be included here, as they will definitely have the issue.
@@ -434,7 +507,9 @@ public unsafe Capabilities GetCapabilities() | |||
GpuVendor, | |||
hasFrontFacingBug: IsIntelWindows, | |||
hasVectorIndexingBug: Vendor == Vendor.Qualcomm, | |||
supportsAstcCompression: features2.Features.TextureCompressionAstcLdr, | |||
needsFragmentOutputSpecialization: IsMoltenVk, | |||
reduceShaderPrecision: IsMoltenVk, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should include all mobile GPUs here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is enabled because of a weird behaviour with SPIRV-Cross that makes precise much slower. I'm not sure how much effect there will be on other GPUs from this, but it probably won't be anywhere near as extreme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks.
This PR does the following things:
This PR does not include other things mentioned on #4062, such as transform feedback or geometry shader emulation. It also doesn't include A64 JIT, hypervisor or any related workarounds, so things will only really work under Rosetta. The performance enhancement "buffer mirrors" also is not present, which may negatively impact some games. This may be lessened by recent changes to reduce inline updates.
One important thing this doesn't include is any sort of workaround for resource usage errors on MoltenVK. These issues are better explained on #4062, but I really have not had time to make some kind of reproduction for the issue to report it to them. I'd rather we didn't have to add some weird resource tracking to our descriptor set updater just for MoltenVK.