Skip to content
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

Feature request - "try Vulkan" #36

Open
mqxf opened this issue Feb 7, 2023 · 2 comments
Open

Feature request - "try Vulkan" #36

mqxf opened this issue Feb 7, 2023 · 2 comments

Comments

@mqxf
Copy link

mqxf commented Feb 7, 2023

It is basically an option you can put onto the createContext() function, which sets the default rendering engine to vulkan, however, if the setup fails, for example if the GPU doesn't support vulkan, it reverts the rendering engine to OpenGL and creates a new context, closing the second one. That way the GPUs that can support vulkan will have vulkan, and those that cannot will be automatically switched to OpenGL.

Potential name would be a boolean called "autoRevert"

@fabmax
Copy link
Collaborator

fabmax commented Feb 7, 2023

Yes that would indeed be nice. However, currently the Vulkan backend doesn't support all features (some texture formats are missing, etc.). So for now, using OpenGL is probably the better option in any case. But once I come around improving the Vulkan backend I will integrate something like that.

@andrey-zakharov
Copy link
Contributor

You could easily go with something like this is your Mains:

    val ctx = try {
        createContext {
            assetsBaseDir = assetsDir
            renderBackend = Lwjgl3Context.Backend.VULKAN
            this.title = title
        }
    } catch (e: java.lang.Exception) {
        createContext {
            localAssetPath = assetsDir
            renderBackend = Lwjgl3Context.Backend.OPEN_GL
            this.title = title
        }
    }

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

No branches or pull requests

3 participants