Skip to content

v5 - Fix for unity 2022.3.62f3 not having get_graphicsDeviceID#1235

Merged
ManlyMarco merged 3 commits intoBepInEx:v5-ltsfrom
xinitrcn1:patch-1
Jan 27, 2026
Merged

v5 - Fix for unity 2022.3.62f3 not having get_graphicsDeviceID#1235
ManlyMarco merged 3 commits intoBepInEx:v5-ltsfrom
xinitrcn1:patch-1

Conversation

@xinitrcn1
Copy link
Copy Markdown

Description

fixes error with missing method

Motivation and Context

allows one to run bepinex5

How Has This Been Tested?

yeah

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Copy link
Copy Markdown
Member

@ManlyMarco ManlyMarco left a comment

Choose a reason for hiding this comment

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

Is there no viable alternative in case graphicsDeviceID is missing? How is this handled on the master branch, maybe the code could be backported?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a compatibility issue with Unity 2022.3.62f3 where the SystemInfo.graphicsDeviceID property is not available, which was causing BepInEx5 to fail.

Key Changes:

  • Added try-catch block around SystemInfo.graphicsDeviceID access in the IsHeadless property to handle missing property gracefully
  • Returns false (non-headless) as fallback when the property is unavailable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread BepInEx/Bootstrap/Chainloader.cs Outdated
Comment thread BepInEx/Bootstrap/Chainloader.cs Outdated
Comment thread BepInEx/Bootstrap/Chainloader.cs Outdated
@xinitrcn1
Copy link
Copy Markdown
Author

Is there no viable alternative in case graphicsDeviceID is missing? How is this handled on the master branch, maybe the code could be backported?

no, unity 2022 just has no graphicsDeviceID, the only relatively sane way is to check DeviceName or whatever but that requires checking strings which can turn into a fun rabbit hole in and of itself (just ask the mesa people)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ManlyMarco
Copy link
Copy Markdown
Member

That's weird, Unity docs say this property exists in all versions, is your game compiled for console/android? https://docs.unity3d.com/6000.3/Documentation/ScriptReference/SystemInfo-graphicsDeviceID.html

Comment thread BepInEx/Bootstrap/Chainloader.cs Outdated
@xinitrcn1
Copy link
Copy Markdown
Author

That's weird, Unity docs say this property exists in all versions, is your game compiled for console/android? https://docs.unity3d.com/6000.3/Documentation/ScriptReference/SystemInfo-graphicsDeviceID.html

the docs lied, i checked the DLLs (unityjit-win32) it's not there

Co-authored-by: ManlyMarco <39247311+ManlyMarco@users.noreply.github.com>
@ManlyMarco ManlyMarco merged commit 8e9afa9 into BepInEx:v5-lts Jan 27, 2026
@ManlyMarco ManlyMarco changed the title Fix for unity 2022.3.62f3 not having get_graphicsDeviceID v5 - Fix for unity 2022.3.62f3 not having get_graphicsDeviceID Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants