Skip to content

Water shader fails to compile under LÖVE 12 + Metal (mediump parameter qualifiers on effect) — lakes draw flat on iOS #76

Description

@luisgonzaleznf

Summary

Under LÖVE 12 with the Metal backend, the water shader fails to compile and lakes fall back to flat animated water. The mod otherwise runs normally, so the only symptom is silently missing reflections plus a warning in the log.

[warn] [DRAMATIC_SHAPE] water shader did not compile: Error parsing pixel shader:

ERROR: 0:546: 'mediump' : overloaded functions must have the same parameter precision qualifiers for argument 1
ERROR: 0:546: 'mediump' : overloaded functions must have the same parameter precision qualifiers for argument 3
ERROR: 0:546: 'mediump' : overloaded functions must have the same parameter precision qualifiers for argument 4
ERROR: 0:546: '' : missing #endif
ERROR: 0:546: '' : compilation terminated
ERROR: 5 compilation errors.  No code generated.

 -- lakes draw flat

Where

lib/Water.lua, the pixel entry point:

vec4 effect(mediump vec4 color, Image tex, mediump vec2 tc, mediump vec2 sc) {

Arguments 1, 3 and 4 are exactly the three mediump-qualified floats; argument 2 is Image tex, which carries no precision qualifier and is not flagged. The qualifiers are deliberate — the comment above the signature explains they pin the stage default rather than inherit it — but LÖVE 12 evidently declares effect with different parameter precision, so the override reads as a mismatched overload and the compile aborts.

The trailing missing #endif looks like a cascade rather than a real defect: the file's preprocessor directives balance (7 × #if/#ifdef/#ifndef against 7 × #endif), and the compiler reports compilation terminated after the five errors, so it never reaches the closing directive.

Scope

LÖVE backend water shader
11.5 OpenGL compiles
12 OpenGL compiles
12 Metal fails

So it is specific to LÖVE 12 + Metal — which is what the iOS shell runs, meaning lakes currently draw flat on iOS.

Environment

  • macOS, LÖVE 12.0 nightly (love-macos CI artifact), backend forced via t.renderers
  • macOS, LÖVE 11.5 (gen1recomp desktop build) as control
  • DRAMATIC_SHAPE 1.5.1, stock — reproduced before any local patching
  • Also present on iPhone 15 Pro Max / iOS 27.0, gen1recomp v0.1.56 iOS IPA

Same testing session as #74, but an independent problem — #74's shadow fix does not touch this and does not resolve it.

Happy to test a candidate fix on device or on the local LÖVE 12 rig.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions