Skip to content

Crash on macOS (Apple Silicon / Metal): VeilRenderSystem.renderer is null during bootstrap #179

Description

@hooligan520

Environment

  • OS: macOS 26.2 (aarch64)
  • CPU: Apple M3 Pro
  • GPU: Apple M3 Pro (Metal rendering, OpenGL 4.1 via Metal - 90.5)
  • Java: 21.0.7, Microsoft OpenJDK
  • Minecraft: 1.21.1
  • NeoForge: 21.1.247
  • Veil version: 4.1.4 (loaded via Sable 2.0.3 jar-in-jar)
  • Launcher: HMCL

Issue

Veil crashes immediately during bootstrap on macOS with Apple Silicon (M3 Pro). The game never reaches the main menu.

The error is a NullPointerException because VeilRenderSystem.renderer is null when getShaderManager() is called:

java.lang.NullPointerException: Cannot invoke "foundry.veil.api.client.render.VeilRenderer.getShaderManager()" because "foundry.veil.api.client.render.VeilRenderSystem.renderer" is null

Stack Trace (key part)

java.lang.NullPointerException: Cannot invoke "foundry.veil.api.client.render.VeilRenderer.getShaderManager()" because "foundry.veil.api.client.render.VeilRenderSystem.renderer" is null
	at foundry.veil.api.client.render.VeilRenderSystem.getShaderManager()
	at foundry.veil.impl.client.render.shader.VeilBackedShaderProgram.<init>()
	at foundry.veil.mixin.client.shader.GameRendererMixin.modifyRenderTypeShaders()

Steps to Reproduce

  1. Install Minecraft 1.21.1 with NeoForge 21.1.247
  2. Add Veil 4.1.4 (either standalone or via Sable jar-in-jar)
  3. Launch on macOS with Apple Silicon (tested on M3 Pro)
  4. Game crashes during initial resource loading

Expected Behavior

Veil should initialize its renderer properly on macOS Metal or gracefully degrade/report an incompatibility.

Additional Notes

  • macOS uses Metal as the backend (OpenGL 4.1 compatibility layer via Metal - 90.5)
  • HMCL crash analyzer reports: BOOTSTRAP_FAILED: mod "veil"
  • The renderer seems to never be initialized before it is accessed
  • This blocks any mod that depends on Veil (e.g., Sable, simulatedcoasters) from running on macOS

Question

Does Veil officially support macOS / Apple Silicon / Metal rendering backend? If not, could this be documented or could the initialization be made to fail gracefully rather than crash?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions