-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add a GraphicsPropertiesFetcher class #2071
base: master
Are you sure you want to change the base?
Conversation
Merge master
Merge master
How do I format the code correctly ? |
Hum, I have currently a bug when I launch two times a script using this. The second time it cannot load the OpenGL library :/. |
Fixed 😉. |
What should I use for the exception ? |
<activation> | ||
<os> | ||
<family>unix</family> | ||
<arch>amd64</arch> |
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.
Are we limiting us in any way if we specify amd64
here?
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 comes straight from LWJGL website so I do not know.
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.
On linux and macOS LWJGL is only available in 64 bits.
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.
What would happen if you run the code with Linux 32 bit or an older mac?
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 guess it would not work, obviously. De we really want to support such old architecture ? If so, the only possible solution is to write that as an external C++ code or to simply use glxinfo/vulkaninfo as stated in #2061.
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.
phoenicis-tools/src/main/java/org/phoenicis/tools/system/GraphicsProperties.java
Outdated
Show resolved
Hide resolved
phoenicis-tools/src/main/java/org/phoenicis/tools/system/GraphicsProperties.java
Outdated
Show resolved
Hide resolved
phoenicis-tools/src/main/java/org/phoenicis/tools/system/GraphicsPropertiesFetcher.java
Show resolved
Hide resolved
phoenicis-tools/src/main/java/org/phoenicis/tools/system/GraphicsPropertiesFetcher.java
Outdated
Show resolved
Hide resolved
phoenicis-tools/src/main/java/org/phoenicis/tools/system/GraphicsPropertiesFetcher.java
Outdated
Show resolved
Hide resolved
phoenicis-tools/src/main/java/org/phoenicis/tools/system/GraphicsPropertiesFetcher.java
Outdated
Show resolved
Hide resolved
phoenicis-tools/src/main/java/org/phoenicis/tools/system/GraphicsPropertiesFetcher.java
Outdated
Show resolved
Hide resolved
phoenicis-tools/src/main/java/org/phoenicis/tools/system/GraphicsProperties.java
Show resolved
Hide resolved
What exception do you mean? |
Codacy is not happy due to |
I am also interested if other people could test it by adding: .preInstall(function() {
const graphicsProperties = Bean("graphicsPropertiesFetcher").getProperties();
print(graphicsProperties.vendor);
print(graphicsProperties.renderer);
print(graphicsProperties.openGLVersion);
print(graphicsProperties.vulkanVersion);
}); in the 7-zip script for example. My output looks like:
|
The |
Seems maven cannot find LWJGL on macos, but it should 🤔. |
Now with this .preInstall(function() {
const graphicsProperties = Bean("graphicsPropertiesFetcher").getProperties();
print(graphicsProperties.vendor);
print(graphicsProperties.renderer);
print(graphicsProperties.openglVersion);
print(graphicsProperties.openglCoreVersion);
print(graphicsProperties.vulkanVersion);
}); in the 7-zip script for example, you should get something like this:
@Zemogiter, @madoar, @plata feel free to test and report here 😁 👍. |
I'll test it in DXVK/D9VK/VK9 PRs once #2067 is merged. |
I would like to know, before continuing here, how we want to handle the graphics properties fetching. |
We need to have a solution that either:
Correct me if I'm wrong but I think your proposed solution does not support 32 bit architectures and even leads to a crash on it. |
It does not work on pure/only 32 bits architecture simply because LWJGL is 64 bits only on linux. |
I agree that writing a wrapper for these functions is something we should not do. Therefore my option two, i.e. simply do a check in the fetcher class where you check the architecture and OS. If the OS or architecture are unsupported by the used library return an object containing "unsupported" values |
What do you mean ? ^^
I do not know how it works in java, but how can I compile without LWJGL on unsupported platform ? |
We have two choices if we want to provide these functions for 32 bit:
Both solutions have their (large) issues. The first one requires that the used applications are available. The second one requires C and JNI. Both areas I would like to circumvent if we can.
I expect maven to work an an unsupported platform as well. It just won't add |
And how do I do that check ? |
Another important note: I think there is no more Java 32bit version for a while now. So this may actually be the reason why LWJGL does not support 32bit? |
@madoar I do not know why the packaging fails on macOS, the pom.xml is directly taken from lwjgl website. If you have any idea... |
I have no idea as well. Maven suggests that all files exist (see https://repo1.maven.org/maven2/org/lwjgl/lwjgl-vulkan/3.2.2/ for example). Maybe the cache used by travis is out of date. I don't know if we can force an update manually. Maybe updating lwjgl to version |
Now it fails under macOS with
Again I just copy-paste the pom.xml from lwjgl website |
What's the status here? |
I do not know why the macOS build fails. The lines added to the pom come directly from lwjgl website, and it works on linux. |
@qparis could you check the Mac OS build? |
Ok, I'll have a look once I have managed to build wine 32on64. This is a difficult task that is taking most of the time I'm devoting to Phoenicis at the moment |
Ok I think I found where the error came from. Arch for macos is x86_64 instead of amd64. Which lwjgl website did not mention. |
What's the state of this pr? |
It compiles everywhere and works under linux. Needs to be tested on macos. |
I think it may be worth it to just merge this as is. If later on someone can test it on mac and finds out that it does not work it is still not too late to add a separate solution for macos. @plata what do you think? |
It's fine for me. |
Fetch:
Limitation : cannot distinguish 32 bits and 64 bits support.