VulkanMod

VulkanMod

357k Downloads

Implement Vulkan extensions

Reabstraction opened this issue ยท 24 comments

commented

By default, Vulkan 1.2 isn't all that performant comparatively

Implementing extensions from https://registry.khronos.org/vulkan/ could greatly improve performance

An example would be VK_EXT_mesh_shader, which is the Vulkan equivalent of what NVIDIUM uses to give great performance

commented

Java Minecraft is PC only?

Well... not actually
https://pojavlauncherteam.github.io

commented

Also forgot to mention that the other reason we don't use Vulkan 1.2 Is because of Mobile compatibility issues with Android Drivers (Alot of Android Drivers are very outdated, and often don't support Vulkan 1.2 at all)

There are Extensions, but these are NG as not all drivers 100% support/include them

Holding back everyone because the default drivers on android are bad is not the greatest plan, they could just do the same thing android emulators do which is to use mesa turnip's custom drivers which work WAY better, are more compliant and performant too. Solves a ton of headaches!

commented

Holding back everyone because the default drivers on android are bad is not the greatest plan, they could just do the same thing android emulators do which is to use mesa turnip's custom drivers which work WAY better, are more compliant and performant too. Solves a ton of headaches!

Turnip only supports adreno 600 and 700. adreno 500 gpu's, mali gpu's and powervr gpu's don't work with turnip. Not all phones are newer qualcomm phones. If the minimum vulkan version would be raised everything below it would be dropped.

commented

Holding back everyone because the default drivers on android are bad is not the greatest plan, they could just do the same thing android emulators do which is to use mesa turnip's custom drivers which work WAY better, are more compliant and performant too. Solves a ton of headaches!

Turnip only supports adreno 600 and 700. adreno 500 gpu's, mali gpu's and powervr gpu's don't work with turnip. Not all phones are newer qualcomm phones. If the minimum vulkan version would be raised everything below it would be dropped.

Sure but at that point we're talking about fractions of fractions of a playerbase. It shouldn't mean to hold the entire project back for them

commented

Sure but at that point we're talking about fractions of fractions of a playerbase. It shouldn't mean to hold the entire project back for them

I don't think you have any idea how many phones don't use qualcomm

commented

I do, the answer is a sh*t ton. To give only a small example: every samsung phone sold outside of the US doesn't use qualcomm,

Already off to a rocky start, I live in the EU and they do sell phones with qualcomm

all of them have arm mali gpu's. Any android device using exynos, mediatek, unisoc, amlogic, rockchip, allwinner, nvidia, huawei, broadcomm, etc doesn't have turnip.

Which again is a fraction of a fraction

Correct me if I'm wrong but your argument to "just use turnip" doesn't hold much water when it comes to the entire mobile market and especially not when it comes to any mobile phone gpu, even including all gpu's that support turnip as none of those support mesh shaders.

True it doesn't, but thankfully this mod's "market" is fractions of a precentage composed of mobile phones, of which most will be qualcomm.

But, and I'm replying to you directly again, you seem to have this idea that gpu's without mesh shader support are in the minority.

I never stated that, in fact I don't state anything about mesh shaders in this thread. Which is weird because it seem a vast amount of your argument seems to be revolving around that. (That's why this response is vastly smaller as I don't include most of your mesh shader talk)

You seem to have presumed that mobile gpu's are holding this project and it's performance back because of older vulkan versions. But who ever said they did?

Not me lol, I never said they hold back this mod's performance as a whole due to their existance. I'm saying that specifically not implementing newer vulkan extensions or techniques to improve performance solely on the fact that "oh but theres like 3 mobile players that won't be able to use these" argument and thus not developing it is inherently dumb.

Who said that a lower minimum vulkan base extensions version is keeping this mod from performing as good as it can?

The fact that you can use newer functions and abstractions that simply perform better, which do not exist on older vulkan implementations

The devs even said they had multiple reasons for not using vulkan 1.2. Would it be better if everything had an up to date spec compliant vulkan 1.3 driver with all optional extensions implemented? yes. Does that mean that the mod will perform worse because it's working around older vulkan drivers? no, not necessarily.

Exactly, it's not necessarily making the mod worse for supporting older vulkan drivers, but it is holding it back for a userbase counted in less than 100s, when it could be using extensions and features in vulkan 1.3 that improve performance.

commented

Sure but at that point we're talking about fractions of fractions of a playerbase. It shouldn't mean to hold the entire project back for them

I don't think you have any idea how many phones don't use qualcomm

