Ask the driver what filter a texture actually got

Chasing the flaky pixel-art check needs to tell two things apart that
look identical in a screenshot: a scale mode the model never changed,
and one that changed but never reached the sampler. Only the driver can
answer the second, so `__gm.textureFilter(file)` returns the model's
scaleMode next to `gl.getTexParameter` on the uploaded texture.

It binds through `renderer.texture.bindSource` rather than a raw
`bindTexture`, so measuring does not corrupt Pixi's idea of what is
bound and become a source of flakiness itself. `TextureLibrary.peek`
looks a picture up without starting a load or touching its scale mode,
which `get` would do.

Sixty measurements later the filter path is cleared: model and driver
agreed every time, across repeated switches, after the full module
run-up, and through a forced context loss. The instrument stays; the
note in todo-notes/flaky-pixel-art-filter.md stays open.
This commit is contained in:
root committed 2026-09-09 15:21:51 +02:00
1 parent e9634f0f0d
commit 2f4dc843d7
2 files changed
+36

No files matched your search

+5
View File
@@ -42,6 +42,11 @@ export class TextureLibrary {
return texture;
}
/** The picture if it is in memory, without starting a load or touching the scale mode. */
peek(file: string): Texture | null {
return this.loaded.get(file) ?? null;
}
/** Runs `fn` whenever a picture has arrived; returns the unsubscribe. */
onChange(fn: () => void): () => void {
this.listeners.add(fn);