mirror of
https://github.com/opengeos/GeoLibre.git
synced 2026-11-04 10:43:36 +00:00
On Intel and AMD integrated graphics (Mesa) a Zarr layer with a CRS vanished as soon as MapLibre left the globe transition: at zoom 12 and above with the globe projection, and at every zoom in plain Mercator. @carbonplan/zarr-layer compiles its flat source-projected shader there, where shift_x, shift_y and u_worldXOffset only feed a varying the fragment shader never reads. Mesa eliminates them at link time and reports them inactive, the renderer's strict uniform lookup threw on every frame, and MapLibre's frame loop swallowed the exception, so nothing surfaced in the UI. NVIDIA keeps the uniforms active, which is why it never reproduced there. Carry the upstream fix (carbonplan/zarr-layer#91) as a patch-package patch until a release ships it: look those three uniforms up without throwing, as the renderer already does for its matrix uniforms. A test pins the installed bundle so a dependency bump that silently drops the patch fails the suite. Fixes #2357
19 lines
682 B
JavaScript
19 lines
682 B
JavaScript
import { existsSync } from "node:fs";
|
|
import { spawnSync } from "node:child_process";
|
|
|
|
// Workspace-scoped production installs, such as the collaboration worker
|
|
// image, do not install the desktop app's dependencies (every patched package
|
|
// is one of them). There is nothing to patch in those trees, and asking
|
|
// patch-package to find @cogeotiff/core would make an otherwise valid
|
|
// `npm ci --omit=dev` fail.
|
|
if (!existsSync("node_modules/@cogeotiff/core/package.json")) {
|
|
process.exit(0);
|
|
}
|
|
|
|
const result = spawnSync("patch-package", [], {
|
|
shell: process.platform === "win32",
|
|
stdio: "inherit",
|
|
});
|
|
if (result.error) throw result.error;
|
|
process.exit(result.status ?? 1);
|