-
Notifications
You must be signed in to change notification settings - Fork 12
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
Workaround for Linux shaders breakage #587
Conversation
My main concern is for those downloading and installing the builds. Checking the GitHub artifact, the resources.zip is generated via Windows so it didn't apply here and neither the libraries zip includes this, so it seems to me those will not get the read-only glshaders.cfg. |
d38e570
to
add195a
Compare
Right, and the chmod permissions are stored on the filesystem, so generating the file in the CI is a dead end... I guess I'll have to see if this can be monkey patched at runtime after all. |
Fix NeotokyoRebuild#438 This is a hack around the vision mode shaders sporadically breaking on Linux builds. It seems that for whatever reason, the shader state cached at the glshaders file somehow leads to the corruption upon successive runs of the game, and write-protecting the file offers a simple way to avoid that breakage. Ideally, we should figure out what's really going wrong here at the shader system and/or precaching level, but this should suffice for avoiding the bug. We're doing this at runtime because we can't version control the filesystem specific file metadata required for the read-only state. For more discussion, see: * NeotokyoRebuild#587 * NeotokyoRebuild#438 (comment)
add195a
to
b098ed3
Compare
@nullsystem I've moved the patch to the client dll initialization, could you test if it's still working correctly for you? |
what should happen is that glshaders.cfg gets set to read-only when I run NT;RE, right? I can test right now |
@Rainyan Looks like it works for me and manages to stub out that file with empty glshadercachev002. |
installed resources and linux release from the artifacts, ran the game twice and checked visions both times: I wonder what will happen if NT;RE is installed on wacky filesystems like NTFS, FAT32/exFAT that have different types of permissions, as well what will happen if the current user can't modify permissions |
nevermind, I see in the code that it just errors out |
This comment was marked as outdated.
This comment was marked as outdated.
Turn off the cvar for glshaders.cfg file generation on exit by default. Also remove the file, if it exists on launch. This will be too late to take effect for runs of the game where the file already exists, but should fix it for future runs. This also removes the dependency on filesystem specific read permission flags for the fix.
I found the cvar I made changes such that we toggle the autosave off via cvar, and then delete the file if it already existed. Since we're too late intervene at client load, it'll still be bugged for a run where the buggy file existed, but this should fix it for any future runs. And players first-time launching the game should never run into the problem, as the cvar change should prevent the file from being generated in the first place. This also removes the chmod filesystem permission flags fiddling, since it wasn't compatible across all the possible kinds of filesystems, as pointed out by @xedmain. |
Description
This is a hack around the vision mode shaders sporadically breaking on Linux builds.
It seems that for whatever reason, the shader state cached at the
glshaders.cfg
file somehow leads to the corruption upon successive runs of the game, andwrite-protecting the file offers a simple way to avoid that breakage.Ideally, we should figure out what's really going wrong here at the shader system and/or precaching level, but this should suffice for avoiding the bug.
I opted to implement this as a CMakeLists step rather than submit the glshaders file itself, because to my understanding git does not version control the "read-only" file permissions required to keep the game from modifying the file.edit: The hack is now done at runtime, because doing it in the CMake scripts won't carry over to users as pointed out by nullsystem, and we can't version control the file, because the filesystem specific metadata required for the read-only state won't carry over, and the concept of file permission flags is not universally available on all filesystems.
For more discussion, see: #438 (comment)
Steps to repro the bug
Steps to test this patch
Toolchain
Linked Issues