-
Notifications
You must be signed in to change notification settings - Fork 130
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
desktop-ui/presentation: Add an alternative path for loading shaders on Linux and BSD #1738
desktop-ui/presentation: Add an alternative path for loading shaders on Linux and BSD #1738
Conversation
I think this is fine so that we can introduce the baseline functionality of loading shaders from the However, as discussed a bit out-of-band, I think we do need to reorganize the whole way shaders are loaded. Currently, from my understanding, ares only considers shaders in one directory; either the first one This doesn't offer any clean way to override particular shaders, for example in the user folder. Even under this PR, shaders are "all or nothing" and coming from one sole directory. I think ideally, the Based on my initial look at the problem, this is a non-trivial amount of work since the recursive trawler in As far as the use/abuse of |
74dd84c
to
c171737
Compare
Unfortunatly this alternate shaders path is not correct for all use cases. The shaders from a
By default, and this is how the prebuild binary packages on FreeBSD are build, these two variables are identical and set to As per port policy and guideline I have to patch this so ares searches the shaders in With the new cmake build system we already have the |
Currently, per
While the logical flow here is not "ideal", especially removing the The only case I think it does not cover is if you use a particular package manager to install slang-shaders to a custom prefix somewhere on the system, AND if that is not the same package manager you used to install ares. In the event we decided that more custom application logic is necessary to find shaders, I think that using configure-time logic to define search paths within the build itself is to be avoided if at all possible. The It seems to me that if further program logic is necessary, rather than patching the build to define any particular path, it should just be made part of the actual UI. "Locate Shaders..." in the menu which opens a directory selection modal, and that directory is stored along with the rest of the user's settings. |
Thank you for your detailed response. Indeed in 99.9% of use cases the current behavior will just work. It's just this 0.01% chance of someone doing a non-standard build via the ports framework with different settings for |
On some Linux and BSD distribution, Ares from the repositories may not come with shaders preinstalled. Instead, these one may come from another package, for example on Archlinux the package
libretro-shaders-slang
installs the shaders in the following path:/usr/share/libretro/shaders/shaders_slang/
.This will make Ares fail to load any shaders on these distro. So to fix it, this PR adds the aforementioned location as another path to search for, as a fallback.
I know, the two dots are a bit ugly, given that locate() normally doesn't search for files or directories outside of those of Ares...Ideally, locate() should be expanded to search the entire file system, but I'm afraid the required changes may be a bit more far reaching than expected.