v0.9.1 — The GPU path on the original iPhone was never losing; three stacked measurement bugs said it was
The GPU path on the original iPhone was never losing; three stacked measurement bugs said it was.
PocketJS 0.9.1 corrects the central performance claim of 0.9.0, fixes the two
real defects that produced it, and adds the instrument that settled it — the
device's own framebuffer, read back and diffed against the reference
rasterizer. The rewritten deep
dive tells it in order.
- Correction to 0.9.0. That release reported the OpenGL ES 1.1 path as
2.4× slower than the software rasterizer on the original iPhone. It is
1.8–2× faster: 46.7–49.4 fps against 21.9–26.5, and 19.4–20.5 ms per
frame against 33.9–40.8. The old comparison timed GL's rasterize and
present against software's rasterize only, because the software
composite runs indrawRect:later in the run loop. - Fixed: the software fallback never composited.
+layerClassreturned
CAEAGLLayerunconditionally, and a GL-backed layer never receives
drawRect:. The documented fallback — the one the host drops to whenever GL
fails — computed frames that could not reach the screen. The layer class now
agrees with the selected renderer. - Fixed: the GPU drew colour blocks. In OpenGL ES 1.1 texturing is a
per-unit enable, andglEnable(GL_TEXTURE_2D)was missing, so every fragment
took only its vertex colour: flat fills looked right while all text, images
and font-atlas content silently vanished. ES 2 has no equivalent, which is
exactly why deriving the ES 1 pipeline from the ES 2 one hid it. Also states
GL_MODULATE,glShadeModel(GL_SMOOTH)and an identity texture matrix, with
a test pinning all four. - Pixel parity, off the device. A one-shot
glReadPixelscapture writes the
phone's framebuffer to a file the host pulls over USB. Against the same guest
rendered by the reference core: mean absolute channel difference 0.04 of
255, no channel off by more than 32, worst single channel 7 — the residue
being antialiased glyph edges. First PocketJS host verified by reading pixels
back off physical hardware. - A frame rate you can trust. The device now reports
window_framesand
window_us, so the rate is computed from exact on-device counters instead of
differencing two status records with one-second timestamps — the ±4 fps of
slop that let the original discrepancy hide.
npm: @pocketjs/framework@0.9.1 · @pocketjs/cli@0.9.1 · full changelog