mojira.dev
MC-310382

The game crashes when applying a resource pack with a shader that uses `#include` with uppercase characters in the path

A resource pack shader containing a #include directive with uppercase characters in the filename (#include "BadName.glsl") causes a native crash in shaderc.dll. The game terminates immediately with no error screen or recovery.

This is a regression introduced in 26.3 Snapshot 5, which replaced the Java-side #moj_import preprocessor with native ShaderC #include resolution. Snapshots 1 through 4 are not affected since the ShaderC include callback did not exist in those versions.


Steps to Reproduce

  • Set graphics API to "Prefer OpenGL" in video settings (also reproducible on Vulkan).

  • Restart the game to apply the backend change.

  • Install the attached resource pack.

  • The game crashes immediately during shader compilation on the resource reload.


The attached resource pack overrides assets/minecraft/shaders/core/position_color.vsh with a single added line: #include "BadName.glsl"


Root Cause

In com.mojang.renderpearl.frontend.shaders.GlslCompiler, the ShaderC include resolver callback passes the raw #include argument directly to Identifier.parse() without a try/catch:

this.includeResolver = ShadercIncludeResolve.create((..., requested_source, ...) 
    String requestedShader = MemoryUtil.memASCII(requested_source);
    String shaderContents = this.currentShaderSource.get(
        Identifier.parse(requestedShader).withPrefix("shaders/include/"), null);
    ...
});

Attachments

Comments 1

Thank you for helping us improve Minecraft! We saved your files:

[media][media]

BugTracker - BugTX

RogueLogix

Confirmed

Platform G

Very Important

Resource Packs

26.3 Snapshot 5

26.3 Snapshot 6

Retrieved