Do you? And again this is already a tiny fraction, pojav launcher is a few percent of this mod's playerbase at best. People can use older versions if their device doesn't support newer vulkan specification, which even the current android devices running vulkan which are "compliant" with 1.1 (at best, maybe 1.2 if you're on the latest qualcomm devices on their stock driver) barely work, while everyone else can get improvements thanks to new extensions on newer version of the mod. It just makes 0 sense to sacrifice this for a tiny playerbase which already has issues running this mod, and at the same time not allowing more optimization for the majority of people running it.

commented

Sure but at that point we're talking about fractions of fractions of a playerbase. It shouldn't mean to hold the entire project back for them

I don't think you have any idea how many phones don't use qualcomm

Do you? And again this is already a tiny fraction, pojav launcher is a few percent of this mod's playerbase at best. People can use older versions if their device doesn't support newer vulkan specification, which even the current android devices running vulkan which are "compliant" with 1.1 (at best, maybe 1.2 if you're on the latest qualcomm devices on their stock driver) barely work, while everyone else can get improvements thanks to new extensions on newer version of the mod. It just makes 0 sense to sacrifice this for a tiny playerbase which already has issues running this mod, and at the same time not allowing more optimization for the majority of people running it.

I do, the answer is a sh*t ton. To give only a small example: every samsung phone sold outside of the US doesn't use qualcomm, all of them have arm mali gpu's. Any android device using exynos, mediatek, unisoc, amlogic, rockchip, allwinner, nvidia, huawei, broadcomm, etc doesn't have turnip.
Also I'm all for implementing mesh shader support, it would be a great performance optimization and I'm not here to argue against it.
But you have to keep in mind mobile gpu's won't be supported at all. As far as I know there are currently no mobile gpu's that support mesh shading.
Correct me if I'm wrong but your argument to "just use turnip" doesn't hold much water when it comes to the entire mobile market and especially not when it comes to any mobile phone gpu, even including all gpu's that support turnip as none of those support mesh shaders.
I think this project should support mesh shaders if there is a way to code it so that it could also run without. Or if the project's devs don't care about mobile phone support and don't mind dropping some gpu's and reducing performance for gpu's that merely have emulated mesh shading like amd gpu's do on linux with mesa radv drivers then there's nothing stopping mesh shader support. It would be a great performance boost for gpu's with hardware mesh shaders support.

But, and I'm replying to you directly again, you seem to have this idea that gpu's without mesh shader support are in the minority. This is completely and provably false. Mesh shaders are natively supported on turing+(16000+ 2000+) nvidia gpu's, amd rdna2, aka rx6000+ and ryzen 6000 mobile and 7040+ apu's(all others including all am4 ones have gcn(no mesh shaders)). intel supports mesh shading on their dedicated gpu's: their arc desktop and mobile pcie gpu's and on their just launched meteor lake 14th gen cpu's integrated gpu's.
On linux only, mesa radv devs also added emulated support for mesh shaders to all gcn gpu's, so those can run it but they won't have any speed advantage. In fact emulated mesh shaders will likely be slower.
There is currently no mobile gpu that supports mesh shaders. So all mobile gpu's no matter from what soc manufacturer would be dropped. I found apple referring to their own implementation of mesh shader support in their metal api, but idk what apple hardware supports that and as far as I can tell, moltenvk hasn't implemented mesh shaders on top of metal 3 at all so that's a no go anyways.

You seem to have presumed that mobile gpu's are holding this project and it's performance back because of older vulkan versions. But who ever said they did? Who said that a lower minimum vulkan base extensions version is keeping this mod from performing as good as it can?
The devs even said they had multiple reasons for not using vulkan 1.2. Would it be better if everything had an up to date spec compliant vulkan 1.3 driver with all optional extensions implemented? yes. Does that mean that the mod will perform worse because it's working around older vulkan drivers? no, not necessarily.
The only thing that seems to hold back anything is mesh shader support and as I laid out that's for very good reasons. The devs themselves even said they don't have gpu's with mesh shaders, so it's unreasonable to expect them to make their own mod incompatible with their own gpu's.
After all this is a Minecraft performance mod, and those are usually for people with older hardware to get some extra performance, not for people with the latest nvidia rtx4090 to see 600 fps instead of 400 fps while dropping support for everyone with a vulkan gpu without mesh shaders who actually needs the extra performance.

commented

Let's agree to disagree on how much of the mobile user base is qualcomm

Sure, but let's agree that mobile usage of this mod IN GENERAL, is tiny. I don't know why you never acknowledge this, one of my biggest reoccuring points is that regardless of whether or not qualcomm is dominant or not, let's say it's less than 40% which is generous, that's less than 40% of people that use vulkanmod in the less than 1% of people that use it inside pojavlauncher. That's tiny fractions. They shouldn't even be part of the discussion at that point.

Are you arguing against current peformance left unused because of such a scenario or are you warning about theoretical future performance that might go unused.

Option B.

Can you give examples of any significant performance downsides.

I am sadly not that informed of this mod's exact inner workings, but it is generally safe to assume that newer extension can simplify vulkan instructions thank to new abstractions that also perform better

commented

Already off to a rocky start, I live in the EU and they do sell phones with qualcomm

Yes they do, the, for now, current generation flagship samsung phones use qualcomm outside of the US but I didn't mention those because they're an exception as samsung is undergoing some big changes in their exynos chip design and they're set to use exynos again for their upcoming flagship generation and while flagship phones are the most talked about in tech news they are not the majority of phones sold.

Which again is a fraction of a fraction

True it doesn't, but thankfully this mod's "market" is fractions of a precentage composed of mobile phones, of which most will be qualcomm.

Let's agree to disagree on how much of the mobile user base is qualcomm as I don't see us coming to an agreement on that. You assume most phones ever using this will be adreno 600+, I don't. Your suggestion is to decrease the amount of mobile devices supported. As it's your opinion that the majority of devices wouldn't be dropped while I think a very significant percentage would, arguing about the impact isn't going to go anywhere it seems.

I never stated that, in fact I don't state anything about mesh shaders in this thread. Which is weird because it seem a vast amount of your argument seems to be revolving around that. (That's why this response is vastly smaller as I don't include most of your mesh shader talk)

I apologize as this is in an issue about mesh shader support, I presumed your comment was related.

Not me lol, I never said they hold back this mod's performance as a whole due to their existance. I'm saying that specifically not implementing newer vulkan extensions or techniques to improve performance solely on the fact that "oh but theres like 3 mobile players that won't be able to use these" argument and thus not developing it is inherently dumb.

Yes, but do you believe that there is currently potential performance enabled by extensions currently not used because of this reason?
Are you arguing against current peformance left unused because of such a scenario or are you warning about theoretical future performance that might go unused.

The fact that you can use newer functions and abstractions that simply perform better, which do not exist on older vulkan implementations

Can you give examples of any significant performance downsides. I can respect making an argument to devs not to let a bunch of performance on the table just to support a small user base if that ever became a scenario but your original comment presumed that either they had decided to do that in the future or they were already holding performance back for that specific reason. After arguing back and forward with you it seems you may have intended something slightly different than what you wrote. If that's the case then it's an honest misunderstanding.

Exactly, it's not necessarily making the mod worse for supporting older vulkan drivers, but it is holding it back for a userbase counted in less than 100s, when it could be using extensions and features in vulkan 1.3 that improve performance.

Here we hit the same issue in our difference of opinion when it comes to impact.
What extensions is it not using, that would improve performance, because of a lack of mobile support? As far as I can tell when they were talking about not using extensions that could give extra performance they were talking about driver support in general, not just on android. It seems you assumed thay were talking about android and you assumed that they were doing this just to support a user base of 100s. But then again I could be wrong.
I think we're not going to get to a conclusion unless a dev lists any extension that would improve performance in a way that cannot be worked around for drivers that don't have it. Essentially performance that could not be obtained without use of those extensions for extensions that it currently doesn't use because of wanting to support older vulkan drivers on android like older mali ones etc. That is if those exist.

commented

(Sorry this is long, hope this answers your questions)

Technically VulkanMod is using Vulkan 1.1 features instead of 1.2 (I forgot why we use 1.2, its to do with driver issues iirc) So no VK12 capabilities are being used currently

To explain the issues w/ VK_EXT_mesh_shader(Mesh Shaders + Meshlet Culling) + why it was never implemented

  • We don't have any compatible GPUs that can even use it (We all use old Cards)
  • We Are extremely limited by relying on Vanilla Code for Chunks
    • So we don't have a meshing system rn that can remotely handle Meshletization_(Converting Chunks to Meshlets
    • I'm wrong you don't actually need meshlets, they are just the best performing way of using Mesh Shaders

(The primary limitation is our outdated hardware tbh (We use a GTX 1080 Ti + RX 580's))

ATM to compensate for Mesh Shaders, i'm thinking about researching into making VulkanMod more GPU-Driven
Such as GPU Occlusion Culling, LODs, and/or Mesh merging techniques

Afaik the main benefit of Mesh Shaders is Meshlet Culling
So on paper the above workarounds might compensate for the lack of Mesh Shaders surprisingly well

But these are very hypothetical currently, and we've been busy with other aspects of VulkanMod
So haven't got around to it just yet

commented

Also forgot to mention that the other reason we don't use Vulkan 1.2
Is because of Mobile compatibility issues with Android Drivers
(Alot of Android Drivers are very outdated, and often don't support Vulkan 1.2 at all)

There are Extensions, but these are NG as not all drivers 100% support/include them

commented

If you guys are interested, i'd be happy to assist with testing something that requires newer cards. Got a 3060ti, might also be an opportunity for me to learn a bit about 3d rendering.

commented

Also forgot to mention that the other reason we don't use Vulkan 1.2 Is because of Mobile compatibility issues with Android Drivers (Alot of Android Drivers are very outdated, and often don't support Vulkan 1.2 at all)

There are Extensions, but these are NG as not all drivers 100% support/include them

Why is Android being accounted for? Java Minecraft is PC only?

commented

Sure, but let's agree that mobile usage of this mod IN GENERAL, is tiny. I don't know why you never acknowledge this, one of my biggest reoccuring points is that regardless of whether or not qualcomm is dominant or not, let's say it's less than 40% which is generous, that's less than 40% of people that use vulkanmod in the less than 1% of people that use it inside pojavlauncher. That's tiny fractions. They shouldn't even be part of the discussion at that point.

Also you can just use sudium over ANGLE i think

commented

I think this project should support mesh shaders if there is a way to code it so that it could also run without. Or if the project's devs don't care about mobile phone support and don't mind dropping some gpu's and reducing performance for gpu's that merely have emulated mesh shading like amd gpu's do on linux with mesa radv drivers then there's nothing stopping mesh shader support. It would be a great performance boost for gpu's with hardware mesh shaders support.

There is but the only simple one i can think of is detecting mesh shader support and having 2 rendering engines witch is dificult

commented

Also you can just use sudium over ANGLE i think

You can't since 0.5.0

commented

0.5.0 broke so much compatibility

In this case it is an Angle fault, because its OpenGL 3.2 parity isn't perfect.

how would a suodium update change it?

Sodium uses OpenGL at an advanced level, especially in newer versions. I'm not surprised that this has happened. Anyway, it would be nice to use native Vulkan instead of emulated OpenGL-on-Vulkan.

commented

Regarding phone support, I find it to be the weakest justification for not implementing advanced Vulkan features. Playing Java Minecraft on a phone is an incredibly niche use case, to the point where most people have no idea that you can.

In the case of not adding mesh shaders, least for now, because many GPUs, including the developer's, don't support them, I think that's a good reason to hold off on specifically mesh shaders. But I think trying to take into account phones in a PC first game, is a fools errand.

commented

Regarding phone support, I find it to be the weakest justification for not implementing advanced Vulkan features. Playing Java Minecraft on a phone is an incredibly niche use case, to the point where most people have no idea that you can.

In the case of not adding mesh shaders, least for now, because many GPUs, including the developer's, don't support them, I think that's a good reason to hold off on specifically mesh shaders. But I think trying to take into account phones in a PC first game, is a fools errand.

This is what we began to realise tbh

Optimising for PC and Mobile platform at the same time is difficult as they don't mix well and work against each other.
So an optimisation for one will harm the other and visa versa (Mobile GPU tilers work very differently than PC hardware)

This was becoming a major problem and was holding back development + VulkanMod itself.

So in the end we've decided to drop Android support completely.
(As myself/someone else can always create their own VK11 fork of VulkanMod for Android)

This frees things up greatly and allows us to begin to make full use of Vulkan 1.2 capabilities going forward.
Which hopefully should also be a major step up in terms of what capabilities are available to the mod as well

commented

Regarding phone support, I find it to be the weakest justification for not implementing advanced Vulkan features. Playing Java Minecraft on a phone is an incredibly niche use case, to the point where most people have no idea that you can.

In the case of not adding mesh shaders, least for now, because many GPUs, including the developer's, don't support them, I think that's a good reason to hold off on specifically mesh shaders. But I think trying to take into account phones in a PC first game, is a fools errand.

Regarding Mesh Shaders afaik they are not tehcically a hard requirement

To my current knowledge Mesh Shaders are mostly beneficial for manipulating Geometry (i.e. Occlusion Culling, Tesselation, LODs e.g)_

The vast majority of this can also be done with Compute Shaders, which is available in Vulkan 1.0

With the primary drawbacks of increasing code complexity + consuming more VRAM Bandwidth than Mesh Shaders afaik

commented

I'm closing this as it is going massively off topic.

commented

I think a reasonable solution to implement this is to add feature levels

Like 3-5 "tiers" of hardware support
With each higher tier providing some extension that we can use for increased performance

This reduces the amount of Vulkan supported feature configurations we need to support
Whilst increasing the amount of performance we can get

Although we absolutely first need to get the current development goals out of the way

commented

Just use pocket edition over gneyser and dont use mods

In fact, VulkanMod builds for Android performs noticeably better than Bedrock Edition. Here's an example:
Screenshot_20240105-030945

Screenshot_20240106-022636

16 chunks on Java Edition with VulkanMod V14 vs 13 chunks on Bedrock. I tested Java Edition first and didn't know that Bedrock limits the distance to 13 chunks on my phone, so the scene on 1st screenshot has x1.5 more chunk sections than in Bedrock