pbakaus/impeccable · warning

[impeccable] shader setup failed:

Error message

[impeccable] shader setup failed:

What it means

The WebGL shader overlay (the live visual shown while generating) compiles its program, allocates buffers, and wires attribute pointers inside one try block. Any throw — context creation failed, shader compile/link error, WebGL unavailable or context lost — logs 'shader setup failed:', removes the canvas, and returns: generation continues normally, just without the animated overlay.

Source

Thrown at skill/scripts/live-browser.js:8392

      // Full-screen quad
      const buf = gl.createBuffer();
      gl.bindBuffer(gl.ARRAY_BUFFER, buf);
      gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
        -1, -1, 0, 1,
         1, -1, 1, 1,
        -1,  1, 0, 0,
        -1,  1, 0, 0,
         1, -1, 1, 1,
         1,  1, 1, 0,
      ]), gl.STATIC_DRAW);
      const posLoc = gl.getAttribLocation(program, 'a_position');
      const uvLoc = gl.getAttribLocation(program, 'a_uv');
      gl.enableVertexAttribArray(posLoc);
      gl.vertexAttribPointer(posLoc, 2, gl.FLOAT, false, 16, 0);
      gl.enableVertexAttribArray(uvLoc);
      gl.vertexAttribPointer(uvLoc, 2, gl.FLOAT, false, 16, 8);
    } catch (err) {
      console.warn('[impeccable] shader setup failed:', err);
      canvas.remove();
      return;
    }

    // Upload the screenshot as a texture
    let bitmap;
    try {
      bitmap = await createImageBitmap(blob);
    } catch (err) {
      console.warn('[impeccable] shader bitmap decode failed:', err);
      const lose = gl.getExtension?.('WEBGL_lose_context');
      try { lose?.loseContext(); } catch {}
      showShaderBitmapFallback(canvas, blob);
      return;
    }
    texture = gl.createTexture();
    gl.bindTexture(gl.TEXTURE_2D, texture);
    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);

View on GitHub (pinned to f88b2837a7)

Solutions

  1. Treat as cosmetic — the generate/steer flow completes without the overlay
  2. Reload the page to obtain a fresh WebGL context; close GPU-heavy tabs
  3. Enable hardware acceleration in browser settings if overlays matter
Defensive patterns

Strategy: fallback

Validate before calling

const gl = canvas.getContext('webgl');
if (!gl) { canvas.remove(); return; } // skip overlay entirely when WebGL is unavailable

Try / catch

try { /* program + buffer + attribute setup */ } catch (err) { console.warn('shader setup failed:', err); canvas.remove(); return; } // generation proceeds without the overlay

Prevention

When it happens

Trigger: WebGL context lost (GPU reset, too many live contexts); hardware acceleration disabled or GPU blocklisted; shader compile failure after a browser/driver change; gl.getAttribLocation returning -1 leading to invalid vertex array state.

Common situations: Machines with GPU blocklists or virtualized GPUs; many tabs each holding WebGL contexts; users running with hardware acceleration off; remote-desktop sessions.

Related errors


AI-assisted analysis of pbakaus/impeccable@f88b2837a7 (2026-08-18). Data as JSON: /api/errors/b4ef12af82d4d2be. Report an issue: GitHub.