Skip to content

VideoBackends/Vulkan: Drop BUG_BROKEN_DISCARD_WITH_EARLY_Z workaround#14492

Open
OatmealDome wants to merge 5 commits intodolphin-emu:masterfrom
OatmealDome:apple-discard-bug-fixed-3
Open

VideoBackends/Vulkan: Drop BUG_BROKEN_DISCARD_WITH_EARLY_Z workaround#14492
OatmealDome wants to merge 5 commits intodolphin-emu:masterfrom
OatmealDome:apple-discard-bug-fixed-3

Conversation

@OatmealDome
Copy link
Copy Markdown
Member

Supersedes #14271. I will split the changes to the build system into a separate PR.

I also removed the nil check in GetMacOSVersion() because [NSProcessInfo processInfo] is guaranteed to never be nil.

Copy link
Copy Markdown
Contributor

@TellowKrinkle TellowKrinkle left a comment

Choose a reason for hiding this comment

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

Seems reasonable. Would it be worth adding a Common/CommonFuncsObjC.mm for implementing ObjC stuff so we don't need to manually msgsend?

@OatmealDome OatmealDome force-pushed the apple-discard-bug-fixed-3 branch from ad633c9 to 94e15e3 Compare March 20, 2026 22:54
@OatmealDome
Copy link
Copy Markdown
Member Author

That seems reasonable. Not sure how I'd implement it off the top of my head though.

@TellowKrinkle
Copy link
Copy Markdown
Contributor

Not sure how I'd implement it off the top of my head though.

I think it's just adding the .mm file to CMake, and then putting the function implementation in there instead of in a .cpp file. The compiler will pick between c++ and obj-c++ by the file extension.

@OatmealDome OatmealDome force-pushed the apple-discard-bug-fixed-3 branch from 94e15e3 to 5a5c722 Compare March 20, 2026 23:58
@OatmealDome
Copy link
Copy Markdown
Member Author

Ah, that's what you mean lol

For some reason I somehow read your suggestion as creating some sort of function to make this easier:

id processInfo = reinterpret_cast<id (*)(Class, SEL)>(objc_msgSend)(
      objc_getClass("NSProcessInfo"), sel_getUid("processInfo"));

@OatmealDome OatmealDome force-pushed the apple-discard-bug-fixed-3 branch from 5a5c722 to ccb6dc9 Compare March 21, 2026 00:18
@TellowKrinkle
Copy link
Copy Markdown
Contributor

Ahh no, just that if you're in a .mm you can do

const NSOperatingSystemVersion ver = [[NSProcessInfo processInfo] operatingSystemVersion];
return { ver.majorVersion, ver.minorVersion, ver.patchVersion };

which looks a bit nicer

@TellowKrinkle
Copy link
Copy Markdown
Contributor

BTW since Metal and Vulkan are using the same calculation for driver version on macOS, maybe put that in some shared place and call from both?

@OatmealDome OatmealDome force-pushed the apple-discard-bug-fixed-3 branch 2 times, most recently from 2de54fd to 95aa8b5 Compare March 21, 2026 02:12
@OatmealDome OatmealDome force-pushed the apple-discard-bug-fixed-3 branch from 95aa8b5 to 26e58ea Compare March 21, 2026 15:16
@OatmealDome
Copy link
Copy Markdown
Member Author

OK, I think this is in a good place now. I've moved the version calculation to be in DriverDetails and created CommonFuncsObjC.mm to hold the Objective-C code.

@TellowKrinkle
Copy link
Copy Markdown
Contributor

Can you add the .h to CMake too? Otherwise it won't be included in cmake-generated Xcode project files.

@OatmealDome
Copy link
Copy Markdown
Member Author

I didn't add any new .h files - the new func was added to CommonFuncs.h.

@TellowKrinkle
Copy link
Copy Markdown
Contributor

All good, I was apparently seeing things that don't exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants