Earlier quoted context omitted.
I’m not even a neophyte here but why don’t precompiled shaders solve that?
Depends what you're precompiling. For Vulkan you already ship "pre-compiled" shaders in SPIR-V form. The SPIR-V needs to be compiled to GPU ISA before it can run. You can't, in general, pre-compile the SPIR-V to GPU ISA because you don't know the target device you're running on until the app launches. You would have to precompile ISA for every GPU you ever plan to run on, for every platform, for every driver version…
Minecraft Java is switching from OpenGL to Vulkan
31–40 of 177 posts
Re: Minecraft Java is switching from OpenGL to Vulkan
#32I wasn’t aware Java had Vulkan bindings. So this is JNI I’m guessing? This makes sense. I guess I’m a bit surprised they were still OpenGL anywhere. I never really got into Minecraft though, so I can’t pretend I know much about its current state. I didn’t even realize there was a non-Java version for desktops.
Hopefully it would use the Foreign Function and Memory API instead of JNI.
Re: Minecraft Java is switching from OpenGL to Vulkan
#33Re: Minecraft Java is switching from OpenGL to Vulkan
#34Not a bad choice... since Minecraft Java edition only supports desktops, they don't have to deal with the abysmal Vulkan drivers on mobile. Though I thought a company large as Microsoft would have the resources to build a cross-platform RHI with the most stable API available for each platform (DX12 for Windows and Metal for macOS)...
Honestly pick between Vulkan and DX12 is very superficial. But you can easily make Vulkan run on macOS. Not sure what would be the reason to use DX12 in the new project today given free choice of technology, especially when team comes from OpenGL.
I'm making a joke, but it's also true.
Re: Minecraft Java is switching from OpenGL to Vulkan
#35Earlier quoted context omitted.
Depends what you're precompiling. For Vulkan you already ship "pre-compiled" shaders in SPIR-V form. The SPIR-V needs to be compiled to GPU ISA before it can run. You can't, in general, pre-compile the SPIR-V to GPU ISA because you don't know the target device you're running on until the app launches. You would have to precompile ISA for every GPU you ever plan to run on, for every platform, for every driver version…
There's two tiers of precompiled though. Even if you can't download them precompiled, you can compile before the game launches so there are no stutters after.
But in reality the exhaustive pre-compile will compile way more than will be used by any given game session (on average) and waste lots of time. Also you would have to recompile every time the user upgraded their driver version or changed hardware. And you're likely to churn a lot of customers if you smack them with a 30+ minute loading screen.
Precisely which shaders get used by the game can only be correctly discovered at runtime in many games, it depends on the precise state of the game/renderer and the quality settings and often hardware vendor if there are vendor-specific code paths.
Some games will get QA to play a bunch of the game, or maybe setup automated scripts to fly through all the levels and log which shaders get used. Then that log gets replayed in a startup pre-compile loading screen so you're at least pre-compiling shaders you know will be used.
Re: Minecraft Java is switching from OpenGL to Vulkan
#36Earlier quoted context omitted.
There's two tiers of precompiled though. Even if you can't download them precompiled, you can compile before the game launches so there are no stutters after.
Yes, many games do that too. Depending on how many shaders the game uses and how fast the user's CPU is an exhaustive pre-compile could take half an hour or more. But in reality the exhaustive pre-compile will compile way more than will be used by any given game session (on average) and waste lots of time. Also you would have to recompile every time the user upgraded their driver version or changed hardware. And you'…
Steam could improve the experience here by having the shaders compile overnight in the background so it presents zero delay but the current way doesn't bother me much at all.
Re: Minecraft Java is switching from OpenGL to Vulkan
#37Earlier quoted context omitted.
Honestly pick between Vulkan and DX12 is very superficial. But you can easily make Vulkan run on macOS. Not sure what would be the reason to use DX12 in the new project today given free choice of technology, especially when team comes from OpenGL.
The reason you use DX12 in a new project is so that you can get good linux support. I'm making a joke, but it's also true.
Re: Minecraft Java is switching from OpenGL to Vulkan
#38Earlier quoted context omitted.
The reason you use DX12 in a new project is so that you can get good linux support. I'm making a joke, but it's also true.
How good does Wine support DX12?
Re: Minecraft Java is switching from OpenGL to Vulkan
#39Earlier quoted context omitted.
How good does Wine support DX12?
Support for DX12 under Proton in linux is incredibly good. Some games actually run faster under DX12 in Proton than the native versions do.
Re: Minecraft Java is switching from OpenGL to Vulkan
#40Earlier quoted context omitted.
Yes, many games do that too. Depending on how many shaders the game uses and how fast the user's CPU is an exhaustive pre-compile could take half an hour or more. But in reality the exhaustive pre-compile will compile way more than will be used by any given game session (on average) and waste lots of time. Also you would have to recompile every time the user upgraded their driver version or changed hardware. And you'…
I don't think this is as much of an issue as you are making it out to be. I have my Steam Deck on the main branch release which seems to exclude it from downloading precompiled shaders. When a game updates it has to compile the shaders first, but even on a big game this does not take an unreasonable amount of time. Less time than it takes for game updates to download at least. Steam could improve the experience here…