mojira.dev
MC-307387

When using Vulkan, the `Globals` uniform is not available in multiple core shaders unless explicitly defined

When Vulkan is enabled (this is not an issue on OpenGL), the Globals uniform is not available in various core shaders unless explicitly defined in the relevant RenderPipeline. Trying to access it will cause the following error:

Couldn't compile pipeline minecraft:pipeline/x: Unable to find shader defined uniform (Globals)
The shaders I’ve noticed this in so far include:

  • animate_sprite_blit, animate_sprite_interpolate, and their vertex shader

  • stars

  • lightmap

Environment

Vulkan

Attachments

Comments 5

this is not an issue when using opengl

Hi!
Thank you for your report! 

Could you please provide more details or any relevant media files?

  • Can you record a video of the issue and upload it?

Quick Links
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

I can also confirm that this is an issue. It only happens on the new Vulkan render backend.

I’ve also made a small resource pack for reproducing this exact problem. It essentially just modifies the “core/text” shader. The line that is responsible for including “minecraft:globals.glsl” essentially breaks the entire shader file, making it impossible to use globals like GameTime in the shader. As you can see in the attached video it works fine on the OpenGL backend.

(This was tested on Windows 11 with an NVIDIA GPU)

[media][media]

Confirmed in 26.1-snapshot-3

Sorry, 26.2-snapshot-3*

George

(Unassigned)

Confirmed

Platform G

Important

Rendering

26.2 Snapshot 1

Retrieved