xCollateral / VulkanMod

Vulkan renderer mod for Minecraft.
GNU Lesser General Public License v3.0
1.51k stars 177 forks source link

[Enhancement] Add a shader compilation notice #214

Closed Splarkszter closed 10 months ago

Splarkszter commented 1 year ago

You know, vulkan common thing compiling shaders on the background.

Add a notice so people don't freak out viewing their FPS go down and their CPU is at 100% usage.

I experienced it myself here on Linux with steam/proton so i rapidly figured out what it means when i saw that what happened on minecraft using this mod for the first time; so i'm pretty sure it is that, since now i get the normal 200FPS+ i get on this potato with this mod.

Possibly Compiling Shaders:

When standing still
When loading chunks:

Finished Compiling Shaders:

Now when standing still:
Now when loading chunks:
Splarkszter commented 1 year ago

Possibly Compiling Shaders:

image When Loading Chunks: image

Finished Compiling Shaders:

image Now When Loading Chunks: image

Splarkszter commented 1 year ago

Notes:

xCollateral commented 1 year ago

Pipeline/Shader creation does cause some stutter but it's very limited. I think the stuttering you are experiencing comes from chunk sections uploads.

thr3343 commented 1 year ago

As xCollateral mentioned, shader stutter is a nonissue, as this mod only uses about 50 shaders to handle Minecraft itself, with most of them (about 30+) are compiled and loaded at the red Mojang splash screen before even entering the world which takes less than a second to compile.

(Most of the actual lag is from DataFixerUpper being stupid and maxing out the CPU at 100%, which is a seperate issue and fixable using LazyDFU)

ShaderC is used to compile the shaders, which is very fast and IIRC only takes at most about 50ms per shader.

And once a shader is loaded, it is only compiled once and never compiled again, so shutter should be virtually nonexistent

However i use an old 2014 i7 4790K with a GTX 1080Ti, which is very old, but may still compile the shaders much faster than other people's setups.

thr3343 commented 1 year ago

Howver on the other hand, a Shader Compilation notice is a very good idea imho if heaver shaders (e.g. Shaderpacks) are ever used in the future, as ATM shaders are not currently reloaded with F3+T afaik as VulkanMod doesn't have full control over the Shader System Mojang uses atm.

Splarkszter commented 1 year ago

Hmmm... i'll try by installing all the optimization mods that i commonly use and that at least don't crash the game when used along vulkan(because who knows if they are active or unactive), on a fresh instance to see the the behavior exists specially while having LazyDFU active.

If i remember correctly, the instace on the issue report only had vulkanMod installed so that could be a thing, but the strange thing is that it only happened the first time the game bootted up. I'll test regardless, I'll be back.

Splarkszter commented 1 year ago

Ok, i didn't even need to test much, yeah, it's probably DFU what causes my issue if you said so, i had no issues when having at least LazyDFU, and worked fine.

Mod List:

Game loads usually in less than 35 seconds

While first loading game:
First joining world (Before was 20-26FPS):
thr3343 commented 1 year ago

Its not your fault for getting confused, as I thought it was shader compilation as well several months ago, however this mod does seem to have abnormally bad issues with Initial Loading lag as DFU normally isn't this extreme/bad in most cases outside of super heavy modpacks. (Which isn't helped by slow ChunK Rebuilding/Uploading)

I still think having a much better shader management system with Compilation notices is a good idea, as we only mostly get away with it ATM due to how cheap the default Core shaders are to compile using ShaderC as they are tiny compared to many shader packs.

However Shader compile lag will definately become a problem when/if this mod becomes able to support custom shaders, so your suggestion is still very valid and relevant in my opinion.