{"record":{"id":"fbd4102db395f023","repo":"pbakaus/impeccable","slug":"program-link-failed-gl-getprograminfolog-progra","errorCode":null,"errorMessage":"program link failed: ${gl.getProgramInfoLog(program)}","messagePattern":"program link failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skill/scripts/live-browser.js","lineNumber":8619,"sourceCode":"            || canvas.getContext('experimental-webgl');\n    if (!gl) {\n      // WebGL unavailable: use the captured bitmap as a background overlay so\n      // the user still sees something meaningful during generation.\n      if (abandoned(canvas, null)) return;\n      showShaderBitmapFallback(canvas, blob);\n      return;\n    }\n\n    let program, texture;\n    try {\n      const vs = compileShader(gl, gl.VERTEX_SHADER, SHADER_VS);\n      const fs = compileShader(gl, gl.FRAGMENT_SHADER, SHADER_FS);\n      program = gl.createProgram();\n      gl.attachShader(program, vs);\n      gl.attachShader(program, fs);\n      gl.linkProgram(program);\n      if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n        throw new Error('program link failed: ' + gl.getProgramInfoLog(program));\n      }\n      // Full-screen quad\n      const buf = gl.createBuffer();\n      gl.bindBuffer(gl.ARRAY_BUFFER, buf);\n      gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n        -1, -1, 0, 1,\n         1, -1, 1, 1,\n        -1,  1, 0, 0,\n        -1,  1, 0, 0,\n         1, -1, 1, 1,\n         1,  1, 1, 0,\n      ]), gl.STATIC_DRAW);\n      const posLoc = gl.getAttribLocation(program, 'a_position');\n      const uvLoc = gl.getAttribLocation(program, 'a_uv');\n      gl.enableVertexAttribArray(posLoc);\n      gl.vertexAttribPointer(posLoc, 2, gl.FLOAT, false, 16, 0);\n      gl.enableVertexAttribArray(uvLoc);\n      gl.vertexAttribPointer(uvLoc, 2, gl.FLOAT, false, 16, 8);","sourceCodeStart":8601,"sourceCodeEnd":8637,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/skill/scripts/live-browser.js#L8601-L8637","documentation":"Thrown when the WebGL program built from the compiled vertex + fragment shaders fails to link: gl.getProgramParameter(program, gl.LINK_STATUS) is false. The message embeds gl.getProgramInfoLog(program), which typically reports mismatched varyings/uniforms or resource limits between the two shader stages.","triggerScenarios":"attachShader + linkProgram on a valid context where the vertex and fragment shaders are incompatible (e.g. a varying written in the vertex shader but declared with a different type, or not declared, in the fragment shader), or the program exceeds driver limits.","commonSituations":"Editing SHADER_FS or the vertex shader so their varying/interface declarations diverge; drivers that reject implicit conversions; running on devices with restrictive shader resource limits.","solutions":["Read the program info log in the message — it names the linking incompatibility","Ensure varyings/attributes used in the fragment shader are declared identically in the vertex shader","Confirm both shaders compiled (compileShader would have thrown first) and were attached before linkProgram","Revert recent GLSL edits and re-apply incrementally to find the mismatching declaration"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"gl.linkProgram(program);\nif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n  console.warn(gl.getProgramInfoLog(program));\n}","typeGuard":null,"tryCatchPattern":"try {\n  program = createShaderProgram(gl, SHADER_VS, SHADER_FS);\n} catch (err) {\n  if (err.message.startsWith('program link failed')) {\n    console.error(err.message);\n    showToast('Shader program unavailable on this GPU; disabling the effect.');\n  }\n}","preventionTips":["Keep varying declarations identical (name and type) across vertex and fragment shaders","Link only after both shaders report COMPILE_STATUS","After editing GLSL, re-read getProgramInfoLog — link errors surface stage mismatches compile misses","Validate on target devices; link failures are often driver/resource-limit specific"],"tags":["webgl","shader","program-link","glsl"],"backgroundTag":"shader-compile-failed","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}